Lines Matching refs:leafhdr
64 struct xfs_dir3_icleaf_hdr leafhdr; in xfs_dir3_leaf1_check() local
66 dp->d_ops->leaf_hdr_from_disk(&leafhdr, leaf); in xfs_dir3_leaf1_check()
68 if (leafhdr.magic == XFS_DIR3_LEAF1_MAGIC) { in xfs_dir3_leaf1_check()
72 } else if (leafhdr.magic != XFS_DIR2_LEAF1_MAGIC) in xfs_dir3_leaf1_check()
75 return xfs_dir3_leaf_check_int(dp->i_mount, dp, &leafhdr, leaf); in xfs_dir3_leaf1_check()
93 struct xfs_dir3_icleaf_hdr leafhdr; in xfs_dir3_leaf_check_int() local
103 ops->leaf_hdr_from_disk(&leafhdr, leaf); in xfs_dir3_leaf_check_int()
104 hdr = &leafhdr; in xfs_dir3_leaf_check_int()
390 struct xfs_dir3_icleaf_hdr leafhdr; in xfs_dir2_block_to_leaf() local
424 dp->d_ops->leaf_hdr_from_disk(&leafhdr, leaf); in xfs_dir2_block_to_leaf()
425 leafhdr.count = be32_to_cpu(btp->count); in xfs_dir2_block_to_leaf()
426 leafhdr.stale = be32_to_cpu(btp->stale); in xfs_dir2_block_to_leaf()
427 dp->d_ops->leaf_hdr_to_disk(leaf, &leafhdr); in xfs_dir2_block_to_leaf()
435 xfs_dir3_leaf_log_ents(args, lbp, 0, leafhdr.count - 1); in xfs_dir2_block_to_leaf()
479 struct xfs_dir3_icleaf_hdr *leafhdr, in xfs_dir3_leaf_find_stale() argument
499 for (*highstale = index; *highstale < leafhdr->count; ++*highstale) { in xfs_dir3_leaf_find_stale()
510 struct xfs_dir3_icleaf_hdr *leafhdr, in xfs_dir3_leaf_find_entry() argument
519 if (!leafhdr->stale) { in xfs_dir3_leaf_find_entry()
528 if (index < leafhdr->count) in xfs_dir3_leaf_find_entry()
530 (leafhdr->count - index) * sizeof(*lep)); in xfs_dir3_leaf_find_entry()
536 *lfloghigh = leafhdr->count++; in xfs_dir3_leaf_find_entry()
550 xfs_dir3_leaf_find_stale(leafhdr, ents, index, in xfs_dir3_leaf_find_entry()
557 (highstale == leafhdr->count || in xfs_dir3_leaf_find_entry()
574 leafhdr->stale--; in xfs_dir3_leaf_find_entry()
594 leafhdr->stale--; in xfs_dir3_leaf_find_entry()
633 struct xfs_dir3_icleaf_hdr leafhdr; in xfs_dir2_leaf_addname() local
654 dp->d_ops->leaf_hdr_from_disk(&leafhdr, leaf); in xfs_dir2_leaf_addname()
665 index < leafhdr.count && be32_to_cpu(lep->hashval) == args->hashval; in xfs_dir2_leaf_addname()
698 if (!leafhdr.stale) in xfs_dir2_leaf_addname()
713 if ((char *)bestsp - (char *)&ents[leafhdr.count] < needbytes && in xfs_dir2_leaf_addname()
714 leafhdr.stale > 1) in xfs_dir2_leaf_addname()
721 else if ((char *)bestsp - (char *)&ents[leafhdr.count] < needbytes) { in xfs_dir2_leaf_addname()
769 xfs_dir3_leaf_compact_x1(&leafhdr, ents, &index, &lowstale, in xfs_dir2_leaf_addname()
776 else if (leafhdr.stale) { in xfs_dir2_leaf_addname()
777 lfloglow = leafhdr.count; in xfs_dir2_leaf_addname()
882 lep = xfs_dir3_leaf_find_entry(&leafhdr, ents, index, compact, lowstale, in xfs_dir2_leaf_addname()
895 dp->d_ops->leaf_hdr_to_disk(leaf, &leafhdr); in xfs_dir2_leaf_addname()
910 struct xfs_dir3_icleaf_hdr *leafhdr, in xfs_dir3_leaf_compact() argument
921 if (!leafhdr->stale) in xfs_dir3_leaf_compact()
928 for (from = to = 0, loglow = -1; from < leafhdr->count; from++) { in xfs_dir3_leaf_compact()
944 ASSERT(leafhdr->stale == from - to); in xfs_dir3_leaf_compact()
945 leafhdr->count -= leafhdr->stale; in xfs_dir3_leaf_compact()
946 leafhdr->stale = 0; in xfs_dir3_leaf_compact()
948 dp->d_ops->leaf_hdr_to_disk(leaf, leafhdr); in xfs_dir3_leaf_compact()
964 struct xfs_dir3_icleaf_hdr *leafhdr, in xfs_dir3_leaf_compact_x1() argument
980 ASSERT(leafhdr->stale > 1); in xfs_dir3_leaf_compact_x1()
983 xfs_dir3_leaf_find_stale(leafhdr, ents, index, &lowstale, &highstale); in xfs_dir3_leaf_compact_x1()
989 (highstale == leafhdr->count || in xfs_dir3_leaf_compact_x1()
998 for (from = to = 0; from < leafhdr->count; from++) { in xfs_dir3_leaf_compact_x1()
1033 leafhdr->count -= from - to; in xfs_dir3_leaf_compact_x1()
1034 leafhdr->stale = 1; in xfs_dir3_leaf_compact_x1()
1042 highstale = leafhdr->count; in xfs_dir3_leaf_compact_x1()
1043 *highlogp = leafhdr->count - 1; in xfs_dir3_leaf_compact_x1()
1226 struct xfs_dir3_icleaf_hdr leafhdr; in xfs_dir2_leaf_lookup_int() local
1240 dp->d_ops->leaf_hdr_from_disk(&leafhdr, leaf); in xfs_dir2_leaf_lookup_int()
1251 index < leafhdr.count && be32_to_cpu(lep->hashval) == args->hashval; in xfs_dir2_leaf_lookup_int()
1358 struct xfs_dir3_icleaf_hdr leafhdr; in xfs_dir2_leaf_removename() local
1373 dp->d_ops->leaf_hdr_from_disk(&leafhdr, leaf); in xfs_dir2_leaf_removename()
1396 leafhdr.stale++; in xfs_dir2_leaf_removename()
1397 dp->d_ops->leaf_hdr_to_disk(leaf, &leafhdr); in xfs_dir2_leaf_removename()
1547 struct xfs_dir3_icleaf_hdr leafhdr; in xfs_dir2_leaf_search_hash() local
1551 args->dp->d_ops->leaf_hdr_from_disk(&leafhdr, leaf); in xfs_dir2_leaf_search_hash()
1557 for (lep = ents, low = 0, high = leafhdr.count - 1, in xfs_dir2_leaf_search_hash()
1688 struct xfs_dir3_icleaf_hdr leafhdr; in xfs_dir2_node_to_leaf() local
1739 dp->d_ops->leaf_hdr_from_disk(&leafhdr, leaf); in xfs_dir2_node_to_leaf()
1741 ASSERT(leafhdr.magic == XFS_DIR2_LEAFN_MAGIC || in xfs_dir2_node_to_leaf()
1742 leafhdr.magic == XFS_DIR3_LEAFN_MAGIC); in xfs_dir2_node_to_leaf()
1759 if (xfs_dir3_leaf_size(&leafhdr, freehdr.nvalid) > args->geo->blksize) { in xfs_dir2_node_to_leaf()
1767 if (leafhdr.stale) in xfs_dir2_node_to_leaf()
1768 xfs_dir3_leaf_compact(args, &leafhdr, lbp); in xfs_dir2_node_to_leaf()
1772 leafhdr.magic = (leafhdr.magic == XFS_DIR2_LEAFN_MAGIC) in xfs_dir2_node_to_leaf()
1788 dp->d_ops->leaf_hdr_to_disk(leaf, &leafhdr); in xfs_dir2_node_to_leaf()