Lines Matching full:leaf
65 struct xfs_dir2_leaf *leaf = bp->b_addr; in xfs_dir3_leafn_check() local
68 xfs_dir2_leaf_hdr_from_disk(dp->i_mount, &leafhdr, leaf); in xfs_dir3_leafn_check()
77 return xfs_dir3_leaf_check_int(dp->i_mount, &leafhdr, leaf, false); in xfs_dir3_leafn_check()
406 * Convert a leaf-format directory to a node-format directory.
407 * We need to change the magic number of the leaf block, and copy
408 * the freespace table out of the leaf block into its own block.
413 struct xfs_buf *lbp) /* leaf buffer */ in xfs_dir2_leaf_to_node()
420 int i; /* leaf freespace index */ in xfs_dir2_leaf_to_node()
421 xfs_dir2_leaf_t *leaf; /* leaf structure */ in xfs_dir2_leaf_to_node() local
422 xfs_dir2_leaf_tail_t *ltp; /* leaf tail structure */ in xfs_dir2_leaf_to_node()
447 leaf = lbp->b_addr; in xfs_dir2_leaf_to_node()
448 ltp = xfs_dir2_leaf_tail_p(args->geo, leaf); in xfs_dir2_leaf_to_node()
457 * Copy freespace entries from the leaf block to the new block. in xfs_dir2_leaf_to_node()
479 * Converting the leaf to a leafnode is just a matter of changing the in xfs_dir2_leaf_to_node()
484 if (leaf->hdr.info.magic == cpu_to_be16(XFS_DIR2_LEAF1_MAGIC)) in xfs_dir2_leaf_to_node()
485 leaf->hdr.info.magic = cpu_to_be16(XFS_DIR2_LEAFN_MAGIC); in xfs_dir2_leaf_to_node()
487 leaf->hdr.info.magic = cpu_to_be16(XFS_DIR3_LEAFN_MAGIC); in xfs_dir2_leaf_to_node()
496 * Add a leaf entry to a leaf block in a node-form directory.
501 struct xfs_buf *bp, /* leaf buffer */ in xfs_dir2_leafn_add()
507 struct xfs_dir2_leaf *leaf = bp->b_addr; in xfs_dir2_leafn_add() local
512 int lfloghigh; /* high leaf entry logging */ in xfs_dir2_leafn_add()
513 int lfloglow; /* low leaf entry logging */ in xfs_dir2_leafn_add()
518 xfs_dir2_leaf_hdr_from_disk(dp->i_mount, &leafhdr, leaf); in xfs_dir2_leafn_add()
532 * If there are already the maximum number of leaf entries in in xfs_dir2_leafn_add()
552 * Compact out all but one stale leaf entry. Leaves behind in xfs_dir2_leafn_add()
576 xfs_dir2_leaf_hdr_to_disk(dp->i_mount, leaf, &leafhdr); in xfs_dir2_leafn_add()
603 * Return the last hash value in the leaf.
609 struct xfs_buf *bp, /* leaf buffer */ in xfs_dir2_leaf_lasthash()
610 int *count) /* count of entries in leaf */ in xfs_dir2_leaf_lasthash()
629 * Look up a leaf entry for space to add a name in a node-format leaf block.
634 struct xfs_buf *bp, /* leaf buffer */ in xfs_dir2_leafn_lookup_for_addname()
636 int *indexp, /* out: leaf entry index */ in xfs_dir2_leafn_lookup_for_addname()
646 int index; /* leaf entry index */ in xfs_dir2_leafn_lookup_for_addname()
647 xfs_dir2_leaf_t *leaf; /* leaf structure */ in xfs_dir2_leafn_lookup_for_addname() local
649 xfs_dir2_leaf_entry_t *lep; /* leaf entry */ in xfs_dir2_leafn_lookup_for_addname()
659 leaf = bp->b_addr; in xfs_dir2_leafn_lookup_for_addname()
660 xfs_dir2_leaf_hdr_from_disk(mp, &leafhdr, leaf); in xfs_dir2_leafn_lookup_for_addname()
666 * Look up the hash value in the leaf entries. in xfs_dir2_leafn_lookup_for_addname()
682 * Loop over leaf entries with the right hash value. in xfs_dir2_leafn_lookup_for_addname()
688 * Skip stale leaf entries. in xfs_dir2_leafn_lookup_for_addname()
783 * Look up a leaf entry in a node-format leaf block.
788 struct xfs_buf *bp, /* leaf buffer */ in xfs_dir2_leafn_lookup_for_entry()
790 int *indexp, /* out: leaf entry index */ in xfs_dir2_leafn_lookup_for_entry()
798 int index; /* leaf entry index */ in xfs_dir2_leafn_lookup_for_entry()
799 xfs_dir2_leaf_t *leaf; /* leaf structure */ in xfs_dir2_leafn_lookup_for_entry() local
800 xfs_dir2_leaf_entry_t *lep; /* leaf entry */ in xfs_dir2_leafn_lookup_for_entry()
810 leaf = bp->b_addr; in xfs_dir2_leafn_lookup_for_entry()
811 xfs_dir2_leaf_hdr_from_disk(mp, &leafhdr, leaf); in xfs_dir2_leafn_lookup_for_entry()
821 * Look up the hash value in the leaf entries. in xfs_dir2_leafn_lookup_for_entry()
832 * Loop over leaf entries with the right hash value. in xfs_dir2_leafn_lookup_for_entry()
838 * Skip stale leaf entries. in xfs_dir2_leafn_lookup_for_entry()
937 * Look up a leaf entry in a node-format leaf block.
943 struct xfs_buf *bp, /* leaf buffer */ in xfs_dir2_leafn_lookup_int()
945 int *indexp, /* out: leaf entry index */ in xfs_dir2_leafn_lookup_int()
955 * Move count leaf entries from source to destination leaf.
964 int start_s,/* source leaf index */ in xfs_dir3_leafn_moveents()
968 int start_d,/* destination leaf index */ in xfs_dir3_leafn_moveents()
983 * destination leaf entries, open up a hole in the destination in xfs_dir3_leafn_moveents()
997 int i; /* temp leaf index */ in xfs_dir3_leafn_moveents()
1007 * Copy the leaf entries from source to destination. in xfs_dir3_leafn_moveents()
1034 * Determine the sort order of two leaf blocks.
1064 * Rebalance leaf entries between two leaf blocks.
1078 int isleft; /* new goes in left leaf */ in xfs_dir2_leafn_rebalance()
1079 xfs_dir2_leaf_t *leaf1; /* first leaf structure */ in xfs_dir2_leafn_rebalance()
1080 xfs_dir2_leaf_t *leaf2; /* second leaf structure */ in xfs_dir2_leafn_rebalance()
1081 int mid; /* midpoint leaf index */ in xfs_dir2_leafn_rebalance()
1085 int oldsum; /* old total leaf count */ in xfs_dir2_leafn_rebalance()
1086 int swap_blocks; /* swapped leaf blocks */ in xfs_dir2_leafn_rebalance()
1115 * If the old leaf count was odd then the new one will be even, in xfs_dir2_leafn_rebalance()
1161 * Mark whether we're inserting into the old or new leaf. in xfs_dir2_leafn_rebalance()
1183 "%s: picked the wrong leaf? reverting original leaf: blk1->index %d", in xfs_dir2_leafn_rebalance()
1267 * This removes the leaf entry and the data entry,
1273 struct xfs_buf *bp, /* leaf buffer */ in xfs_dir2_leafn_remove()
1274 int index, /* leaf entry index */ in xfs_dir2_leafn_remove()
1284 xfs_dir2_leaf_t *leaf; /* leaf structure */ in xfs_dir2_leafn_remove() local
1285 xfs_dir2_leaf_entry_t *lep; /* leaf entry */ in xfs_dir2_leafn_remove()
1298 leaf = bp->b_addr; in xfs_dir2_leafn_remove()
1299 xfs_dir2_leaf_hdr_from_disk(dp->i_mount, &leafhdr, leaf); in xfs_dir2_leafn_remove()
1315 * Kill the leaf entry by marking it stale. in xfs_dir2_leafn_remove()
1316 * Log the leaf block changes. in xfs_dir2_leafn_remove()
1319 xfs_dir2_leaf_hdr_to_disk(dp->i_mount, leaf, &leafhdr); in xfs_dir2_leafn_remove()
1415 * Return indication of whether this leaf block is empty enough in xfs_dir2_leafn_remove()
1425 * Split the leaf entries in the old block into old and new blocks.
1434 xfs_dablk_t blkno; /* new leaf block number */ in xfs_dir2_leafn_split()
1439 * Allocate space for a new leaf node. in xfs_dir2_leafn_split()
1449 * Initialize the new leaf block. in xfs_dir2_leafn_split()
1485 * Check a leaf block and its neighbors to see if the block should be
1498 xfs_da_state_blk_t *blk; /* leaf block */ in xfs_dir2_leafn_toosmall()
1499 xfs_dablk_t blkno; /* leaf block number */ in xfs_dir2_leafn_toosmall()
1500 struct xfs_buf *bp; /* leaf buffer */ in xfs_dir2_leafn_toosmall()
1502 int count; /* leaf live entry count */ in xfs_dir2_leafn_toosmall()
1506 xfs_dir2_leaf_t *leaf; /* leaf structure */ in xfs_dir2_leafn_toosmall() local
1518 leaf = blk->bp->b_addr; in xfs_dir2_leafn_toosmall()
1519 xfs_dir2_leaf_hdr_from_disk(dp->i_mount, &leafhdr, leaf); in xfs_dir2_leafn_toosmall()
1567 * Read the sibling leaf block. in xfs_dir2_leafn_toosmall()
1581 leaf = bp->b_addr; in xfs_dir2_leafn_toosmall()
1582 xfs_dir2_leaf_hdr_from_disk(dp->i_mount, &hdr2, leaf); in xfs_dir2_leafn_toosmall()
1621 * Move all the leaf entries from drop_blk to save_blk.
1631 xfs_dir2_leaf_t *drop_leaf; /* dead leaf structure */ in xfs_dir2_leafn_unbalance()
1632 xfs_dir2_leaf_t *save_leaf; /* surviving leaf structure */ in xfs_dir2_leafn_unbalance()
1651 * If there are any stale leaf entries, take this opportunity in xfs_dir2_leafn_unbalance()
1902 * The leaf entry is added in xfs_dir2_leafn_add.
2019 xfs_da_state_blk_t *blk; /* leaf block for insert */ in xfs_dir2_node_addname()
2052 * Add the new leaf entry. in xfs_dir2_node_addname()
2063 * It didn't work, we need to split the leaf block. in xfs_dir2_node_addname()
2070 * Split the leaf block and insert the new entry. in xfs_dir2_node_addname()
2116 * Release the btree blocks and leaf block. in xfs_dir2_node_lookup()
2140 struct xfs_da_state_blk *blk; /* leaf block */ in xfs_dir2_node_removename()
2167 * Remove the leaf and data entries. in xfs_dir2_node_removename()
2179 * If we need to join leaf blocks, do it. in xfs_dir2_node_removename()
2184 * If no errors so far, try conversion to leaf format. in xfs_dir2_node_removename()
2200 xfs_da_state_blk_t *blk; /* leaf block */ in xfs_dir2_node_replace()
2239 * Find the leaf entry. in xfs_dir2_node_replace()