Lines Matching full:leaf

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