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, false);
142 struct xfs_dir2_leaf *leaf,
152 ltp = xfs_dir2_leaf_tail_p(geo, leaf);
162 /* Leaves and bests don't overlap in leaf format. */
190 * We verify the magic numbers before decoding the leaf header so that on debug
302 * Initialize a new leaf block, leaf1 or leafn magic accepted.
312 struct xfs_dir2_leaf *leaf = bp->b_addr;
328 memset(leaf, 0, sizeof(*leaf));
329 leaf->hdr.info.magic = cpu_to_be16(type);
333 * If it's a leaf-format directory initialize the tail.
339 ltp = xfs_dir2_leaf_tail_p(mp->m_dir_geo, leaf);
380 * Convert a block form directory to a leaf form directory.
387 __be16 *bestsp; /* leaf's bestsp entries */
388 xfs_dablk_t blkno; /* leaf block's bno */
390 xfs_dir2_leaf_entry_t *blp; /* block's leaf entries */
394 struct xfs_buf *lbp; /* leaf block's buffer */
395 xfs_dir2_db_t ldb; /* leaf block's bno */
396 xfs_dir2_leaf_t *leaf; /* leaf structure */
397 xfs_dir2_leaf_tail_t *ltp; /* leaf's tail */
409 * Add the leaf block to the inode.
410 * This interface will only put blocks in the leaf/node range.
419 * Initialize the leaf block, get a buffer for it.
425 leaf = lbp->b_addr;
433 * Set the counts in the leaf header.
435 xfs_dir2_leaf_hdr_from_disk(dp->i_mount, &leafhdr, leaf);
438 xfs_dir2_leaf_hdr_to_disk(dp->i_mount, leaf, &leafhdr);
451 * Make the space formerly occupied by the leaf entries and block
472 * Set up leaf tail and bests table.
474 ltp = xfs_dir2_leaf_tail_p(args->geo, leaf);
479 * Log the data header and leaf bests table.
524 int index, /* leaf table position */
526 int lowstale, /* index of prev stale leaf */
527 int highstale, /* index of next stale leaf */
528 int *lfloglow, /* low leaf logging index */
529 int *lfloghigh) /* high leaf logging index */
532 xfs_dir2_leaf_entry_t *lep; /* leaf entry table pointer */
535 * Now we need to make room to insert the leaf entry.
545 * Record low and high logging indices for the leaf.
611 * Add an entry to a leaf form directory.
619 __be16 *bestsp; /* freespace table in leaf */
622 struct xfs_buf *lbp; /* leaf's buffer */
623 struct xfs_dir2_leaf *leaf; /* leaf structure */
627 struct xfs_dir2_leaf_entry *lep; /* leaf entry table pointer */
630 struct xfs_dir2_leaf_tail *ltp; /* leaf tail pointer */
635 int highstale = 0; /* index of next stale leaf */
637 int index; /* leaf table position */
639 int lfloglow; /* low leaf logging index */
640 int lfloghigh; /* high leaf logging index */
641 int lowstale = 0; /* index of prev stale leaf */
642 int needbytes; /* leaf block bytes needed */
660 leaf = lbp->b_addr;
661 ltp = xfs_dir2_leaf_tail_p(args->geo, leaf);
662 xfs_dir2_leaf_hdr_from_disk(dp->i_mount, &leafhdr, leaf);
704 * How many bytes do we need in the leaf block?
772 * Need to compact the leaf entries, removing stale ones.
898 * Fill in the new leaf entry.
905 * Log the leaf fields and give up the buffers.
907 xfs_dir2_leaf_hdr_to_disk(dp->i_mount, leaf, &leafhdr);
916 * Compact out any stale entries in the leaf.
917 * Log the header and changed leaf entries, if any.
923 struct xfs_buf *bp) /* leaf buffer */
925 int from; /* source leaf index */
926 xfs_dir2_leaf_t *leaf; /* leaf structure */
927 int loglow; /* first leaf entry to log */
928 int to; /* target leaf index */
931 leaf = bp->b_addr;
953 * Update and log the header, log the leaf entries.
959 xfs_dir2_leaf_hdr_to_disk(dp->i_mount, leaf, leafhdr);
966 * Compact the leaf entries, removing stale ones.
971 * and leaf logging indices.
1042 * Adjust the leaf header values.
1065 struct xfs_buf *bp, /* leaf buffer */
1071 struct xfs_dir2_leaf *leaf = bp->b_addr;
1072 xfs_dir2_leaf_tail_t *ltp; /* leaf tail structure */
1074 ASSERT(leaf->hdr.info.magic == cpu_to_be16(XFS_DIR2_LEAF1_MAGIC) ||
1075 leaf->hdr.info.magic == cpu_to_be16(XFS_DIR3_LEAF1_MAGIC));
1077 ltp = xfs_dir2_leaf_tail_p(args->geo, leaf);
1081 (uint)((char *)firstb - (char *)leaf),
1082 (uint)((char *)lastb - (char *)leaf + sizeof(*lastb) - 1));
1086 * Log the leaf entries indicated from a leaf1 or leafn block.
1098 struct xfs_dir2_leaf *leaf = bp->b_addr;
1100 ASSERT(leaf->hdr.info.magic == cpu_to_be16(XFS_DIR2_LEAF1_MAGIC) ||
1101 leaf->hdr.info.magic == cpu_to_be16(XFS_DIR3_LEAF1_MAGIC) ||
1102 leaf->hdr.info.magic == cpu_to_be16(XFS_DIR2_LEAFN_MAGIC) ||
1103 leaf->hdr.info.magic == cpu_to_be16(XFS_DIR3_LEAFN_MAGIC));
1108 (uint)((char *)firstlep - (char *)leaf),
1109 (uint)((char *)lastlep - (char *)leaf + sizeof(*lastlep) - 1));
1120 struct xfs_dir2_leaf *leaf = bp->b_addr;
1122 ASSERT(leaf->hdr.info.magic == cpu_to_be16(XFS_DIR2_LEAF1_MAGIC) ||
1123 leaf->hdr.info.magic == cpu_to_be16(XFS_DIR3_LEAF1_MAGIC) ||
1124 leaf->hdr.info.magic == cpu_to_be16(XFS_DIR2_LEAFN_MAGIC) ||
1125 leaf->hdr.info.magic == cpu_to_be16(XFS_DIR3_LEAFN_MAGIC));
1128 (uint)((char *)&leaf->hdr - (char *)leaf),
1140 struct xfs_dir2_leaf *leaf = bp->b_addr;
1141 xfs_dir2_leaf_tail_t *ltp; /* leaf tail structure */
1143 ASSERT(leaf->hdr.info.magic == cpu_to_be16(XFS_DIR2_LEAF1_MAGIC) ||
1144 leaf->hdr.info.magic == cpu_to_be16(XFS_DIR3_LEAF1_MAGIC) ||
1145 leaf->hdr.info.magic == cpu_to_be16(XFS_DIR2_LEAFN_MAGIC) ||
1146 leaf->hdr.info.magic == cpu_to_be16(XFS_DIR3_LEAFN_MAGIC));
1148 ltp = xfs_dir2_leaf_tail_p(args->geo, leaf);
1149 xfs_trans_log_buf(args->trans, bp, (uint)((char *)ltp - (char *)leaf),
1154 * Look up the entry referred to by args in the leaf format directory.
1167 struct xfs_buf *lbp; /* leaf buffer */
1168 xfs_dir2_leaf_entry_t *lep; /* leaf entry */
1175 * Look up name in the leaf block, returning both buffers and index.
1186 * Get to the leaf entry and contained data entry address.
1208 * Look up name/hash in the leaf block.
1211 * lbpp will always be filled in with the leaf buffer unless there's an error.
1216 struct xfs_buf **lbpp, /* out: leaf buffer */
1217 int *indexp, /* out: index in leaf block */
1226 int index; /* index in leaf block */
1227 struct xfs_buf *lbp; /* leaf buffer */
1228 xfs_dir2_leaf_entry_t *lep; /* leaf entry */
1229 xfs_dir2_leaf_t *leaf; /* leaf structure */
1245 leaf = lbp->b_addr;
1247 xfs_dir2_leaf_hdr_from_disk(mp, leafhdr, leaf);
1250 * Look for the first leaf entry with our hash value.
1262 * Skip over stale leaf entries.
1342 * Remove an entry from a leaf format directory.
1349 __be16 *bestsp; /* leaf block best freespace */
1357 int index; /* index into leaf entries */
1358 struct xfs_buf *lbp; /* leaf buffer */
1359 xfs_dir2_leaf_t *leaf; /* leaf structure */
1360 xfs_dir2_leaf_entry_t *lep; /* leaf entry */
1361 xfs_dir2_leaf_tail_t *ltp; /* leaf tail structure */
1371 * Lookup the leaf entry, get the leaf and data blocks read in.
1378 leaf = lbp->b_addr;
1384 * Point to the leaf entry, use that to point to the data entry.
1392 ltp = xfs_dir2_leaf_tail_p(geo, leaf);
1406 * We just mark the leaf entry stale by putting a null in it.
1409 xfs_dir2_leaf_hdr_to_disk(dp->i_mount, leaf, &leafhdr);
1490 * Replace the inode number in a leaf format directory entry.
1500 int index; /* index of leaf entry */
1501 struct xfs_buf *lbp; /* leaf buffer */
1502 xfs_dir2_leaf_entry_t *lep; /* leaf entry */
1517 * Point to the leaf entry, get data address from it.
1540 * Return index in the leaf block (lbp) which is either the first
1547 struct xfs_buf *lbp) /* leaf buffer */
1551 int high; /* high leaf index */
1552 int low; /* low leaf index */
1553 xfs_dir2_leaf_entry_t *lep; /* leaf entry */
1554 int mid=0; /* current leaf index */
1561 * Binary search the leaf entries looking for our hash value.
1591 * Trim off a trailing data block. We know it's empty since the leaf
1597 struct xfs_buf *lbp, /* leaf buffer */
1601 __be16 *bestsp; /* leaf bests table */
1605 xfs_dir2_leaf_t *leaf; /* leaf structure */
1606 xfs_dir2_leaf_tail_t *ltp; /* leaf tail structure */
1618 leaf = lbp->b_addr;
1619 ltp = xfs_dir2_leaf_tail_p(geo, leaf);
1675 * Convert node form directory to leaf form directory.
1688 struct xfs_buf *lbp; /* buffer for leaf block */
1689 xfs_dir2_leaf_tail_t *ltp; /* tail of leaf structure */
1690 xfs_dir2_leaf_t *leaf; /* leaf structure */
1698 * There's more than a leaf level in the btree, so there must
1739 * If it's not the single leaf block, give up.
1744 leaf = lbp->b_addr;
1745 xfs_dir2_leaf_hdr_from_disk(mp, &leafhdr, leaf);
1770 * If the leaf has any stale entries in it, compress them out.
1782 * Set up the leaf tail from the freespace block.
1784 ltp = xfs_dir2_leaf_tail_p(args->geo, leaf);
1788 * Set up the leaf bests table.
1793 xfs_dir2_leaf_hdr_to_disk(mp, leaf, &leafhdr);
1816 * Now see if we can convert the single-leaf directory
1818 * This routine always kills the dabuf for the leaf, so