Lines Matching refs:leafhdr
28 struct xfs_dir3_icleaf_hdr *leafhdr);
105 struct xfs_dir3_icleaf_hdr leafhdr; in xfs_dir3_leaf1_check() local
107 xfs_dir2_leaf_hdr_from_disk(dp->i_mount, &leafhdr, leaf); in xfs_dir3_leaf1_check()
109 if (leafhdr.magic == XFS_DIR3_LEAF1_MAGIC) { in xfs_dir3_leaf1_check()
113 } else if (leafhdr.magic != XFS_DIR2_LEAF1_MAGIC) in xfs_dir3_leaf1_check()
116 return xfs_dir3_leaf_check_int(dp->i_mount, &leafhdr, leaf); in xfs_dir3_leaf1_check()
190 struct xfs_dir3_icleaf_hdr leafhdr; in xfs_dir3_leaf_verify() local
197 xfs_dir2_leaf_hdr_from_disk(mp, &leafhdr, bp->b_addr); in xfs_dir3_leaf_verify()
198 return xfs_dir3_leaf_check_int(mp, &leafhdr, bp->b_addr); in xfs_dir3_leaf_verify()
393 struct xfs_dir3_icleaf_hdr leafhdr; in xfs_dir2_block_to_leaf() local
426 xfs_dir2_leaf_hdr_from_disk(dp->i_mount, &leafhdr, leaf); in xfs_dir2_block_to_leaf()
427 leafhdr.count = be32_to_cpu(btp->count); in xfs_dir2_block_to_leaf()
428 leafhdr.stale = be32_to_cpu(btp->stale); in xfs_dir2_block_to_leaf()
429 xfs_dir2_leaf_hdr_to_disk(dp->i_mount, leaf, &leafhdr); in xfs_dir2_block_to_leaf()
436 memcpy(leafhdr.ents, blp, in xfs_dir2_block_to_leaf()
438 xfs_dir3_leaf_log_ents(args, &leafhdr, lbp, 0, leafhdr.count - 1); in xfs_dir2_block_to_leaf()
482 struct xfs_dir3_icleaf_hdr *leafhdr, in xfs_dir3_leaf_find_stale() argument
502 for (*highstale = index; *highstale < leafhdr->count; ++*highstale) { in xfs_dir3_leaf_find_stale()
513 struct xfs_dir3_icleaf_hdr *leafhdr, in xfs_dir3_leaf_find_entry() argument
522 if (!leafhdr->stale) { in xfs_dir3_leaf_find_entry()
531 if (index < leafhdr->count) in xfs_dir3_leaf_find_entry()
533 (leafhdr->count - index) * sizeof(*lep)); in xfs_dir3_leaf_find_entry()
539 *lfloghigh = leafhdr->count++; in xfs_dir3_leaf_find_entry()
553 xfs_dir3_leaf_find_stale(leafhdr, ents, index, in xfs_dir3_leaf_find_entry()
560 (highstale == leafhdr->count || in xfs_dir3_leaf_find_entry()
577 leafhdr->stale--; in xfs_dir3_leaf_find_entry()
597 leafhdr->stale--; in xfs_dir3_leaf_find_entry()
608 struct xfs_dir3_icleaf_hdr leafhdr; in xfs_dir2_leaf_addname() local
653 xfs_dir2_leaf_hdr_from_disk(dp->i_mount, &leafhdr, leaf); in xfs_dir2_leaf_addname()
654 ents = leafhdr.ents; 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()
885 lep = xfs_dir3_leaf_find_entry(&leafhdr, ents, index, compact, lowstale, in xfs_dir2_leaf_addname()
898 xfs_dir2_leaf_hdr_to_disk(dp->i_mount, leaf, &leafhdr); in xfs_dir2_leaf_addname()
900 xfs_dir3_leaf_log_ents(args, &leafhdr, lbp, lfloglow, lfloghigh); in xfs_dir2_leaf_addname()
913 struct xfs_dir3_icleaf_hdr *leafhdr, in xfs_dir3_leaf_compact() argument
923 if (!leafhdr->stale) in xfs_dir3_leaf_compact()
929 for (from = to = 0, loglow = -1; from < leafhdr->count; from++) { in xfs_dir3_leaf_compact()
930 if (leafhdr->ents[from].address == in xfs_dir3_leaf_compact()
939 leafhdr->ents[to] = leafhdr->ents[from]; in xfs_dir3_leaf_compact()
946 ASSERT(leafhdr->stale == from - to); in xfs_dir3_leaf_compact()
947 leafhdr->count -= leafhdr->stale; in xfs_dir3_leaf_compact()
948 leafhdr->stale = 0; in xfs_dir3_leaf_compact()
950 xfs_dir2_leaf_hdr_to_disk(dp->i_mount, leaf, leafhdr); in xfs_dir3_leaf_compact()
953 xfs_dir3_leaf_log_ents(args, leafhdr, bp, loglow, to - 1); in xfs_dir3_leaf_compact()
966 struct xfs_dir3_icleaf_hdr *leafhdr, in xfs_dir3_leaf_compact_x1() argument
982 ASSERT(leafhdr->stale > 1); in xfs_dir3_leaf_compact_x1()
985 xfs_dir3_leaf_find_stale(leafhdr, ents, index, &lowstale, &highstale); in xfs_dir3_leaf_compact_x1()
991 (highstale == leafhdr->count || in xfs_dir3_leaf_compact_x1()
1000 for (from = to = 0; from < leafhdr->count; from++) { in xfs_dir3_leaf_compact_x1()
1035 leafhdr->count -= from - to; in xfs_dir3_leaf_compact_x1()
1036 leafhdr->stale = 1; in xfs_dir3_leaf_compact_x1()
1044 highstale = leafhdr->count; in xfs_dir3_leaf_compact_x1()
1045 *highlogp = leafhdr->count - 1; in xfs_dir3_leaf_compact_x1()
1161 struct xfs_dir3_icleaf_hdr leafhdr; in xfs_dir2_leaf_lookup() local
1168 error = xfs_dir2_leaf_lookup_int(args, &lbp, &index, &dbp, &leafhdr); in xfs_dir2_leaf_lookup()
1179 lep = &leafhdr.ents[index]; in xfs_dir2_leaf_lookup()
1210 struct xfs_dir3_icleaf_hdr *leafhdr) in xfs_dir2_leaf_lookup_int() argument
1238 xfs_dir2_leaf_hdr_from_disk(mp, leafhdr, leaf); in xfs_dir2_leaf_lookup_int()
1248 for (lep = &leafhdr->ents[index]; in xfs_dir2_leaf_lookup_int()
1249 index < leafhdr->count && in xfs_dir2_leaf_lookup_int()
1357 struct xfs_dir3_icleaf_hdr leafhdr; in xfs_dir2_leaf_removename() local
1364 error = xfs_dir2_leaf_lookup_int(args, &lbp, &index, &dbp, &leafhdr); in xfs_dir2_leaf_removename()
1377 lep = &leafhdr.ents[index]; in xfs_dir2_leaf_removename()
1399 leafhdr.stale++; in xfs_dir2_leaf_removename()
1400 xfs_dir2_leaf_hdr_to_disk(dp->i_mount, leaf, &leafhdr); in xfs_dir2_leaf_removename()
1404 xfs_dir3_leaf_log_ents(args, &leafhdr, lbp, index, index); in xfs_dir2_leaf_removename()
1495 struct xfs_dir3_icleaf_hdr leafhdr; in xfs_dir2_leaf_replace() local
1502 error = xfs_dir2_leaf_lookup_int(args, &lbp, &index, &dbp, &leafhdr); in xfs_dir2_leaf_replace()
1510 lep = &leafhdr.ents[index]; in xfs_dir2_leaf_replace()
1546 struct xfs_dir3_icleaf_hdr leafhdr; in xfs_dir2_leaf_search_hash() local
1548 xfs_dir2_leaf_hdr_from_disk(args->dp->i_mount, &leafhdr, lbp->b_addr); in xfs_dir2_leaf_search_hash()
1554 for (lep = leafhdr.ents, low = 0, high = leafhdr.count - 1, in xfs_dir2_leaf_search_hash()
1685 struct xfs_dir3_icleaf_hdr leafhdr; in xfs_dir2_node_to_leaf() local
1736 xfs_dir2_leaf_hdr_from_disk(mp, &leafhdr, leaf); in xfs_dir2_node_to_leaf()
1738 ASSERT(leafhdr.magic == XFS_DIR2_LEAFN_MAGIC || in xfs_dir2_node_to_leaf()
1739 leafhdr.magic == XFS_DIR3_LEAFN_MAGIC); in xfs_dir2_node_to_leaf()
1755 if (xfs_dir3_leaf_size(&leafhdr, freehdr.nvalid) > args->geo->blksize) { in xfs_dir2_node_to_leaf()
1763 if (leafhdr.stale) in xfs_dir2_node_to_leaf()
1764 xfs_dir3_leaf_compact(args, &leafhdr, lbp); in xfs_dir2_node_to_leaf()
1768 leafhdr.magic = (leafhdr.magic == XFS_DIR2_LEAFN_MAGIC) in xfs_dir2_node_to_leaf()
1784 xfs_dir2_leaf_hdr_to_disk(mp, leaf, &leafhdr); in xfs_dir2_node_to_leaf()