Lines Matching defs:leaf

105 	struct xfs_dir2_leaf	*leaf = bp->b_addr;
108 xfs_dir2_leaf_hdr_from_disk(dp->i_mount, &leafhdr, leaf);
117 return xfs_dir3_leaf_check_int(dp->i_mount, &leafhdr, leaf, false);
143 struct xfs_dir2_leaf *leaf,
153 ltp = xfs_dir2_leaf_tail_p(geo, leaf);
163 /* Leaves and bests don't overlap in leaf format. */
191 * We verify the magic numbers before decoding the leaf header so that on debug
303 * Initialize a new leaf block, leaf1 or leafn magic accepted.
313 struct xfs_dir2_leaf *leaf = bp->b_addr;
329 memset(leaf, 0, sizeof(*leaf));
330 leaf->hdr.info.magic = cpu_to_be16(type);
334 * If it's a leaf-format directory initialize the tail.
340 ltp = xfs_dir2_leaf_tail_p(mp->m_dir_geo, leaf);
381 * Convert a block form directory to a leaf form directory.
388 __be16 *bestsp; /* leaf's bestsp entries */
389 xfs_dablk_t blkno; /* leaf block's bno */
391 xfs_dir2_leaf_entry_t *blp; /* block's leaf entries */
395 struct xfs_buf *lbp; /* leaf block's buffer */
396 xfs_dir2_db_t ldb; /* leaf block's bno */
397 xfs_dir2_leaf_t *leaf; /* leaf structure */
398 xfs_dir2_leaf_tail_t *ltp; /* leaf's tail */
410 * Add the leaf block to the inode.
411 * This interface will only put blocks in the leaf/node range.
420 * Initialize the leaf block, get a buffer for it.
426 leaf = lbp->b_addr;
434 * Set the counts in the leaf header.
436 xfs_dir2_leaf_hdr_from_disk(dp->i_mount, &leafhdr, leaf);
439 xfs_dir2_leaf_hdr_to_disk(dp->i_mount, leaf, &leafhdr);
452 * Make the space formerly occupied by the leaf entries and block
473 * Set up leaf tail and bests table.
475 ltp = xfs_dir2_leaf_tail_p(args->geo, leaf);
480 * Log the data header and leaf bests table.
525 int index, /* leaf table position */
527 int lowstale, /* index of prev stale leaf */
528 int highstale, /* index of next stale leaf */
529 int *lfloglow, /* low leaf logging index */
530 int *lfloghigh) /* high leaf logging index */
533 xfs_dir2_leaf_entry_t *lep; /* leaf entry table pointer */
536 * Now we need to make room to insert the leaf entry.
546 * Record low and high logging indices for the leaf.
612 * Add an entry to a leaf form directory.
620 __be16 *bestsp; /* freespace table in leaf */
623 struct xfs_buf *lbp; /* leaf's buffer */
624 struct xfs_dir2_leaf *leaf; /* leaf structure */
628 struct xfs_dir2_leaf_entry *lep; /* leaf entry table pointer */
631 struct xfs_dir2_leaf_tail *ltp; /* leaf tail pointer */
636 int highstale = 0; /* index of next stale leaf */
638 int index; /* leaf table position */
640 int lfloglow; /* low leaf logging index */
641 int lfloghigh; /* high leaf logging index */
642 int lowstale = 0; /* index of prev stale leaf */
643 int needbytes; /* leaf block bytes needed */
661 leaf = lbp->b_addr;
662 ltp = xfs_dir2_leaf_tail_p(args->geo, leaf);
663 xfs_dir2_leaf_hdr_from_disk(dp->i_mount, &leafhdr, leaf);
705 * How many bytes do we need in the leaf block?
773 * Need to compact the leaf entries, removing stale ones.
899 * Fill in the new leaf entry.
906 * Log the leaf fields and give up the buffers.
908 xfs_dir2_leaf_hdr_to_disk(dp->i_mount, leaf, &leafhdr);
917 * Compact out any stale entries in the leaf.
918 * Log the header and changed leaf entries, if any.
924 struct xfs_buf *bp) /* leaf buffer */
926 int from; /* source leaf index */
927 xfs_dir2_leaf_t *leaf; /* leaf structure */
928 int loglow; /* first leaf entry to log */
929 int to; /* target leaf index */
932 leaf = bp->b_addr;
954 * Update and log the header, log the leaf entries.
960 xfs_dir2_leaf_hdr_to_disk(dp->i_mount, leaf, leafhdr);
967 * Compact the leaf entries, removing stale ones.
972 * and leaf logging indices.
1043 * Adjust the leaf header values.
1066 struct xfs_buf *bp, /* leaf buffer */
1072 struct xfs_dir2_leaf *leaf = bp->b_addr;
1073 xfs_dir2_leaf_tail_t *ltp; /* leaf tail structure */
1075 ASSERT(leaf->hdr.info.magic == cpu_to_be16(XFS_DIR2_LEAF1_MAGIC) ||
1076 leaf->hdr.info.magic == cpu_to_be16(XFS_DIR3_LEAF1_MAGIC));
1078 ltp = xfs_dir2_leaf_tail_p(args->geo, leaf);
1082 (uint)((char *)firstb - (char *)leaf),
1083 (uint)((char *)lastb - (char *)leaf + sizeof(*lastb) - 1));
1087 * Log the leaf entries indicated from a leaf1 or leafn block.
1099 struct xfs_dir2_leaf *leaf = bp->b_addr;
1101 ASSERT(leaf->hdr.info.magic == cpu_to_be16(XFS_DIR2_LEAF1_MAGIC) ||
1102 leaf->hdr.info.magic == cpu_to_be16(XFS_DIR3_LEAF1_MAGIC) ||
1103 leaf->hdr.info.magic == cpu_to_be16(XFS_DIR2_LEAFN_MAGIC) ||
1104 leaf->hdr.info.magic == cpu_to_be16(XFS_DIR3_LEAFN_MAGIC));
1109 (uint)((char *)firstlep - (char *)leaf),
1110 (uint)((char *)lastlep - (char *)leaf + sizeof(*lastlep) - 1));
1121 struct xfs_dir2_leaf *leaf = bp->b_addr;
1123 ASSERT(leaf->hdr.info.magic == cpu_to_be16(XFS_DIR2_LEAF1_MAGIC) ||
1124 leaf->hdr.info.magic == cpu_to_be16(XFS_DIR3_LEAF1_MAGIC) ||
1125 leaf->hdr.info.magic == cpu_to_be16(XFS_DIR2_LEAFN_MAGIC) ||
1126 leaf->hdr.info.magic == cpu_to_be16(XFS_DIR3_LEAFN_MAGIC));
1129 (uint)((char *)&leaf->hdr - (char *)leaf),
1141 struct xfs_dir2_leaf *leaf = bp->b_addr;
1142 xfs_dir2_leaf_tail_t *ltp; /* leaf tail structure */
1144 ASSERT(leaf->hdr.info.magic == cpu_to_be16(XFS_DIR2_LEAF1_MAGIC) ||
1145 leaf->hdr.info.magic == cpu_to_be16(XFS_DIR3_LEAF1_MAGIC) ||
1146 leaf->hdr.info.magic == cpu_to_be16(XFS_DIR2_LEAFN_MAGIC) ||
1147 leaf->hdr.info.magic == cpu_to_be16(XFS_DIR3_LEAFN_MAGIC));
1149 ltp = xfs_dir2_leaf_tail_p(args->geo, leaf);
1150 xfs_trans_log_buf(args->trans, bp, (uint)((char *)ltp - (char *)leaf),
1155 * Look up the entry referred to by args in the leaf format directory.
1168 struct xfs_buf *lbp; /* leaf buffer */
1169 xfs_dir2_leaf_entry_t *lep; /* leaf entry */
1176 * Look up name in the leaf block, returning both buffers and index.
1187 * Get to the leaf entry and contained data entry address.
1209 * Look up name/hash in the leaf block.
1212 * lbpp will always be filled in with the leaf buffer unless there's an error.
1217 struct xfs_buf **lbpp, /* out: leaf buffer */
1218 int *indexp, /* out: index in leaf block */
1227 int index; /* index in leaf block */
1228 struct xfs_buf *lbp; /* leaf buffer */
1229 xfs_dir2_leaf_entry_t *lep; /* leaf entry */
1230 xfs_dir2_leaf_t *leaf; /* leaf structure */
1246 leaf = lbp->b_addr;
1248 xfs_dir2_leaf_hdr_from_disk(mp, leafhdr, leaf);
1251 * Look for the first leaf entry with our hash value.
1263 * Skip over stale leaf entries.
1343 * Remove an entry from a leaf format directory.
1350 __be16 *bestsp; /* leaf block best freespace */
1358 int index; /* index into leaf entries */
1359 struct xfs_buf *lbp; /* leaf buffer */
1360 xfs_dir2_leaf_t *leaf; /* leaf structure */
1361 xfs_dir2_leaf_entry_t *lep; /* leaf entry */
1362 xfs_dir2_leaf_tail_t *ltp; /* leaf tail structure */
1372 * Lookup the leaf entry, get the leaf and data blocks read in.
1379 leaf = lbp->b_addr;
1385 * Point to the leaf entry, use that to point to the data entry.
1393 ltp = xfs_dir2_leaf_tail_p(geo, leaf);
1409 * We just mark the leaf entry stale by putting a null in it.
1412 xfs_dir2_leaf_hdr_to_disk(dp->i_mount, leaf, &leafhdr);
1493 * Replace the inode number in a leaf format directory entry.
1503 int index; /* index of leaf entry */
1504 struct xfs_buf *lbp; /* leaf buffer */
1505 xfs_dir2_leaf_entry_t *lep; /* leaf entry */
1520 * Point to the leaf entry, get data address from it.
1543 * Return index in the leaf block (lbp) which is either the first
1550 struct xfs_buf *lbp) /* leaf buffer */
1554 int high; /* high leaf index */
1555 int low; /* low leaf index */
1556 xfs_dir2_leaf_entry_t *lep; /* leaf entry */
1557 int mid=0; /* current leaf index */
1564 * Binary search the leaf entries looking for our hash value.
1594 * Trim off a trailing data block. We know it's empty since the leaf
1600 struct xfs_buf *lbp, /* leaf buffer */
1604 __be16 *bestsp; /* leaf bests table */
1608 xfs_dir2_leaf_t *leaf; /* leaf structure */
1609 xfs_dir2_leaf_tail_t *ltp; /* leaf tail structure */
1621 leaf = lbp->b_addr;
1622 ltp = xfs_dir2_leaf_tail_p(geo, leaf);
1678 * Convert node form directory to leaf form directory.
1691 struct xfs_buf *lbp; /* buffer for leaf block */
1692 xfs_dir2_leaf_tail_t *ltp; /* tail of leaf structure */
1693 xfs_dir2_leaf_t *leaf; /* leaf structure */
1701 * There's more than a leaf level in the btree, so there must
1742 * If it's not the single leaf block, give up.
1747 leaf = lbp->b_addr;
1748 xfs_dir2_leaf_hdr_from_disk(mp, &leafhdr, leaf);
1773 * If the leaf has any stale entries in it, compress them out.
1785 * Set up the leaf tail from the freespace block.
1787 ltp = xfs_dir2_leaf_tail_p(args->geo, leaf);
1791 * Set up the leaf bests table.
1796 xfs_dir2_leaf_hdr_to_disk(mp, leaf, &leafhdr);
1819 * Now see if we can convert the single-leaf directory
1821 * This routine always kills the dabuf for the leaf, so