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, false); in xfs_dir3_leaf1_check()
194 struct xfs_dir3_icleaf_hdr leafhdr; in xfs_dir3_leaf_verify() local
201 xfs_dir2_leaf_hdr_from_disk(mp, &leafhdr, bp->b_addr); in xfs_dir3_leaf_verify()
202 return xfs_dir3_leaf_check_int(mp, &leafhdr, bp->b_addr, true); in xfs_dir3_leaf_verify()
397 struct xfs_dir3_icleaf_hdr leafhdr; in xfs_dir2_block_to_leaf() local
430 xfs_dir2_leaf_hdr_from_disk(dp->i_mount, &leafhdr, leaf); in xfs_dir2_block_to_leaf()
431 leafhdr.count = be32_to_cpu(btp->count); in xfs_dir2_block_to_leaf()
432 leafhdr.stale = be32_to_cpu(btp->stale); in xfs_dir2_block_to_leaf()
433 xfs_dir2_leaf_hdr_to_disk(dp->i_mount, leaf, &leafhdr); in xfs_dir2_block_to_leaf()
440 memcpy(leafhdr.ents, blp, in xfs_dir2_block_to_leaf()
442 xfs_dir3_leaf_log_ents(args, &leafhdr, lbp, 0, leafhdr.count - 1); in xfs_dir2_block_to_leaf()
486 struct xfs_dir3_icleaf_hdr *leafhdr, in xfs_dir3_leaf_find_stale() argument
506 for (*highstale = index; *highstale < leafhdr->count; ++*highstale) { in xfs_dir3_leaf_find_stale()
517 struct xfs_dir3_icleaf_hdr *leafhdr, in xfs_dir3_leaf_find_entry() argument
526 if (!leafhdr->stale) { in xfs_dir3_leaf_find_entry()
535 if (index < leafhdr->count) in xfs_dir3_leaf_find_entry()
537 (leafhdr->count - index) * sizeof(*lep)); in xfs_dir3_leaf_find_entry()
543 *lfloghigh = leafhdr->count++; in xfs_dir3_leaf_find_entry()
557 xfs_dir3_leaf_find_stale(leafhdr, ents, index, in xfs_dir3_leaf_find_entry()
564 (highstale == leafhdr->count || in xfs_dir3_leaf_find_entry()
581 leafhdr->stale--; in xfs_dir3_leaf_find_entry()
601 leafhdr->stale--; in xfs_dir3_leaf_find_entry()
612 struct xfs_dir3_icleaf_hdr leafhdr; in xfs_dir2_leaf_addname() local
657 xfs_dir2_leaf_hdr_from_disk(dp->i_mount, &leafhdr, leaf); in xfs_dir2_leaf_addname()
658 ents = leafhdr.ents; in xfs_dir2_leaf_addname()
669 index < leafhdr.count && be32_to_cpu(lep->hashval) == args->hashval; in xfs_dir2_leaf_addname()
702 if (!leafhdr.stale) in xfs_dir2_leaf_addname()
717 if ((char *)bestsp - (char *)&ents[leafhdr.count] < needbytes && in xfs_dir2_leaf_addname()
718 leafhdr.stale > 1) in xfs_dir2_leaf_addname()
725 else if ((char *)bestsp - (char *)&ents[leafhdr.count] < needbytes) { in xfs_dir2_leaf_addname()
773 xfs_dir3_leaf_compact_x1(&leafhdr, ents, &index, &lowstale, in xfs_dir2_leaf_addname()
780 else if (leafhdr.stale) { in xfs_dir2_leaf_addname()
781 lfloglow = leafhdr.count; in xfs_dir2_leaf_addname()
889 lep = xfs_dir3_leaf_find_entry(&leafhdr, ents, index, compact, lowstale, in xfs_dir2_leaf_addname()
902 xfs_dir2_leaf_hdr_to_disk(dp->i_mount, leaf, &leafhdr); in xfs_dir2_leaf_addname()
904 xfs_dir3_leaf_log_ents(args, &leafhdr, lbp, lfloglow, lfloghigh); in xfs_dir2_leaf_addname()
917 struct xfs_dir3_icleaf_hdr *leafhdr, in xfs_dir3_leaf_compact() argument
927 if (!leafhdr->stale) in xfs_dir3_leaf_compact()
933 for (from = to = 0, loglow = -1; from < leafhdr->count; from++) { in xfs_dir3_leaf_compact()
934 if (leafhdr->ents[from].address == in xfs_dir3_leaf_compact()
943 leafhdr->ents[to] = leafhdr->ents[from]; in xfs_dir3_leaf_compact()
950 ASSERT(leafhdr->stale == from - to); in xfs_dir3_leaf_compact()
951 leafhdr->count -= leafhdr->stale; in xfs_dir3_leaf_compact()
952 leafhdr->stale = 0; in xfs_dir3_leaf_compact()
954 xfs_dir2_leaf_hdr_to_disk(dp->i_mount, leaf, leafhdr); in xfs_dir3_leaf_compact()
957 xfs_dir3_leaf_log_ents(args, leafhdr, bp, loglow, to - 1); in xfs_dir3_leaf_compact()
970 struct xfs_dir3_icleaf_hdr *leafhdr, in xfs_dir3_leaf_compact_x1() argument
986 ASSERT(leafhdr->stale > 1); in xfs_dir3_leaf_compact_x1()
989 xfs_dir3_leaf_find_stale(leafhdr, ents, index, &lowstale, &highstale); in xfs_dir3_leaf_compact_x1()
995 (highstale == leafhdr->count || in xfs_dir3_leaf_compact_x1()
1004 for (from = to = 0; from < leafhdr->count; from++) { in xfs_dir3_leaf_compact_x1()
1039 leafhdr->count -= from - to; in xfs_dir3_leaf_compact_x1()
1040 leafhdr->stale = 1; in xfs_dir3_leaf_compact_x1()
1048 highstale = leafhdr->count; in xfs_dir3_leaf_compact_x1()
1049 *highlogp = leafhdr->count - 1; in xfs_dir3_leaf_compact_x1()
1165 struct xfs_dir3_icleaf_hdr leafhdr; in xfs_dir2_leaf_lookup() local
1172 error = xfs_dir2_leaf_lookup_int(args, &lbp, &index, &dbp, &leafhdr); in xfs_dir2_leaf_lookup()
1183 lep = &leafhdr.ents[index]; in xfs_dir2_leaf_lookup()
1214 struct xfs_dir3_icleaf_hdr *leafhdr) in xfs_dir2_leaf_lookup_int() argument
1242 xfs_dir2_leaf_hdr_from_disk(mp, leafhdr, leaf); in xfs_dir2_leaf_lookup_int()
1252 for (lep = &leafhdr->ents[index]; in xfs_dir2_leaf_lookup_int()
1253 index < leafhdr->count && in xfs_dir2_leaf_lookup_int()
1361 struct xfs_dir3_icleaf_hdr leafhdr; in xfs_dir2_leaf_removename() local
1368 error = xfs_dir2_leaf_lookup_int(args, &lbp, &index, &dbp, &leafhdr); in xfs_dir2_leaf_removename()
1381 lep = &leafhdr.ents[index]; in xfs_dir2_leaf_removename()
1403 leafhdr.stale++; in xfs_dir2_leaf_removename()
1404 xfs_dir2_leaf_hdr_to_disk(dp->i_mount, leaf, &leafhdr); in xfs_dir2_leaf_removename()
1408 xfs_dir3_leaf_log_ents(args, &leafhdr, lbp, index, index); in xfs_dir2_leaf_removename()
1499 struct xfs_dir3_icleaf_hdr leafhdr; in xfs_dir2_leaf_replace() local
1506 error = xfs_dir2_leaf_lookup_int(args, &lbp, &index, &dbp, &leafhdr); in xfs_dir2_leaf_replace()
1514 lep = &leafhdr.ents[index]; in xfs_dir2_leaf_replace()
1550 struct xfs_dir3_icleaf_hdr leafhdr; in xfs_dir2_leaf_search_hash() local
1552 xfs_dir2_leaf_hdr_from_disk(args->dp->i_mount, &leafhdr, lbp->b_addr); in xfs_dir2_leaf_search_hash()
1558 for (lep = leafhdr.ents, low = 0, high = leafhdr.count - 1, in xfs_dir2_leaf_search_hash()
1689 struct xfs_dir3_icleaf_hdr leafhdr; in xfs_dir2_node_to_leaf() local
1740 xfs_dir2_leaf_hdr_from_disk(mp, &leafhdr, leaf); in xfs_dir2_node_to_leaf()
1742 ASSERT(leafhdr.magic == XFS_DIR2_LEAFN_MAGIC || in xfs_dir2_node_to_leaf()
1743 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 xfs_dir2_leaf_hdr_to_disk(mp, leaf, &leafhdr); in xfs_dir2_node_to_leaf()