Lines Matching defs:leaf
64 struct xfs_dir2_leaf *leaf = bp->b_addr;
67 xfs_dir2_leaf_hdr_from_disk(dp->i_mount, &leafhdr, leaf);
76 return xfs_dir3_leaf_check_int(dp->i_mount, &leafhdr, leaf);
400 * Convert a leaf-format directory to a node-format directory.
401 * We need to change the magic number of the leaf block, and copy
402 * the freespace table out of the leaf block into its own block.
407 struct xfs_buf *lbp) /* leaf buffer */
414 int i; /* leaf freespace index */
415 xfs_dir2_leaf_t *leaf; /* leaf structure */
416 xfs_dir2_leaf_tail_t *ltp; /* leaf tail structure */
441 leaf = lbp->b_addr;
442 ltp = xfs_dir2_leaf_tail_p(args->geo, leaf);
450 * Copy freespace entries from the leaf block to the new block.
472 * Converting the leaf to a leafnode is just a matter of changing the
477 if (leaf->hdr.info.magic == cpu_to_be16(XFS_DIR2_LEAF1_MAGIC))
478 leaf->hdr.info.magic = cpu_to_be16(XFS_DIR2_LEAFN_MAGIC);
480 leaf->hdr.info.magic = cpu_to_be16(XFS_DIR3_LEAFN_MAGIC);
489 * Add a leaf entry to a leaf block in a node-form directory.
494 struct xfs_buf *bp, /* leaf buffer */
500 struct xfs_dir2_leaf *leaf = bp->b_addr;
505 int lfloghigh; /* high leaf entry logging */
506 int lfloglow; /* low leaf entry logging */
511 xfs_dir2_leaf_hdr_from_disk(dp->i_mount, &leafhdr, leaf);
524 * If there are already the maximum number of leaf entries in
544 * Compact out all but one stale leaf entry. Leaves behind
568 xfs_dir2_leaf_hdr_to_disk(dp->i_mount, leaf, &leafhdr);
595 * Return the last hash value in the leaf.
601 struct xfs_buf *bp, /* leaf buffer */
602 int *count) /* count of entries in leaf */
621 * Look up a leaf entry for space to add a name in a node-format leaf block.
626 struct xfs_buf *bp, /* leaf buffer */
628 int *indexp, /* out: leaf entry index */
638 int index; /* leaf entry index */
639 xfs_dir2_leaf_t *leaf; /* leaf structure */
641 xfs_dir2_leaf_entry_t *lep; /* leaf entry */
651 leaf = bp->b_addr;
652 xfs_dir2_leaf_hdr_from_disk(mp, &leafhdr, leaf);
658 * Look up the hash value in the leaf entries.
674 * Loop over leaf entries with the right hash value.
680 * Skip stale leaf entries.
774 * Look up a leaf entry in a node-format leaf block.
779 struct xfs_buf *bp, /* leaf buffer */
781 int *indexp, /* out: leaf entry index */
789 int index; /* leaf entry index */
790 xfs_dir2_leaf_t *leaf; /* leaf structure */
791 xfs_dir2_leaf_entry_t *lep; /* leaf entry */
801 leaf = bp->b_addr;
802 xfs_dir2_leaf_hdr_from_disk(mp, &leafhdr, leaf);
811 * Look up the hash value in the leaf entries.
822 * Loop over leaf entries with the right hash value.
828 * Skip stale leaf entries.
927 * Look up a leaf entry in a node-format leaf block.
933 struct xfs_buf *bp, /* leaf buffer */
935 int *indexp, /* out: leaf entry index */
945 * Move count leaf entries from source to destination leaf.
954 int start_s,/* source leaf index */
958 int start_d,/* destination leaf index */
973 * destination leaf entries, open up a hole in the destination
987 int i; /* temp leaf index */
997 * Copy the leaf entries from source to destination.
1024 * Determine the sort order of two leaf blocks.
1054 * Rebalance leaf entries between two leaf blocks.
1068 int isleft; /* new goes in left leaf */
1069 xfs_dir2_leaf_t *leaf1; /* first leaf structure */
1070 xfs_dir2_leaf_t *leaf2; /* second leaf structure */
1071 int mid; /* midpoint leaf index */
1075 int oldsum; /* old total leaf count */
1076 int swap_blocks; /* swapped leaf blocks */
1105 * If the old leaf count was odd then the new one will be even,
1151 * Mark whether we're inserting into the old or new leaf.
1173 "%s: picked the wrong leaf? reverting original leaf: blk1->index %d",
1257 * This removes the leaf entry and the data entry,
1263 struct xfs_buf *bp, /* leaf buffer */
1264 int index, /* leaf entry index */
1274 xfs_dir2_leaf_t *leaf; /* leaf structure */
1275 xfs_dir2_leaf_entry_t *lep; /* leaf entry */
1288 leaf = bp->b_addr;
1289 xfs_dir2_leaf_hdr_from_disk(dp->i_mount, &leafhdr, leaf);
1305 * Kill the leaf entry by marking it stale.
1306 * Log the leaf block changes.
1309 xfs_dir2_leaf_hdr_to_disk(dp->i_mount, leaf, &leafhdr);
1405 * Return indication of whether this leaf block is empty enough
1415 * Split the leaf entries in the old block into old and new blocks.
1424 xfs_dablk_t blkno; /* new leaf block number */
1429 * Allocate space for a new leaf node.
1439 * Initialize the new leaf block.
1475 * Check a leaf block and its neighbors to see if the block should be
1488 xfs_da_state_blk_t *blk; /* leaf block */
1489 xfs_dablk_t blkno; /* leaf block number */
1490 struct xfs_buf *bp; /* leaf buffer */
1492 int count; /* leaf live entry count */
1496 xfs_dir2_leaf_t *leaf; /* leaf structure */
1508 leaf = blk->bp->b_addr;
1509 xfs_dir2_leaf_hdr_from_disk(dp->i_mount, &leafhdr, leaf);
1557 * Read the sibling leaf block.
1570 leaf = bp->b_addr;
1571 xfs_dir2_leaf_hdr_from_disk(dp->i_mount, &hdr2, leaf);
1610 * Move all the leaf entries from drop_blk to save_blk.
1620 xfs_dir2_leaf_t *drop_leaf; /* dead leaf structure */
1621 xfs_dir2_leaf_t *save_leaf; /* surviving leaf structure */
1640 * If there are any stale leaf entries, take this opportunity
1890 * The leaf entry is added in xfs_dir2_leafn_add.
2008 xfs_da_state_blk_t *blk; /* leaf block for insert */
2041 * Add the new leaf entry.
2052 * It didn't work, we need to split the leaf block.
2059 * Split the leaf block and insert the new entry.
2105 * Release the btree blocks and leaf block.
2129 struct xfs_da_state_blk *blk; /* leaf block */
2156 * Remove the leaf and data entries.
2168 * If we need to join leaf blocks, do it.
2173 * If no errors so far, try conversion to leaf format.
2189 xfs_da_state_blk_t *blk; /* leaf block */
2228 * Find the leaf entry.