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, false); in xfs_dir3_leaf1_check()
142 struct xfs_dir2_leaf *leaf, in xfs_dir3_leaf_check_int() argument
150 ltp = xfs_dir2_leaf_tail_p(geo, leaf); in xfs_dir3_leaf_check_int()
160 /* Leaves and bests don't overlap in leaf format. */ in xfs_dir3_leaf_check_int()
185 * We verify the magic numbers before decoding the leaf header so that on debug
297 * Initialize a new leaf block, leaf1 or leafn magic accepted.
307 struct xfs_dir2_leaf *leaf = bp->b_addr; in xfs_dir3_leaf_init() local
323 memset(leaf, 0, sizeof(*leaf)); in xfs_dir3_leaf_init()
324 leaf->hdr.info.magic = cpu_to_be16(type); in xfs_dir3_leaf_init()
328 * If it's a leaf-format directory initialize the tail. in xfs_dir3_leaf_init()
334 ltp = xfs_dir2_leaf_tail_p(mp->m_dir_geo, leaf); in xfs_dir3_leaf_init()
375 * Convert a block form directory to a leaf form directory.
382 __be16 *bestsp; /* leaf's bestsp entries */ in xfs_dir2_block_to_leaf()
383 xfs_dablk_t blkno; /* leaf block's bno */ in xfs_dir2_block_to_leaf()
385 xfs_dir2_leaf_entry_t *blp; /* block's leaf entries */ in xfs_dir2_block_to_leaf()
389 struct xfs_buf *lbp; /* leaf block's buffer */ in xfs_dir2_block_to_leaf()
390 xfs_dir2_db_t ldb; /* leaf block's bno */ in xfs_dir2_block_to_leaf()
391 xfs_dir2_leaf_t *leaf; /* leaf structure */ in xfs_dir2_block_to_leaf() local
392 xfs_dir2_leaf_tail_t *ltp; /* leaf's tail */ in xfs_dir2_block_to_leaf()
404 * Add the leaf block to the inode. in xfs_dir2_block_to_leaf()
405 * This interface will only put blocks in the leaf/node range. in xfs_dir2_block_to_leaf()
414 * Initialize the leaf block, get a buffer for it. in xfs_dir2_block_to_leaf()
420 leaf = lbp->b_addr; in xfs_dir2_block_to_leaf()
428 * Set the counts in the leaf header. in xfs_dir2_block_to_leaf()
430 xfs_dir2_leaf_hdr_from_disk(dp->i_mount, &leafhdr, leaf); in xfs_dir2_block_to_leaf()
433 xfs_dir2_leaf_hdr_to_disk(dp->i_mount, leaf, &leafhdr); in xfs_dir2_block_to_leaf()
446 * Make the space formerly occupied by the leaf entries and block in xfs_dir2_block_to_leaf()
467 * Set up leaf tail and bests table. in xfs_dir2_block_to_leaf()
469 ltp = xfs_dir2_leaf_tail_p(args->geo, leaf); in xfs_dir2_block_to_leaf()
474 * Log the data header and leaf bests table. in xfs_dir2_block_to_leaf()
519 int index, /* leaf table position */ in xfs_dir3_leaf_find_entry()
521 int lowstale, /* index of prev stale leaf */ in xfs_dir3_leaf_find_entry()
522 int highstale, /* index of next stale leaf */ in xfs_dir3_leaf_find_entry()
523 int *lfloglow, /* low leaf logging index */ in xfs_dir3_leaf_find_entry()
524 int *lfloghigh) /* high leaf logging index */ in xfs_dir3_leaf_find_entry()
527 xfs_dir2_leaf_entry_t *lep; /* leaf entry table pointer */ in xfs_dir3_leaf_find_entry()
530 * Now we need to make room to insert the leaf entry. in xfs_dir3_leaf_find_entry()
540 * Record low and high logging indices for the leaf. in xfs_dir3_leaf_find_entry()
606 * Add an entry to a leaf form directory.
614 __be16 *bestsp; /* freespace table in leaf */ in xfs_dir2_leaf_addname()
617 struct xfs_buf *lbp; /* leaf's buffer */ in xfs_dir2_leaf_addname()
618 struct xfs_dir2_leaf *leaf; /* leaf structure */ in xfs_dir2_leaf_addname() local
622 struct xfs_dir2_leaf_entry *lep; /* leaf entry table pointer */ in xfs_dir2_leaf_addname()
625 struct xfs_dir2_leaf_tail *ltp; /* leaf tail pointer */ in xfs_dir2_leaf_addname()
630 int highstale = 0; /* index of next stale leaf */ in xfs_dir2_leaf_addname()
632 int index; /* leaf table position */ in xfs_dir2_leaf_addname()
634 int lfloglow; /* low leaf logging index */ in xfs_dir2_leaf_addname()
635 int lfloghigh; /* high leaf logging index */ in xfs_dir2_leaf_addname()
636 int lowstale = 0; /* index of prev stale leaf */ in xfs_dir2_leaf_addname()
637 int needbytes; /* leaf block bytes needed */ in xfs_dir2_leaf_addname()
655 leaf = lbp->b_addr; in xfs_dir2_leaf_addname()
656 ltp = xfs_dir2_leaf_tail_p(args->geo, leaf); in xfs_dir2_leaf_addname()
657 xfs_dir2_leaf_hdr_from_disk(dp->i_mount, &leafhdr, leaf); in xfs_dir2_leaf_addname()
699 * How many bytes do we need in the leaf block? in xfs_dir2_leaf_addname()
767 * Need to compact the leaf entries, removing stale ones. in xfs_dir2_leaf_addname()
893 * Fill in the new leaf entry. in xfs_dir2_leaf_addname()
900 * Log the leaf fields and give up the buffers. in xfs_dir2_leaf_addname()
902 xfs_dir2_leaf_hdr_to_disk(dp->i_mount, leaf, &leafhdr); in xfs_dir2_leaf_addname()
911 * Compact out any stale entries in the leaf.
912 * Log the header and changed leaf entries, if any.
918 struct xfs_buf *bp) /* leaf buffer */ in xfs_dir3_leaf_compact()
920 int from; /* source leaf index */ in xfs_dir3_leaf_compact()
921 xfs_dir2_leaf_t *leaf; /* leaf structure */ in xfs_dir3_leaf_compact() local
922 int loglow; /* first leaf entry to log */ in xfs_dir3_leaf_compact()
923 int to; /* target leaf index */ in xfs_dir3_leaf_compact()
926 leaf = bp->b_addr; in xfs_dir3_leaf_compact()
948 * Update and log the header, log the leaf entries. in xfs_dir3_leaf_compact()
954 xfs_dir2_leaf_hdr_to_disk(dp->i_mount, leaf, leafhdr); in xfs_dir3_leaf_compact()
961 * Compact the leaf entries, removing stale ones.
966 * and leaf logging indices.
1037 * Adjust the leaf header values. in xfs_dir3_leaf_compact_x1()
1060 struct xfs_buf *bp, /* leaf buffer */ in xfs_dir3_leaf_log_bests()
1066 struct xfs_dir2_leaf *leaf = bp->b_addr; in xfs_dir3_leaf_log_bests() local
1067 xfs_dir2_leaf_tail_t *ltp; /* leaf tail structure */ in xfs_dir3_leaf_log_bests()
1069 ASSERT(leaf->hdr.info.magic == cpu_to_be16(XFS_DIR2_LEAF1_MAGIC) || in xfs_dir3_leaf_log_bests()
1070 leaf->hdr.info.magic == cpu_to_be16(XFS_DIR3_LEAF1_MAGIC)); in xfs_dir3_leaf_log_bests()
1072 ltp = xfs_dir2_leaf_tail_p(args->geo, leaf); in xfs_dir3_leaf_log_bests()
1076 (uint)((char *)firstb - (char *)leaf), in xfs_dir3_leaf_log_bests()
1077 (uint)((char *)lastb - (char *)leaf + sizeof(*lastb) - 1)); in xfs_dir3_leaf_log_bests()
1081 * Log the leaf entries indicated from a leaf1 or leafn block.
1093 struct xfs_dir2_leaf *leaf = bp->b_addr; in xfs_dir3_leaf_log_ents() local
1095 ASSERT(leaf->hdr.info.magic == cpu_to_be16(XFS_DIR2_LEAF1_MAGIC) || in xfs_dir3_leaf_log_ents()
1096 leaf->hdr.info.magic == cpu_to_be16(XFS_DIR3_LEAF1_MAGIC) || in xfs_dir3_leaf_log_ents()
1097 leaf->hdr.info.magic == cpu_to_be16(XFS_DIR2_LEAFN_MAGIC) || in xfs_dir3_leaf_log_ents()
1098 leaf->hdr.info.magic == cpu_to_be16(XFS_DIR3_LEAFN_MAGIC)); in xfs_dir3_leaf_log_ents()
1103 (uint)((char *)firstlep - (char *)leaf), in xfs_dir3_leaf_log_ents()
1104 (uint)((char *)lastlep - (char *)leaf + sizeof(*lastlep) - 1)); in xfs_dir3_leaf_log_ents()
1115 struct xfs_dir2_leaf *leaf = bp->b_addr; in xfs_dir3_leaf_log_header() local
1117 ASSERT(leaf->hdr.info.magic == cpu_to_be16(XFS_DIR2_LEAF1_MAGIC) || in xfs_dir3_leaf_log_header()
1118 leaf->hdr.info.magic == cpu_to_be16(XFS_DIR3_LEAF1_MAGIC) || in xfs_dir3_leaf_log_header()
1119 leaf->hdr.info.magic == cpu_to_be16(XFS_DIR2_LEAFN_MAGIC) || in xfs_dir3_leaf_log_header()
1120 leaf->hdr.info.magic == cpu_to_be16(XFS_DIR3_LEAFN_MAGIC)); in xfs_dir3_leaf_log_header()
1123 (uint)((char *)&leaf->hdr - (char *)leaf), in xfs_dir3_leaf_log_header()
1135 struct xfs_dir2_leaf *leaf = bp->b_addr; in xfs_dir3_leaf_log_tail() local
1136 xfs_dir2_leaf_tail_t *ltp; /* leaf tail structure */ in xfs_dir3_leaf_log_tail()
1138 ASSERT(leaf->hdr.info.magic == cpu_to_be16(XFS_DIR2_LEAF1_MAGIC) || in xfs_dir3_leaf_log_tail()
1139 leaf->hdr.info.magic == cpu_to_be16(XFS_DIR3_LEAF1_MAGIC) || in xfs_dir3_leaf_log_tail()
1140 leaf->hdr.info.magic == cpu_to_be16(XFS_DIR2_LEAFN_MAGIC) || in xfs_dir3_leaf_log_tail()
1141 leaf->hdr.info.magic == cpu_to_be16(XFS_DIR3_LEAFN_MAGIC)); in xfs_dir3_leaf_log_tail()
1143 ltp = xfs_dir2_leaf_tail_p(args->geo, leaf); in xfs_dir3_leaf_log_tail()
1144 xfs_trans_log_buf(args->trans, bp, (uint)((char *)ltp - (char *)leaf), in xfs_dir3_leaf_log_tail()
1149 * Look up the entry referred to by args in the leaf format directory.
1162 struct xfs_buf *lbp; /* leaf buffer */ in xfs_dir2_leaf_lookup()
1163 xfs_dir2_leaf_entry_t *lep; /* leaf entry */ in xfs_dir2_leaf_lookup()
1170 * Look up name in the leaf block, returning both buffers and index. in xfs_dir2_leaf_lookup()
1181 * Get to the leaf entry and contained data entry address. in xfs_dir2_leaf_lookup()
1203 * Look up name/hash in the leaf block.
1206 * lbpp will always be filled in with the leaf buffer unless there's an error.
1211 struct xfs_buf **lbpp, /* out: leaf buffer */ in xfs_dir2_leaf_lookup_int()
1212 int *indexp, /* out: index in leaf block */ in xfs_dir2_leaf_lookup_int()
1221 int index; /* index in leaf block */ in xfs_dir2_leaf_lookup_int()
1222 struct xfs_buf *lbp; /* leaf buffer */ in xfs_dir2_leaf_lookup_int()
1223 xfs_dir2_leaf_entry_t *lep; /* leaf entry */ in xfs_dir2_leaf_lookup_int()
1224 xfs_dir2_leaf_t *leaf; /* leaf structure */ in xfs_dir2_leaf_lookup_int() local
1240 leaf = lbp->b_addr; in xfs_dir2_leaf_lookup_int()
1242 xfs_dir2_leaf_hdr_from_disk(mp, leafhdr, leaf); in xfs_dir2_leaf_lookup_int()
1245 * Look for the first leaf entry with our hash value. in xfs_dir2_leaf_lookup_int()
1257 * Skip over stale leaf entries. in xfs_dir2_leaf_lookup_int()
1337 * Remove an entry from a leaf format directory.
1344 __be16 *bestsp; /* leaf block best freespace */ in xfs_dir2_leaf_removename()
1352 int index; /* index into leaf entries */ in xfs_dir2_leaf_removename()
1353 struct xfs_buf *lbp; /* leaf buffer */ in xfs_dir2_leaf_removename()
1354 xfs_dir2_leaf_t *leaf; /* leaf structure */ in xfs_dir2_leaf_removename() local
1355 xfs_dir2_leaf_entry_t *lep; /* leaf entry */ in xfs_dir2_leaf_removename()
1356 xfs_dir2_leaf_tail_t *ltp; /* leaf tail structure */ in xfs_dir2_leaf_removename()
1366 * Lookup the leaf entry, get the leaf and data blocks read in. in xfs_dir2_leaf_removename()
1373 leaf = lbp->b_addr; in xfs_dir2_leaf_removename()
1379 * Point to the leaf entry, use that to point to the data entry. in xfs_dir2_leaf_removename()
1387 ltp = xfs_dir2_leaf_tail_p(geo, leaf); in xfs_dir2_leaf_removename()
1401 * We just mark the leaf entry stale by putting a null in it. in xfs_dir2_leaf_removename()
1404 xfs_dir2_leaf_hdr_to_disk(dp->i_mount, leaf, &leafhdr); in xfs_dir2_leaf_removename()
1485 * Replace the inode number in a leaf format directory entry.
1495 int index; /* index of leaf entry */ in xfs_dir2_leaf_replace()
1496 struct xfs_buf *lbp; /* leaf buffer */ in xfs_dir2_leaf_replace()
1497 xfs_dir2_leaf_entry_t *lep; /* leaf entry */ in xfs_dir2_leaf_replace()
1512 * Point to the leaf entry, get data address from it. in xfs_dir2_leaf_replace()
1535 * Return index in the leaf block (lbp) which is either the first
1542 struct xfs_buf *lbp) /* leaf buffer */ in xfs_dir2_leaf_search_hash()
1546 int high; /* high leaf index */ in xfs_dir2_leaf_search_hash()
1547 int low; /* low leaf index */ in xfs_dir2_leaf_search_hash()
1548 xfs_dir2_leaf_entry_t *lep; /* leaf entry */ in xfs_dir2_leaf_search_hash()
1549 int mid=0; /* current leaf index */ in xfs_dir2_leaf_search_hash()
1556 * Binary search the leaf entries looking for our hash value. in xfs_dir2_leaf_search_hash()
1586 * Trim off a trailing data block. We know it's empty since the leaf
1592 struct xfs_buf *lbp, /* leaf buffer */ in xfs_dir2_leaf_trim_data()
1596 __be16 *bestsp; /* leaf bests table */ in xfs_dir2_leaf_trim_data()
1600 xfs_dir2_leaf_t *leaf; /* leaf structure */ in xfs_dir2_leaf_trim_data() local
1601 xfs_dir2_leaf_tail_t *ltp; /* leaf tail structure */ in xfs_dir2_leaf_trim_data()
1613 leaf = lbp->b_addr; in xfs_dir2_leaf_trim_data()
1614 ltp = xfs_dir2_leaf_tail_p(geo, leaf); in xfs_dir2_leaf_trim_data()
1670 * Convert node form directory to leaf form directory.
1683 struct xfs_buf *lbp; /* buffer for leaf block */ in xfs_dir2_node_to_leaf()
1684 xfs_dir2_leaf_tail_t *ltp; /* tail of leaf structure */ in xfs_dir2_node_to_leaf()
1685 xfs_dir2_leaf_t *leaf; /* leaf structure */ in xfs_dir2_node_to_leaf() local
1693 * There's more than a leaf level in the btree, so there must in xfs_dir2_node_to_leaf()
1734 * If it's not the single leaf block, give up. in xfs_dir2_node_to_leaf()
1739 leaf = lbp->b_addr; in xfs_dir2_node_to_leaf()
1740 xfs_dir2_leaf_hdr_from_disk(mp, &leafhdr, leaf); in xfs_dir2_node_to_leaf()
1765 * If the leaf has any stale entries in it, compress them out. in xfs_dir2_node_to_leaf()
1777 * Set up the leaf tail from the freespace block. in xfs_dir2_node_to_leaf()
1779 ltp = xfs_dir2_leaf_tail_p(args->geo, leaf); in xfs_dir2_node_to_leaf()
1783 * Set up the leaf bests table. in xfs_dir2_node_to_leaf()
1788 xfs_dir2_leaf_hdr_to_disk(mp, leaf, &leafhdr); in xfs_dir2_node_to_leaf()
1811 * Now see if we can convert the single-leaf directory in xfs_dir2_node_to_leaf()
1813 * This routine always kills the dabuf for the leaf, so in xfs_dir2_node_to_leaf()