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()
199 struct xfs_dir3_icleaf_hdr leafhdr; in xfs_dir3_leaf_verify() local
206 xfs_dir2_leaf_hdr_from_disk(mp, &leafhdr, bp->b_addr); in xfs_dir3_leaf_verify()
207 return xfs_dir3_leaf_check_int(mp, &leafhdr, bp->b_addr, true); in xfs_dir3_leaf_verify()
402 struct xfs_dir3_icleaf_hdr leafhdr; in xfs_dir2_block_to_leaf() local
435 xfs_dir2_leaf_hdr_from_disk(dp->i_mount, &leafhdr, leaf); in xfs_dir2_block_to_leaf()
436 leafhdr.count = be32_to_cpu(btp->count); in xfs_dir2_block_to_leaf()
437 leafhdr.stale = be32_to_cpu(btp->stale); in xfs_dir2_block_to_leaf()
438 xfs_dir2_leaf_hdr_to_disk(dp->i_mount, leaf, &leafhdr); in xfs_dir2_block_to_leaf()
445 memcpy(leafhdr.ents, blp, in xfs_dir2_block_to_leaf()
447 xfs_dir3_leaf_log_ents(args, &leafhdr, lbp, 0, leafhdr.count - 1); in xfs_dir2_block_to_leaf()
491 struct xfs_dir3_icleaf_hdr *leafhdr, in xfs_dir3_leaf_find_stale() argument
511 for (*highstale = index; *highstale < leafhdr->count; ++*highstale) { in xfs_dir3_leaf_find_stale()
522 struct xfs_dir3_icleaf_hdr *leafhdr, in xfs_dir3_leaf_find_entry() argument
531 if (!leafhdr->stale) { in xfs_dir3_leaf_find_entry()
540 if (index < leafhdr->count) in xfs_dir3_leaf_find_entry()
542 (leafhdr->count - index) * sizeof(*lep)); in xfs_dir3_leaf_find_entry()
548 *lfloghigh = leafhdr->count++; in xfs_dir3_leaf_find_entry()
562 xfs_dir3_leaf_find_stale(leafhdr, ents, index, in xfs_dir3_leaf_find_entry()
569 (highstale == leafhdr->count || in xfs_dir3_leaf_find_entry()
586 leafhdr->stale--; in xfs_dir3_leaf_find_entry()
606 leafhdr->stale--; in xfs_dir3_leaf_find_entry()
617 struct xfs_dir3_icleaf_hdr leafhdr; in xfs_dir2_leaf_addname() local
662 xfs_dir2_leaf_hdr_from_disk(dp->i_mount, &leafhdr, leaf); in xfs_dir2_leaf_addname()
663 ents = leafhdr.ents; in xfs_dir2_leaf_addname()
674 index < leafhdr.count && be32_to_cpu(lep->hashval) == args->hashval; in xfs_dir2_leaf_addname()
707 if (!leafhdr.stale) in xfs_dir2_leaf_addname()
722 if ((char *)bestsp - (char *)&ents[leafhdr.count] < needbytes && in xfs_dir2_leaf_addname()
723 leafhdr.stale > 1) in xfs_dir2_leaf_addname()
730 else if ((char *)bestsp - (char *)&ents[leafhdr.count] < needbytes) { in xfs_dir2_leaf_addname()
778 xfs_dir3_leaf_compact_x1(&leafhdr, ents, &index, &lowstale, in xfs_dir2_leaf_addname()
785 else if (leafhdr.stale) { in xfs_dir2_leaf_addname()
786 lfloglow = leafhdr.count; in xfs_dir2_leaf_addname()
894 lep = xfs_dir3_leaf_find_entry(&leafhdr, ents, index, compact, lowstale, in xfs_dir2_leaf_addname()
907 xfs_dir2_leaf_hdr_to_disk(dp->i_mount, leaf, &leafhdr); in xfs_dir2_leaf_addname()
909 xfs_dir3_leaf_log_ents(args, &leafhdr, lbp, lfloglow, lfloghigh); in xfs_dir2_leaf_addname()
922 struct xfs_dir3_icleaf_hdr *leafhdr, in xfs_dir3_leaf_compact() argument
932 if (!leafhdr->stale) in xfs_dir3_leaf_compact()
938 for (from = to = 0, loglow = -1; from < leafhdr->count; from++) { in xfs_dir3_leaf_compact()
939 if (leafhdr->ents[from].address == in xfs_dir3_leaf_compact()
948 leafhdr->ents[to] = leafhdr->ents[from]; in xfs_dir3_leaf_compact()
955 ASSERT(leafhdr->stale == from - to); in xfs_dir3_leaf_compact()
956 leafhdr->count -= leafhdr->stale; in xfs_dir3_leaf_compact()
957 leafhdr->stale = 0; in xfs_dir3_leaf_compact()
959 xfs_dir2_leaf_hdr_to_disk(dp->i_mount, leaf, leafhdr); in xfs_dir3_leaf_compact()
962 xfs_dir3_leaf_log_ents(args, leafhdr, bp, loglow, to - 1); in xfs_dir3_leaf_compact()
975 struct xfs_dir3_icleaf_hdr *leafhdr, in xfs_dir3_leaf_compact_x1() argument
991 ASSERT(leafhdr->stale > 1); in xfs_dir3_leaf_compact_x1()
994 xfs_dir3_leaf_find_stale(leafhdr, ents, index, &lowstale, &highstale); in xfs_dir3_leaf_compact_x1()
1000 (highstale == leafhdr->count || in xfs_dir3_leaf_compact_x1()
1009 for (from = to = 0; from < leafhdr->count; from++) { in xfs_dir3_leaf_compact_x1()
1044 leafhdr->count -= from - to; in xfs_dir3_leaf_compact_x1()
1045 leafhdr->stale = 1; in xfs_dir3_leaf_compact_x1()
1053 highstale = leafhdr->count; in xfs_dir3_leaf_compact_x1()
1054 *highlogp = leafhdr->count - 1; in xfs_dir3_leaf_compact_x1()
1170 struct xfs_dir3_icleaf_hdr leafhdr; in xfs_dir2_leaf_lookup() local
1177 error = xfs_dir2_leaf_lookup_int(args, &lbp, &index, &dbp, &leafhdr); in xfs_dir2_leaf_lookup()
1188 lep = &leafhdr.ents[index]; in xfs_dir2_leaf_lookup()
1219 struct xfs_dir3_icleaf_hdr *leafhdr) in xfs_dir2_leaf_lookup_int() argument
1247 xfs_dir2_leaf_hdr_from_disk(mp, leafhdr, leaf); in xfs_dir2_leaf_lookup_int()
1257 for (lep = &leafhdr->ents[index]; in xfs_dir2_leaf_lookup_int()
1258 index < leafhdr->count && in xfs_dir2_leaf_lookup_int()
1366 struct xfs_dir3_icleaf_hdr leafhdr; in xfs_dir2_leaf_removename() local
1373 error = xfs_dir2_leaf_lookup_int(args, &lbp, &index, &dbp, &leafhdr); in xfs_dir2_leaf_removename()
1386 lep = &leafhdr.ents[index]; in xfs_dir2_leaf_removename()
1408 leafhdr.stale++; in xfs_dir2_leaf_removename()
1409 xfs_dir2_leaf_hdr_to_disk(dp->i_mount, leaf, &leafhdr); in xfs_dir2_leaf_removename()
1413 xfs_dir3_leaf_log_ents(args, &leafhdr, lbp, index, index); in xfs_dir2_leaf_removename()
1504 struct xfs_dir3_icleaf_hdr leafhdr; in xfs_dir2_leaf_replace() local
1511 error = xfs_dir2_leaf_lookup_int(args, &lbp, &index, &dbp, &leafhdr); in xfs_dir2_leaf_replace()
1519 lep = &leafhdr.ents[index]; in xfs_dir2_leaf_replace()
1555 struct xfs_dir3_icleaf_hdr leafhdr; in xfs_dir2_leaf_search_hash() local
1557 xfs_dir2_leaf_hdr_from_disk(args->dp->i_mount, &leafhdr, lbp->b_addr); in xfs_dir2_leaf_search_hash()
1563 for (lep = leafhdr.ents, low = 0, high = leafhdr.count - 1, in xfs_dir2_leaf_search_hash()
1694 struct xfs_dir3_icleaf_hdr leafhdr; in xfs_dir2_node_to_leaf() local
1745 xfs_dir2_leaf_hdr_from_disk(mp, &leafhdr, leaf); in xfs_dir2_node_to_leaf()
1747 ASSERT(leafhdr.magic == XFS_DIR2_LEAFN_MAGIC || in xfs_dir2_node_to_leaf()
1748 leafhdr.magic == XFS_DIR3_LEAFN_MAGIC); in xfs_dir2_node_to_leaf()
1764 if (xfs_dir3_leaf_size(&leafhdr, freehdr.nvalid) > args->geo->blksize) { in xfs_dir2_node_to_leaf()
1772 if (leafhdr.stale) in xfs_dir2_node_to_leaf()
1773 xfs_dir3_leaf_compact(args, &leafhdr, lbp); in xfs_dir2_node_to_leaf()
1777 leafhdr.magic = (leafhdr.magic == XFS_DIR2_LEAFN_MAGIC) in xfs_dir2_node_to_leaf()
1793 xfs_dir2_leaf_hdr_to_disk(mp, leaf, &leafhdr); in xfs_dir2_node_to_leaf()