Lines Matching full:leaf
38 * Routines to implement leaf blocks of attributes as Btrees of hashed names.
76 STATIC int xfs_attr_leaf_entsize(xfs_attr_leafblock_t *leaf, int index);
82 * of an attr leaf block. The region starts at the tail of the block and expands
84 * size for an empty leaf block and is reduced from there.
242 struct xfs_attr_leafblock *leaf, in xfs_attr3_leaf_verify_entry() argument
270 lentry = xfs_attr3_leaf_name_local(leaf, idx); in xfs_attr3_leaf_verify_entry()
277 rentry = xfs_attr3_leaf_name_remote(leaf, idx); in xfs_attr3_leaf_verify_entry()
294 * Validate an attribute leaf block.
296 * Empty leaf blocks can occur under the following circumstances:
301 * 4. The attribute is small enough to fit in a leaf block;
303 * the (empty) leaf block; and
305 * attribute can be committed to the leaf block.
308 * because the leaf is empty.
316 struct xfs_attr_leafblock *leaf = bp->b_addr; in xfs_attr3_leaf_verify() local
325 xfs_attr3_leaf_hdr_from_disk(mp->m_attr_geo, &ichdr, leaf); in xfs_attr3_leaf_verify()
337 if (ichdr.firstused < xfs_attr3_leaf_hdr_size(leaf)) in xfs_attr3_leaf_verify()
347 * NOTE: This verifier historically failed empty leaf buffers because in xfs_attr3_leaf_verify()
351 * cannot assume leaf blocks are non-empty until that is addressed. in xfs_attr3_leaf_verify()
355 fa = xfs_attr3_leaf_verify_entry(mp, buf_end, leaf, &ichdr, in xfs_attr3_leaf_verify()
437 * leaf/node format detection on trees is sketchy, so a node read can be done on
438 * leaf level blocks when detection identifies the tree as a node format tree
939 /* Convert from using the shortform to the leaf format. */
1009 * Check a leaf attribute block to see if all the entries would fit into
1017 struct xfs_attr_leafblock *leaf; in xfs_attr_shortform_allfit() local
1025 leaf = bp->b_addr; in xfs_attr_shortform_allfit()
1026 xfs_attr3_leaf_hdr_from_disk(mp->m_attr_geo, &leafhdr, leaf); in xfs_attr_shortform_allfit()
1027 entry = xfs_attr3_leaf_entryp(leaf); in xfs_attr_shortform_allfit()
1035 name_loc = xfs_attr3_leaf_name_local(leaf, i); in xfs_attr_shortform_allfit()
1119 * Convert a leaf attribute list to shortform attribute list
1127 struct xfs_attr_leafblock *leaf; in xfs_attr3_leaf_to_shortform() local
1142 leaf = (xfs_attr_leafblock_t *)tmpbuffer; in xfs_attr3_leaf_to_shortform()
1143 xfs_attr3_leaf_hdr_from_disk(args->geo, &ichdr, leaf); in xfs_attr3_leaf_to_shortform()
1144 entry = xfs_attr3_leaf_entryp(leaf); in xfs_attr3_leaf_to_shortform()
1191 name_loc = xfs_attr3_leaf_name_local(leaf, i); in xfs_attr3_leaf_to_shortform()
1208 * Convert from using a single leaf to a root node and a leaf.
1214 struct xfs_attr_leafblock *leaf; in xfs_attr3_leaf_to_node() local
1245 * Copy leaf to new buffer and log it. in xfs_attr3_leaf_to_node()
1259 leaf = bp2->b_addr; in xfs_attr3_leaf_to_node()
1260 xfs_attr3_leaf_hdr_from_disk(args->geo, &icleafhdr, leaf); in xfs_attr3_leaf_to_node()
1261 entries = xfs_attr3_leaf_entryp(leaf); in xfs_attr3_leaf_to_node()
1279 * Create the initial contents of a leaf attribute list
1280 * or a leaf in a node attribute list.
1288 struct xfs_attr_leafblock *leaf; in xfs_attr3_leaf_create() local
1303 leaf = bp->b_addr; in xfs_attr3_leaf_create()
1304 memset(leaf, 0, args->geo->blksize); in xfs_attr3_leaf_create()
1325 xfs_attr3_leaf_hdr_to_disk(args->geo, leaf, &ichdr); in xfs_attr3_leaf_create()
1333 * Split the leaf node, rebalance, then add the new entry.
1351 * Allocate space for a new leaf node. in xfs_attr3_leaf_split()
1398 * Add a name to the leaf attribute list structure.
1405 struct xfs_attr_leafblock *leaf; in xfs_attr3_leaf_add() local
1416 leaf = bp->b_addr; in xfs_attr3_leaf_add()
1417 xfs_attr3_leaf_hdr_from_disk(args->geo, &ichdr, leaf); in xfs_attr3_leaf_add()
1426 + xfs_attr3_leaf_hdr_size(leaf); in xfs_attr3_leaf_add()
1470 xfs_attr3_leaf_hdr_to_disk(args->geo, leaf, &ichdr); in xfs_attr3_leaf_add()
1472 XFS_DA_LOGRANGE(leaf, &leaf->hdr, in xfs_attr3_leaf_add()
1473 xfs_attr3_leaf_hdr_size(leaf))); in xfs_attr3_leaf_add()
1478 * Add a name to a leaf attribute list structure.
1487 struct xfs_attr_leafblock *leaf; in xfs_attr3_leaf_add_work() local
1497 leaf = bp->b_addr; in xfs_attr3_leaf_add_work()
1504 entry = &xfs_attr3_leaf_entryp(leaf)[args->index]; in xfs_attr3_leaf_add_work()
1510 XFS_DA_LOGRANGE(leaf, entry, tmp + sizeof(*entry))); in xfs_attr3_leaf_add_work()
1542 XFS_DA_LOGRANGE(leaf, entry, sizeof(*entry))); in xfs_attr3_leaf_add_work()
1556 name_loc = xfs_attr3_leaf_name_local(leaf, args->index); in xfs_attr3_leaf_add_work()
1563 name_rmt = xfs_attr3_leaf_name_remote(leaf, args->index); in xfs_attr3_leaf_add_work()
1575 XFS_DA_LOGRANGE(leaf, xfs_attr3_leaf_name(leaf, args->index), in xfs_attr3_leaf_add_work()
1576 xfs_attr_leaf_entsize(leaf, args->index))); in xfs_attr3_leaf_add_work()
1579 * Update the control info for this leaf node in xfs_attr3_leaf_add_work()
1585 + xfs_attr3_leaf_hdr_size(leaf)); in xfs_attr3_leaf_add_work()
1587 + xfs_attr3_leaf_hdr_size(leaf); in xfs_attr3_leaf_add_work()
1597 ichdr->usedbytes += xfs_attr_leaf_entsize(leaf, args->index); in xfs_attr3_leaf_add_work()
1601 * Garbage collect a leaf attribute list block by copying it to a new buffer.
1659 * Compare two leaf blocks "order".
1699 * Redistribute the attribute list entries between two leaf nodes,
1706 * to match what it is doing in splitting the attribute leaf block. Those
1776 * Move any entries required from leaf to leaf: in xfs_attr3_leaf_rebalance()
1780 * Figure the total bytes to be added to the destination leaf. in xfs_attr3_leaf_rebalance()
1809 * Figure the total bytes to be added to the destination leaf. in xfs_attr3_leaf_rebalance()
1869 * On a double leaf split, the original attr location in xfs_attr3_leaf_rebalance()
1880 * decide where in the leaf to place it. in xfs_attr3_leaf_rebalance()
1959 * Figure out if next leaf entry would be too much. in xfs_attr3_leaf_figure_balance()
1990 * Check a leaf block and its neighbors to see if the block should be
2005 struct xfs_attr_leafblock *leaf; in xfs_attr3_leaf_toosmall() local
2024 leaf = blk->bp->b_addr; in xfs_attr3_leaf_toosmall()
2025 xfs_attr3_leaf_hdr_from_disk(state->args->geo, &ichdr, leaf); in xfs_attr3_leaf_toosmall()
2026 bytes = xfs_attr3_leaf_hdr_size(leaf) + in xfs_attr3_leaf_toosmall()
2088 xfs_attr3_leaf_hdr_size(leaf); in xfs_attr3_leaf_toosmall()
2122 * Remove a name from the leaf attribute list structure.
2124 * Return 1 if leaf is less than 37% full, 0 if >= 37% full.
2132 struct xfs_attr_leafblock *leaf; in xfs_attr3_leaf_remove() local
2145 leaf = bp->b_addr; in xfs_attr3_leaf_remove()
2146 xfs_attr3_leaf_hdr_from_disk(args->geo, &ichdr, leaf); in xfs_attr3_leaf_remove()
2151 xfs_attr3_leaf_hdr_size(leaf)); in xfs_attr3_leaf_remove()
2153 entry = &xfs_attr3_leaf_entryp(leaf)[args->index]; in xfs_attr3_leaf_remove()
2165 + xfs_attr3_leaf_hdr_size(leaf); in xfs_attr3_leaf_remove()
2169 entsize = xfs_attr_leaf_entsize(leaf, args->index); in xfs_attr3_leaf_remove()
2227 memset(xfs_attr3_leaf_name(leaf, args->index), 0, entsize); in xfs_attr3_leaf_remove()
2230 XFS_DA_LOGRANGE(leaf, xfs_attr3_leaf_name(leaf, args->index), in xfs_attr3_leaf_remove()
2237 XFS_DA_LOGRANGE(leaf, entry, tmp + sizeof(xfs_attr_leaf_entry_t))); in xfs_attr3_leaf_remove()
2239 entry = &xfs_attr3_leaf_entryp(leaf)[ichdr.count]; in xfs_attr3_leaf_remove()
2250 entry = xfs_attr3_leaf_entryp(leaf); in xfs_attr3_leaf_remove()
2263 xfs_attr3_leaf_hdr_to_disk(args->geo, leaf, &ichdr); in xfs_attr3_leaf_remove()
2265 XFS_DA_LOGRANGE(leaf, &leaf->hdr, in xfs_attr3_leaf_remove()
2266 xfs_attr3_leaf_hdr_size(leaf))); in xfs_attr3_leaf_remove()
2269 * Check if leaf is less than 50% full, caller may want to in xfs_attr3_leaf_remove()
2270 * "join" the leaf with a sibling if so. in xfs_attr3_leaf_remove()
2272 tmp = ichdr.usedbytes + xfs_attr3_leaf_hdr_size(leaf) + in xfs_attr3_leaf_remove()
2275 return tmp < args->geo->magicpct; /* leaf is < 37% full */ in xfs_attr3_leaf_remove()
2306 * Note that we don't check "leaf" for holes because we will in xfs_attr3_leaf_unbalance()
2311 * dest leaf has no holes, so we add there. May need in xfs_attr3_leaf_unbalance()
2329 * of the leaf and add them both to that. in xfs_attr3_leaf_unbalance()
2338 * Copy the header into the temp leaf so that all the stuff in xfs_attr3_leaf_unbalance()
2394 * Look up a name in a leaf attribute list structure.
2398 * current leaf node. The Btree code must check in adjacent leaf nodes.
2411 struct xfs_attr_leafblock *leaf; in xfs_attr3_leaf_lookup_int() local
2423 leaf = bp->b_addr; in xfs_attr3_leaf_lookup_int()
2424 xfs_attr3_leaf_hdr_from_disk(args->geo, &ichdr, leaf); in xfs_attr3_leaf_lookup_int()
2425 entries = xfs_attr3_leaf_entryp(leaf); in xfs_attr3_leaf_lookup_int()
2459 * hashval in the leaf. in xfs_attr3_leaf_lookup_int()
2484 name_loc = xfs_attr3_leaf_name_local(leaf, probe); in xfs_attr3_leaf_lookup_int()
2495 name_rmt = xfs_attr3_leaf_name_remote(leaf, probe); in xfs_attr3_leaf_lookup_int()
2514 * Get the value associated with an attribute name from a leaf attribute
2526 struct xfs_attr_leafblock *leaf; in xfs_attr3_leaf_getvalue() local
2532 leaf = bp->b_addr; in xfs_attr3_leaf_getvalue()
2533 xfs_attr3_leaf_hdr_from_disk(args->geo, &ichdr, leaf); in xfs_attr3_leaf_getvalue()
2537 entry = &xfs_attr3_leaf_entryp(leaf)[args->index]; in xfs_attr3_leaf_getvalue()
2539 name_loc = xfs_attr3_leaf_name_local(leaf, args->index); in xfs_attr3_leaf_getvalue()
2547 name_rmt = xfs_attr3_leaf_name_remote(leaf, args->index); in xfs_attr3_leaf_getvalue()
2562 * Move the indicated entries from one leaf to another.
2608 * Move the entries in the destination leaf up to make a hole? in xfs_attr3_leaf_moveents()
2704 ichdr_s->holes = 1; /* leaf may not be compact */ in xfs_attr3_leaf_moveents()
2708 * Pick up the last hashvalue from a leaf block.
2733 xfs_attr_leaf_entsize(xfs_attr_leafblock_t *leaf, int index) in xfs_attr_leaf_entsize() argument
2740 entries = xfs_attr3_leaf_entryp(leaf); in xfs_attr_leaf_entsize()
2742 name_loc = xfs_attr3_leaf_name_local(leaf, index); in xfs_attr_leaf_entsize()
2746 name_rmt = xfs_attr3_leaf_name_remote(leaf, index); in xfs_attr_leaf_entsize()
2778 * Manage the INCOMPLETE flag in a leaf entry
2782 * Clear the INCOMPLETE flag on an entry in a leaf block.
2788 struct xfs_attr_leafblock *leaf; in xfs_attr3_leaf_clearflag() local
2809 leaf = bp->b_addr; in xfs_attr3_leaf_clearflag()
2810 entry = &xfs_attr3_leaf_entryp(leaf)[args->index]; in xfs_attr3_leaf_clearflag()
2814 xfs_attr3_leaf_hdr_from_disk(args->geo, &ichdr, leaf); in xfs_attr3_leaf_clearflag()
2819 name_loc = xfs_attr3_leaf_name_local(leaf, args->index); in xfs_attr3_leaf_clearflag()
2823 name_rmt = xfs_attr3_leaf_name_remote(leaf, args->index); in xfs_attr3_leaf_clearflag()
2834 XFS_DA_LOGRANGE(leaf, entry, sizeof(*entry))); in xfs_attr3_leaf_clearflag()
2838 name_rmt = xfs_attr3_leaf_name_remote(leaf, args->index); in xfs_attr3_leaf_clearflag()
2842 XFS_DA_LOGRANGE(leaf, name_rmt, sizeof(*name_rmt))); in xfs_attr3_leaf_clearflag()
2849 * Set the INCOMPLETE flag on an entry in a leaf block.
2855 struct xfs_attr_leafblock *leaf; in xfs_attr3_leaf_setflag() local
2874 leaf = bp->b_addr; in xfs_attr3_leaf_setflag()
2876 xfs_attr3_leaf_hdr_from_disk(args->geo, &ichdr, leaf); in xfs_attr3_leaf_setflag()
2880 entry = &xfs_attr3_leaf_entryp(leaf)[args->index]; in xfs_attr3_leaf_setflag()
2885 XFS_DA_LOGRANGE(leaf, entry, sizeof(*entry))); in xfs_attr3_leaf_setflag()
2887 name_rmt = xfs_attr3_leaf_name_remote(leaf, args->index); in xfs_attr3_leaf_setflag()
2891 XFS_DA_LOGRANGE(leaf, name_rmt, sizeof(*name_rmt))); in xfs_attr3_leaf_setflag()
2898 * In a single transaction, clear the INCOMPLETE flag on the leaf entry
2899 * given by args->blkno/index and set the INCOMPLETE flag on the leaf