Lines Matching full:leaf

105 	struct xfs_dir2_leaf	*leaf = bp->b_addr;  in xfs_dir3_leaf1_check()  local
108 xfs_dir2_leaf_hdr_from_disk(dp->i_mount, &leafhdr, leaf); in xfs_dir3_leaf1_check()
117 return xfs_dir3_leaf_check_int(dp->i_mount, &leafhdr, leaf, false); in xfs_dir3_leaf1_check()
143 struct xfs_dir2_leaf *leaf, in xfs_dir3_leaf_check_int() argument
153 ltp = xfs_dir2_leaf_tail_p(geo, leaf); in xfs_dir3_leaf_check_int()
163 /* Leaves and bests don't overlap in leaf format. */ in xfs_dir3_leaf_check_int()
191 * We verify the magic numbers before decoding the leaf header so that on debug
354 * Initialize a new leaf block, leaf1 or leafn magic accepted.
364 struct xfs_dir2_leaf *leaf = bp->b_addr; in xfs_dir3_leaf_init() local
380 memset(leaf, 0, sizeof(*leaf)); in xfs_dir3_leaf_init()
381 leaf->hdr.info.magic = cpu_to_be16(type); in xfs_dir3_leaf_init()
385 * If it's a leaf-format directory initialize the tail. in xfs_dir3_leaf_init()
391 ltp = xfs_dir2_leaf_tail_p(mp->m_dir_geo, leaf); in xfs_dir3_leaf_init()
431 * Convert a block form directory to a leaf form directory.
438 __be16 *bestsp; /* leaf's bestsp entries */ in xfs_dir2_block_to_leaf()
439 xfs_dablk_t blkno; /* leaf block's bno */ in xfs_dir2_block_to_leaf()
441 xfs_dir2_leaf_entry_t *blp; /* block's leaf entries */ in xfs_dir2_block_to_leaf()
445 struct xfs_buf *lbp; /* leaf block's buffer */ in xfs_dir2_block_to_leaf()
446 xfs_dir2_db_t ldb; /* leaf block's bno */ in xfs_dir2_block_to_leaf()
447 xfs_dir2_leaf_t *leaf; /* leaf structure */ in xfs_dir2_block_to_leaf() local
448 xfs_dir2_leaf_tail_t *ltp; /* leaf's tail */ in xfs_dir2_block_to_leaf()
460 * Add the leaf block to the inode. in xfs_dir2_block_to_leaf()
461 * This interface will only put blocks in the leaf/node range. in xfs_dir2_block_to_leaf()
470 * Initialize the leaf block, get a buffer for it. in xfs_dir2_block_to_leaf()
476 leaf = lbp->b_addr; in xfs_dir2_block_to_leaf()
484 * Set the counts in the leaf header. in xfs_dir2_block_to_leaf()
486 xfs_dir2_leaf_hdr_from_disk(dp->i_mount, &leafhdr, leaf); in xfs_dir2_block_to_leaf()
489 xfs_dir2_leaf_hdr_to_disk(dp->i_mount, leaf, &leafhdr); in xfs_dir2_block_to_leaf()
502 * Make the space formerly occupied by the leaf entries and block in xfs_dir2_block_to_leaf()
523 * Set up leaf tail and bests table. in xfs_dir2_block_to_leaf()
525 ltp = xfs_dir2_leaf_tail_p(args->geo, leaf); in xfs_dir2_block_to_leaf()
530 * Log the data header and leaf bests table. in xfs_dir2_block_to_leaf()
575 int index, /* leaf table position */ in xfs_dir3_leaf_find_entry()
577 int lowstale, /* index of prev stale leaf */ in xfs_dir3_leaf_find_entry()
578 int highstale, /* index of next stale leaf */ in xfs_dir3_leaf_find_entry()
579 int *lfloglow, /* low leaf logging index */ in xfs_dir3_leaf_find_entry()
580 int *lfloghigh) /* high leaf logging index */ in xfs_dir3_leaf_find_entry()
583 xfs_dir2_leaf_entry_t *lep; /* leaf entry table pointer */ in xfs_dir3_leaf_find_entry()
586 * Now we need to make room to insert the leaf entry. in xfs_dir3_leaf_find_entry()
596 * Record low and high logging indices for the leaf. in xfs_dir3_leaf_find_entry()
662 * Add an entry to a leaf form directory.
670 __be16 *bestsp; /* freespace table in leaf */ in xfs_dir2_leaf_addname()
673 struct xfs_buf *lbp; /* leaf's buffer */ in xfs_dir2_leaf_addname()
674 struct xfs_dir2_leaf *leaf; /* leaf structure */ in xfs_dir2_leaf_addname() local
678 struct xfs_dir2_leaf_entry *lep; /* leaf entry table pointer */ in xfs_dir2_leaf_addname()
681 struct xfs_dir2_leaf_tail *ltp; /* leaf tail pointer */ in xfs_dir2_leaf_addname()
686 int highstale = 0; /* index of next stale leaf */ in xfs_dir2_leaf_addname()
688 int index; /* leaf table position */ in xfs_dir2_leaf_addname()
690 int lfloglow; /* low leaf logging index */ in xfs_dir2_leaf_addname()
691 int lfloghigh; /* high leaf logging index */ in xfs_dir2_leaf_addname()
692 int lowstale = 0; /* index of prev stale leaf */ in xfs_dir2_leaf_addname()
693 int needbytes; /* leaf block bytes needed */ in xfs_dir2_leaf_addname()
712 leaf = lbp->b_addr; in xfs_dir2_leaf_addname()
713 ltp = xfs_dir2_leaf_tail_p(args->geo, leaf); in xfs_dir2_leaf_addname()
714 xfs_dir2_leaf_hdr_from_disk(dp->i_mount, &leafhdr, leaf); in xfs_dir2_leaf_addname()
756 * How many bytes do we need in the leaf block? in xfs_dir2_leaf_addname()
824 * Need to compact the leaf entries, removing stale ones. in xfs_dir2_leaf_addname()
950 * Fill in the new leaf entry. in xfs_dir2_leaf_addname()
957 * Log the leaf fields and give up the buffers. in xfs_dir2_leaf_addname()
959 xfs_dir2_leaf_hdr_to_disk(dp->i_mount, leaf, &leafhdr); in xfs_dir2_leaf_addname()
968 * Compact out any stale entries in the leaf.
969 * Log the header and changed leaf entries, if any.
975 struct xfs_buf *bp) /* leaf buffer */ in xfs_dir3_leaf_compact()
977 int from; /* source leaf index */ in xfs_dir3_leaf_compact()
978 xfs_dir2_leaf_t *leaf; /* leaf structure */ in xfs_dir3_leaf_compact() local
979 int loglow; /* first leaf entry to log */ in xfs_dir3_leaf_compact()
980 int to; /* target leaf index */ in xfs_dir3_leaf_compact()
983 leaf = bp->b_addr; in xfs_dir3_leaf_compact()
1005 * Update and log the header, log the leaf entries. in xfs_dir3_leaf_compact()
1011 xfs_dir2_leaf_hdr_to_disk(dp->i_mount, leaf, leafhdr); in xfs_dir3_leaf_compact()
1018 * Compact the leaf entries, removing stale ones.
1023 * and leaf logging indices.
1094 * Adjust the leaf header values. in xfs_dir3_leaf_compact_x1()
1117 struct xfs_buf *bp, /* leaf buffer */ in xfs_dir3_leaf_log_bests()
1123 struct xfs_dir2_leaf *leaf = bp->b_addr; in xfs_dir3_leaf_log_bests() local
1124 xfs_dir2_leaf_tail_t *ltp; /* leaf tail structure */ in xfs_dir3_leaf_log_bests()
1126 ASSERT(leaf->hdr.info.magic == cpu_to_be16(XFS_DIR2_LEAF1_MAGIC) || in xfs_dir3_leaf_log_bests()
1127 leaf->hdr.info.magic == cpu_to_be16(XFS_DIR3_LEAF1_MAGIC)); in xfs_dir3_leaf_log_bests()
1129 ltp = xfs_dir2_leaf_tail_p(args->geo, leaf); in xfs_dir3_leaf_log_bests()
1133 (uint)((char *)firstb - (char *)leaf), in xfs_dir3_leaf_log_bests()
1134 (uint)((char *)lastb - (char *)leaf + sizeof(*lastb) - 1)); in xfs_dir3_leaf_log_bests()
1138 * Log the leaf entries indicated from a leaf1 or leafn block.
1150 struct xfs_dir2_leaf *leaf = bp->b_addr; in xfs_dir3_leaf_log_ents() local
1152 ASSERT(leaf->hdr.info.magic == cpu_to_be16(XFS_DIR2_LEAF1_MAGIC) || in xfs_dir3_leaf_log_ents()
1153 leaf->hdr.info.magic == cpu_to_be16(XFS_DIR3_LEAF1_MAGIC) || in xfs_dir3_leaf_log_ents()
1154 leaf->hdr.info.magic == cpu_to_be16(XFS_DIR2_LEAFN_MAGIC) || in xfs_dir3_leaf_log_ents()
1155 leaf->hdr.info.magic == cpu_to_be16(XFS_DIR3_LEAFN_MAGIC)); in xfs_dir3_leaf_log_ents()
1160 (uint)((char *)firstlep - (char *)leaf), in xfs_dir3_leaf_log_ents()
1161 (uint)((char *)lastlep - (char *)leaf + sizeof(*lastlep) - 1)); in xfs_dir3_leaf_log_ents()
1172 struct xfs_dir2_leaf *leaf = bp->b_addr; in xfs_dir3_leaf_log_header() local
1174 ASSERT(leaf->hdr.info.magic == cpu_to_be16(XFS_DIR2_LEAF1_MAGIC) || in xfs_dir3_leaf_log_header()
1175 leaf->hdr.info.magic == cpu_to_be16(XFS_DIR3_LEAF1_MAGIC) || in xfs_dir3_leaf_log_header()
1176 leaf->hdr.info.magic == cpu_to_be16(XFS_DIR2_LEAFN_MAGIC) || in xfs_dir3_leaf_log_header()
1177 leaf->hdr.info.magic == cpu_to_be16(XFS_DIR3_LEAFN_MAGIC)); in xfs_dir3_leaf_log_header()
1180 (uint)((char *)&leaf->hdr - (char *)leaf), in xfs_dir3_leaf_log_header()
1192 struct xfs_dir2_leaf *leaf = bp->b_addr; in xfs_dir3_leaf_log_tail() local
1193 xfs_dir2_leaf_tail_t *ltp; /* leaf tail structure */ in xfs_dir3_leaf_log_tail()
1195 ASSERT(leaf->hdr.info.magic == cpu_to_be16(XFS_DIR2_LEAF1_MAGIC) || in xfs_dir3_leaf_log_tail()
1196 leaf->hdr.info.magic == cpu_to_be16(XFS_DIR3_LEAF1_MAGIC) || in xfs_dir3_leaf_log_tail()
1197 leaf->hdr.info.magic == cpu_to_be16(XFS_DIR2_LEAFN_MAGIC) || in xfs_dir3_leaf_log_tail()
1198 leaf->hdr.info.magic == cpu_to_be16(XFS_DIR3_LEAFN_MAGIC)); in xfs_dir3_leaf_log_tail()
1200 ltp = xfs_dir2_leaf_tail_p(args->geo, leaf); in xfs_dir3_leaf_log_tail()
1201 xfs_trans_log_buf(args->trans, bp, (uint)((char *)ltp - (char *)leaf), in xfs_dir3_leaf_log_tail()
1206 * Look up the entry referred to by args in the leaf format directory.
1219 struct xfs_buf *lbp; /* leaf buffer */ in xfs_dir2_leaf_lookup()
1220 xfs_dir2_leaf_entry_t *lep; /* leaf entry */ in xfs_dir2_leaf_lookup()
1227 * Look up name in the leaf block, returning both buffers and index. in xfs_dir2_leaf_lookup()
1238 * Get to the leaf entry and contained data entry address. in xfs_dir2_leaf_lookup()
1260 * Look up name/hash in the leaf block.
1263 * lbpp will always be filled in with the leaf buffer unless there's an error.
1268 struct xfs_buf **lbpp, /* out: leaf buffer */ in xfs_dir2_leaf_lookup_int()
1269 int *indexp, /* out: index in leaf block */ in xfs_dir2_leaf_lookup_int()
1278 int index; /* index in leaf block */ in xfs_dir2_leaf_lookup_int()
1279 struct xfs_buf *lbp; /* leaf buffer */ in xfs_dir2_leaf_lookup_int()
1280 xfs_dir2_leaf_entry_t *lep; /* leaf entry */ in xfs_dir2_leaf_lookup_int()
1281 xfs_dir2_leaf_t *leaf; /* leaf structure */ in xfs_dir2_leaf_lookup_int() local
1298 leaf = lbp->b_addr; in xfs_dir2_leaf_lookup_int()
1300 xfs_dir2_leaf_hdr_from_disk(mp, leafhdr, leaf); in xfs_dir2_leaf_lookup_int()
1303 * Look for the first leaf entry with our hash value. in xfs_dir2_leaf_lookup_int()
1315 * Skip over stale leaf entries. in xfs_dir2_leaf_lookup_int()
1395 * Remove an entry from a leaf format directory.
1402 __be16 *bestsp; /* leaf block best freespace */ in xfs_dir2_leaf_removename()
1410 int index; /* index into leaf entries */ in xfs_dir2_leaf_removename()
1411 struct xfs_buf *lbp; /* leaf buffer */ in xfs_dir2_leaf_removename()
1412 xfs_dir2_leaf_t *leaf; /* leaf structure */ in xfs_dir2_leaf_removename() local
1413 xfs_dir2_leaf_entry_t *lep; /* leaf entry */ in xfs_dir2_leaf_removename()
1414 xfs_dir2_leaf_tail_t *ltp; /* leaf tail structure */ in xfs_dir2_leaf_removename()
1424 * Lookup the leaf entry, get the leaf and data blocks read in. in xfs_dir2_leaf_removename()
1431 leaf = lbp->b_addr; in xfs_dir2_leaf_removename()
1437 * Point to the leaf entry, use that to point to the data entry. in xfs_dir2_leaf_removename()
1445 ltp = xfs_dir2_leaf_tail_p(geo, leaf); in xfs_dir2_leaf_removename()
1461 * We just mark the leaf entry stale by putting a null in it. in xfs_dir2_leaf_removename()
1464 xfs_dir2_leaf_hdr_to_disk(dp->i_mount, leaf, &leafhdr); in xfs_dir2_leaf_removename()
1545 * Replace the inode number in a leaf format directory entry.
1555 int index; /* index of leaf entry */ in xfs_dir2_leaf_replace()
1556 struct xfs_buf *lbp; /* leaf buffer */ in xfs_dir2_leaf_replace()
1557 xfs_dir2_leaf_entry_t *lep; /* leaf entry */ in xfs_dir2_leaf_replace()
1572 * Point to the leaf entry, get data address from it. in xfs_dir2_leaf_replace()
1595 * Return index in the leaf block (lbp) which is either the first
1602 struct xfs_buf *lbp) /* leaf buffer */ in xfs_dir2_leaf_search_hash()
1606 int high; /* high leaf index */ in xfs_dir2_leaf_search_hash()
1607 int low; /* low leaf index */ in xfs_dir2_leaf_search_hash()
1608 xfs_dir2_leaf_entry_t *lep; /* leaf entry */ in xfs_dir2_leaf_search_hash()
1609 int mid=0; /* current leaf index */ in xfs_dir2_leaf_search_hash()
1616 * Binary search the leaf entries looking for our hash value. in xfs_dir2_leaf_search_hash()
1646 * Trim off a trailing data block. We know it's empty since the leaf
1652 struct xfs_buf *lbp, /* leaf buffer */ in xfs_dir2_leaf_trim_data()
1656 __be16 *bestsp; /* leaf bests table */ in xfs_dir2_leaf_trim_data()
1660 xfs_dir2_leaf_t *leaf; /* leaf structure */ in xfs_dir2_leaf_trim_data() local
1661 xfs_dir2_leaf_tail_t *ltp; /* leaf tail structure */ in xfs_dir2_leaf_trim_data()
1674 leaf = lbp->b_addr; in xfs_dir2_leaf_trim_data()
1675 ltp = xfs_dir2_leaf_tail_p(geo, leaf); in xfs_dir2_leaf_trim_data()
1731 * Convert node form directory to leaf form directory.
1744 struct xfs_buf *lbp; /* buffer for leaf block */ in xfs_dir2_node_to_leaf()
1745 xfs_dir2_leaf_tail_t *ltp; /* tail of leaf structure */ in xfs_dir2_node_to_leaf()
1746 xfs_dir2_leaf_t *leaf; /* leaf structure */ in xfs_dir2_node_to_leaf() local
1754 * There's more than a leaf level in the btree, so there must in xfs_dir2_node_to_leaf()
1795 * If it's not the single leaf block, give up. in xfs_dir2_node_to_leaf()
1800 leaf = lbp->b_addr; in xfs_dir2_node_to_leaf()
1801 xfs_dir2_leaf_hdr_from_disk(mp, &leafhdr, leaf); in xfs_dir2_node_to_leaf()
1827 * If the leaf has any stale entries in it, compress them out. in xfs_dir2_node_to_leaf()
1839 * Set up the leaf tail from the freespace block. in xfs_dir2_node_to_leaf()
1841 ltp = xfs_dir2_leaf_tail_p(args->geo, leaf); in xfs_dir2_node_to_leaf()
1845 * Set up the leaf bests table. in xfs_dir2_node_to_leaf()
1850 xfs_dir2_leaf_hdr_to_disk(mp, leaf, &leafhdr); in xfs_dir2_node_to_leaf()
1873 * Now see if we can convert the single-leaf directory in xfs_dir2_node_to_leaf()
1875 * This routine always kills the dabuf for the leaf, so in xfs_dir2_node_to_leaf()