Lines Matching full:leaf
104 struct xfs_dir2_leaf *leaf = bp->b_addr; in xfs_dir3_leaf1_check() local
107 xfs_dir2_leaf_hdr_from_disk(dp->i_mount, &leafhdr, leaf); in xfs_dir3_leaf1_check()
116 return xfs_dir3_leaf_check_int(dp->i_mount, &leafhdr, leaf); in xfs_dir3_leaf1_check()
142 struct xfs_dir2_leaf *leaf) in xfs_dir3_leaf_check_int() argument
149 ltp = xfs_dir2_leaf_tail_p(geo, leaf); in xfs_dir3_leaf_check_int()
159 /* Leaves and bests don't overlap in leaf format. */ in xfs_dir3_leaf_check_int()
181 * We verify the magic numbers before decoding the leaf header so that on debug
293 * Initialize a new leaf block, leaf1 or leafn magic accepted.
303 struct xfs_dir2_leaf *leaf = bp->b_addr; in xfs_dir3_leaf_init() local
319 memset(leaf, 0, sizeof(*leaf)); in xfs_dir3_leaf_init()
320 leaf->hdr.info.magic = cpu_to_be16(type); in xfs_dir3_leaf_init()
324 * If it's a leaf-format directory initialize the tail. in xfs_dir3_leaf_init()
330 ltp = xfs_dir2_leaf_tail_p(mp->m_dir_geo, leaf); in xfs_dir3_leaf_init()
371 * Convert a block form directory to a leaf form directory.
378 __be16 *bestsp; /* leaf's bestsp entries */ in xfs_dir2_block_to_leaf()
379 xfs_dablk_t blkno; /* leaf block's bno */ in xfs_dir2_block_to_leaf()
381 xfs_dir2_leaf_entry_t *blp; /* block's leaf entries */ in xfs_dir2_block_to_leaf()
385 struct xfs_buf *lbp; /* leaf block's buffer */ in xfs_dir2_block_to_leaf()
386 xfs_dir2_db_t ldb; /* leaf block's bno */ in xfs_dir2_block_to_leaf()
387 xfs_dir2_leaf_t *leaf; /* leaf structure */ in xfs_dir2_block_to_leaf() local
388 xfs_dir2_leaf_tail_t *ltp; /* leaf's tail */ in xfs_dir2_block_to_leaf()
400 * Add the leaf block to the inode. in xfs_dir2_block_to_leaf()
401 * This interface will only put blocks in the leaf/node range. in xfs_dir2_block_to_leaf()
410 * Initialize the leaf block, get a buffer for it. in xfs_dir2_block_to_leaf()
416 leaf = lbp->b_addr; in xfs_dir2_block_to_leaf()
424 * Set the counts in the leaf header. in xfs_dir2_block_to_leaf()
426 xfs_dir2_leaf_hdr_from_disk(dp->i_mount, &leafhdr, leaf); in xfs_dir2_block_to_leaf()
429 xfs_dir2_leaf_hdr_to_disk(dp->i_mount, leaf, &leafhdr); in xfs_dir2_block_to_leaf()
442 * Make the space formerly occupied by the leaf entries and block in xfs_dir2_block_to_leaf()
463 * Set up leaf tail and bests table. in xfs_dir2_block_to_leaf()
465 ltp = xfs_dir2_leaf_tail_p(args->geo, leaf); in xfs_dir2_block_to_leaf()
470 * Log the data header and leaf bests table. in xfs_dir2_block_to_leaf()
515 int index, /* leaf table position */ in xfs_dir3_leaf_find_entry()
517 int lowstale, /* index of prev stale leaf */ in xfs_dir3_leaf_find_entry()
518 int highstale, /* index of next stale leaf */ in xfs_dir3_leaf_find_entry()
519 int *lfloglow, /* low leaf logging index */ in xfs_dir3_leaf_find_entry()
520 int *lfloghigh) /* high leaf logging index */ in xfs_dir3_leaf_find_entry()
523 xfs_dir2_leaf_entry_t *lep; /* leaf entry table pointer */ in xfs_dir3_leaf_find_entry()
526 * Now we need to make room to insert the leaf entry. in xfs_dir3_leaf_find_entry()
536 * Record low and high logging indices for the leaf. in xfs_dir3_leaf_find_entry()
602 * Add an entry to a leaf form directory.
610 __be16 *bestsp; /* freespace table in leaf */ in xfs_dir2_leaf_addname()
613 struct xfs_buf *lbp; /* leaf's buffer */ in xfs_dir2_leaf_addname()
614 struct xfs_dir2_leaf *leaf; /* leaf structure */ in xfs_dir2_leaf_addname() local
618 struct xfs_dir2_leaf_entry *lep; /* leaf entry table pointer */ in xfs_dir2_leaf_addname()
621 struct xfs_dir2_leaf_tail *ltp; /* leaf tail pointer */ in xfs_dir2_leaf_addname()
626 int highstale = 0; /* index of next stale leaf */ in xfs_dir2_leaf_addname()
628 int index; /* leaf table position */ in xfs_dir2_leaf_addname()
630 int lfloglow; /* low leaf logging index */ in xfs_dir2_leaf_addname()
631 int lfloghigh; /* high leaf logging index */ in xfs_dir2_leaf_addname()
632 int lowstale = 0; /* index of prev stale leaf */ in xfs_dir2_leaf_addname()
633 int needbytes; /* leaf block bytes needed */ in xfs_dir2_leaf_addname()
651 leaf = lbp->b_addr; in xfs_dir2_leaf_addname()
652 ltp = xfs_dir2_leaf_tail_p(args->geo, leaf); in xfs_dir2_leaf_addname()
653 xfs_dir2_leaf_hdr_from_disk(dp->i_mount, &leafhdr, leaf); in xfs_dir2_leaf_addname()
695 * How many bytes do we need in the leaf block? in xfs_dir2_leaf_addname()
763 * Need to compact the leaf entries, removing stale ones. in xfs_dir2_leaf_addname()
889 * Fill in the new leaf entry. in xfs_dir2_leaf_addname()
896 * Log the leaf fields and give up the buffers. in xfs_dir2_leaf_addname()
898 xfs_dir2_leaf_hdr_to_disk(dp->i_mount, leaf, &leafhdr); in xfs_dir2_leaf_addname()
907 * Compact out any stale entries in the leaf.
908 * Log the header and changed leaf entries, if any.
914 struct xfs_buf *bp) /* leaf buffer */ in xfs_dir3_leaf_compact()
916 int from; /* source leaf index */ in xfs_dir3_leaf_compact()
917 xfs_dir2_leaf_t *leaf; /* leaf structure */ in xfs_dir3_leaf_compact() local
918 int loglow; /* first leaf entry to log */ in xfs_dir3_leaf_compact()
919 int to; /* target leaf index */ in xfs_dir3_leaf_compact()
922 leaf = bp->b_addr; in xfs_dir3_leaf_compact()
944 * Update and log the header, log the leaf entries. in xfs_dir3_leaf_compact()
950 xfs_dir2_leaf_hdr_to_disk(dp->i_mount, leaf, leafhdr); in xfs_dir3_leaf_compact()
957 * Compact the leaf entries, removing stale ones.
962 * and leaf logging indices.
1033 * Adjust the leaf header values. in xfs_dir3_leaf_compact_x1()
1056 struct xfs_buf *bp, /* leaf buffer */ in xfs_dir3_leaf_log_bests()
1062 struct xfs_dir2_leaf *leaf = bp->b_addr; in xfs_dir3_leaf_log_bests() local
1063 xfs_dir2_leaf_tail_t *ltp; /* leaf tail structure */ in xfs_dir3_leaf_log_bests()
1065 ASSERT(leaf->hdr.info.magic == cpu_to_be16(XFS_DIR2_LEAF1_MAGIC) || in xfs_dir3_leaf_log_bests()
1066 leaf->hdr.info.magic == cpu_to_be16(XFS_DIR3_LEAF1_MAGIC)); in xfs_dir3_leaf_log_bests()
1068 ltp = xfs_dir2_leaf_tail_p(args->geo, leaf); in xfs_dir3_leaf_log_bests()
1072 (uint)((char *)firstb - (char *)leaf), in xfs_dir3_leaf_log_bests()
1073 (uint)((char *)lastb - (char *)leaf + sizeof(*lastb) - 1)); in xfs_dir3_leaf_log_bests()
1077 * Log the leaf entries indicated from a leaf1 or leafn block.
1089 struct xfs_dir2_leaf *leaf = bp->b_addr; in xfs_dir3_leaf_log_ents() local
1091 ASSERT(leaf->hdr.info.magic == cpu_to_be16(XFS_DIR2_LEAF1_MAGIC) || in xfs_dir3_leaf_log_ents()
1092 leaf->hdr.info.magic == cpu_to_be16(XFS_DIR3_LEAF1_MAGIC) || in xfs_dir3_leaf_log_ents()
1093 leaf->hdr.info.magic == cpu_to_be16(XFS_DIR2_LEAFN_MAGIC) || in xfs_dir3_leaf_log_ents()
1094 leaf->hdr.info.magic == cpu_to_be16(XFS_DIR3_LEAFN_MAGIC)); in xfs_dir3_leaf_log_ents()
1099 (uint)((char *)firstlep - (char *)leaf), in xfs_dir3_leaf_log_ents()
1100 (uint)((char *)lastlep - (char *)leaf + sizeof(*lastlep) - 1)); in xfs_dir3_leaf_log_ents()
1111 struct xfs_dir2_leaf *leaf = bp->b_addr; in xfs_dir3_leaf_log_header() local
1113 ASSERT(leaf->hdr.info.magic == cpu_to_be16(XFS_DIR2_LEAF1_MAGIC) || in xfs_dir3_leaf_log_header()
1114 leaf->hdr.info.magic == cpu_to_be16(XFS_DIR3_LEAF1_MAGIC) || in xfs_dir3_leaf_log_header()
1115 leaf->hdr.info.magic == cpu_to_be16(XFS_DIR2_LEAFN_MAGIC) || in xfs_dir3_leaf_log_header()
1116 leaf->hdr.info.magic == cpu_to_be16(XFS_DIR3_LEAFN_MAGIC)); in xfs_dir3_leaf_log_header()
1119 (uint)((char *)&leaf->hdr - (char *)leaf), in xfs_dir3_leaf_log_header()
1131 struct xfs_dir2_leaf *leaf = bp->b_addr; in xfs_dir3_leaf_log_tail() local
1132 xfs_dir2_leaf_tail_t *ltp; /* leaf tail structure */ in xfs_dir3_leaf_log_tail()
1134 ASSERT(leaf->hdr.info.magic == cpu_to_be16(XFS_DIR2_LEAF1_MAGIC) || in xfs_dir3_leaf_log_tail()
1135 leaf->hdr.info.magic == cpu_to_be16(XFS_DIR3_LEAF1_MAGIC) || in xfs_dir3_leaf_log_tail()
1136 leaf->hdr.info.magic == cpu_to_be16(XFS_DIR2_LEAFN_MAGIC) || in xfs_dir3_leaf_log_tail()
1137 leaf->hdr.info.magic == cpu_to_be16(XFS_DIR3_LEAFN_MAGIC)); in xfs_dir3_leaf_log_tail()
1139 ltp = xfs_dir2_leaf_tail_p(args->geo, leaf); in xfs_dir3_leaf_log_tail()
1140 xfs_trans_log_buf(args->trans, bp, (uint)((char *)ltp - (char *)leaf), in xfs_dir3_leaf_log_tail()
1145 * Look up the entry referred to by args in the leaf format directory.
1158 struct xfs_buf *lbp; /* leaf buffer */ in xfs_dir2_leaf_lookup()
1159 xfs_dir2_leaf_entry_t *lep; /* leaf entry */ in xfs_dir2_leaf_lookup()
1166 * Look up name in the leaf block, returning both buffers and index. in xfs_dir2_leaf_lookup()
1177 * Get to the leaf entry and contained data entry address. in xfs_dir2_leaf_lookup()
1199 * Look up name/hash in the leaf block.
1202 * lbpp will always be filled in with the leaf buffer unless there's an error.
1207 struct xfs_buf **lbpp, /* out: leaf buffer */ in xfs_dir2_leaf_lookup_int()
1208 int *indexp, /* out: index in leaf block */ in xfs_dir2_leaf_lookup_int()
1217 int index; /* index in leaf block */ in xfs_dir2_leaf_lookup_int()
1218 struct xfs_buf *lbp; /* leaf buffer */ in xfs_dir2_leaf_lookup_int()
1219 xfs_dir2_leaf_entry_t *lep; /* leaf entry */ in xfs_dir2_leaf_lookup_int()
1220 xfs_dir2_leaf_t *leaf; /* leaf structure */ in xfs_dir2_leaf_lookup_int() local
1236 leaf = lbp->b_addr; in xfs_dir2_leaf_lookup_int()
1238 xfs_dir2_leaf_hdr_from_disk(mp, leafhdr, leaf); in xfs_dir2_leaf_lookup_int()
1241 * Look for the first leaf entry with our hash value. in xfs_dir2_leaf_lookup_int()
1253 * Skip over stale leaf entries. in xfs_dir2_leaf_lookup_int()
1333 * Remove an entry from a leaf format directory.
1340 __be16 *bestsp; /* leaf block best freespace */ in xfs_dir2_leaf_removename()
1348 int index; /* index into leaf entries */ in xfs_dir2_leaf_removename()
1349 struct xfs_buf *lbp; /* leaf buffer */ in xfs_dir2_leaf_removename()
1350 xfs_dir2_leaf_t *leaf; /* leaf structure */ in xfs_dir2_leaf_removename() local
1351 xfs_dir2_leaf_entry_t *lep; /* leaf entry */ in xfs_dir2_leaf_removename()
1352 xfs_dir2_leaf_tail_t *ltp; /* leaf tail structure */ in xfs_dir2_leaf_removename()
1362 * Lookup the leaf entry, get the leaf and data blocks read in. in xfs_dir2_leaf_removename()
1369 leaf = lbp->b_addr; in xfs_dir2_leaf_removename()
1375 * Point to the leaf entry, use that to point to the data entry. in xfs_dir2_leaf_removename()
1383 ltp = xfs_dir2_leaf_tail_p(geo, leaf); in xfs_dir2_leaf_removename()
1397 * We just mark the leaf entry stale by putting a null in it. in xfs_dir2_leaf_removename()
1400 xfs_dir2_leaf_hdr_to_disk(dp->i_mount, leaf, &leafhdr); in xfs_dir2_leaf_removename()
1481 * Replace the inode number in a leaf format directory entry.
1491 int index; /* index of leaf entry */ in xfs_dir2_leaf_replace()
1492 struct xfs_buf *lbp; /* leaf buffer */ in xfs_dir2_leaf_replace()
1493 xfs_dir2_leaf_entry_t *lep; /* leaf entry */ in xfs_dir2_leaf_replace()
1508 * Point to the leaf entry, get data address from it. in xfs_dir2_leaf_replace()
1531 * Return index in the leaf block (lbp) which is either the first
1538 struct xfs_buf *lbp) /* leaf buffer */ in xfs_dir2_leaf_search_hash()
1542 int high; /* high leaf index */ in xfs_dir2_leaf_search_hash()
1543 int low; /* low leaf index */ in xfs_dir2_leaf_search_hash()
1544 xfs_dir2_leaf_entry_t *lep; /* leaf entry */ in xfs_dir2_leaf_search_hash()
1545 int mid=0; /* current leaf index */ in xfs_dir2_leaf_search_hash()
1552 * Binary search the leaf entries looking for our hash value. in xfs_dir2_leaf_search_hash()
1582 * Trim off a trailing data block. We know it's empty since the leaf
1588 struct xfs_buf *lbp, /* leaf buffer */ in xfs_dir2_leaf_trim_data()
1592 __be16 *bestsp; /* leaf bests table */ in xfs_dir2_leaf_trim_data()
1596 xfs_dir2_leaf_t *leaf; /* leaf structure */ in xfs_dir2_leaf_trim_data() local
1597 xfs_dir2_leaf_tail_t *ltp; /* leaf tail structure */ in xfs_dir2_leaf_trim_data()
1609 leaf = lbp->b_addr; in xfs_dir2_leaf_trim_data()
1610 ltp = xfs_dir2_leaf_tail_p(geo, leaf); in xfs_dir2_leaf_trim_data()
1666 * Convert node form directory to leaf form directory.
1679 struct xfs_buf *lbp; /* buffer for leaf block */ in xfs_dir2_node_to_leaf()
1680 xfs_dir2_leaf_tail_t *ltp; /* tail of leaf structure */ in xfs_dir2_node_to_leaf()
1681 xfs_dir2_leaf_t *leaf; /* leaf structure */ in xfs_dir2_node_to_leaf() local
1689 * There's more than a leaf level in the btree, so there must in xfs_dir2_node_to_leaf()
1730 * If it's not the single leaf block, give up. in xfs_dir2_node_to_leaf()
1735 leaf = lbp->b_addr; in xfs_dir2_node_to_leaf()
1736 xfs_dir2_leaf_hdr_from_disk(mp, &leafhdr, leaf); in xfs_dir2_node_to_leaf()
1761 * If the leaf has any stale entries in it, compress them out. in xfs_dir2_node_to_leaf()
1773 * Set up the leaf tail from the freespace block. in xfs_dir2_node_to_leaf()
1775 ltp = xfs_dir2_leaf_tail_p(args->geo, leaf); in xfs_dir2_node_to_leaf()
1779 * Set up the leaf bests table. in xfs_dir2_node_to_leaf()
1784 xfs_dir2_leaf_hdr_to_disk(mp, leaf, &leafhdr); in xfs_dir2_node_to_leaf()
1807 * Now see if we can convert the single-leaf directory in xfs_dir2_node_to_leaf()
1809 * This routine always kills the dabuf for the leaf, so in xfs_dir2_node_to_leaf()