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