Lines Matching full:leaf

37  * Routines to implement leaf blocks of attributes as Btrees of hashed names.
75 STATIC int xfs_attr_leaf_entsize(xfs_attr_leafblock_t *leaf, int index);
81 * of an attr leaf block. The region starts at the tail of the block and expands
83 * size for an empty leaf block and is reduced from there.
241 struct xfs_attr_leafblock *leaf, in xfs_attr3_leaf_verify_entry() argument
269 lentry = xfs_attr3_leaf_name_local(leaf, idx); in xfs_attr3_leaf_verify_entry()
276 rentry = xfs_attr3_leaf_name_remote(leaf, idx); in xfs_attr3_leaf_verify_entry()
293 * Validate an attribute leaf block.
295 * Empty leaf blocks can occur under the following circumstances:
300 * 4. The attribute is small enough to fit in a leaf block;
302 * the (empty) leaf block; and
304 * attribute can be committed to the leaf block.
307 * because the leaf is empty.
315 struct xfs_attr_leafblock *leaf = bp->b_addr; in xfs_attr3_leaf_verify() local
324 xfs_attr3_leaf_hdr_from_disk(mp->m_attr_geo, &ichdr, leaf); in xfs_attr3_leaf_verify()
336 if (ichdr.firstused < xfs_attr3_leaf_hdr_size(leaf)) in xfs_attr3_leaf_verify()
346 * NOTE: This verifier historically failed empty leaf buffers because in xfs_attr3_leaf_verify()
350 * cannot assume leaf blocks are non-empty until that is addressed. in xfs_attr3_leaf_verify()
354 fa = xfs_attr3_leaf_verify_entry(mp, buf_end, leaf, &ichdr, in xfs_attr3_leaf_verify()
415 * leaf/node format detection on trees is sketchy, so a node read can be done on
416 * leaf level blocks when detection identifies the tree as a node format tree
931 /* Convert from using the shortform to the leaf format. */
1002 * Check a leaf attribute block to see if all the entries would fit into
1010 struct xfs_attr_leafblock *leaf; in xfs_attr_shortform_allfit() local
1018 leaf = bp->b_addr; in xfs_attr_shortform_allfit()
1019 xfs_attr3_leaf_hdr_from_disk(mp->m_attr_geo, &leafhdr, leaf); in xfs_attr_shortform_allfit()
1020 entry = xfs_attr3_leaf_entryp(leaf); in xfs_attr_shortform_allfit()
1028 name_loc = xfs_attr3_leaf_name_local(leaf, i); in xfs_attr_shortform_allfit()
1120 * Convert a leaf attribute list to shortform attribute list
1128 struct xfs_attr_leafblock *leaf; in xfs_attr3_leaf_to_shortform() local
1146 leaf = (xfs_attr_leafblock_t *)tmpbuffer; in xfs_attr3_leaf_to_shortform()
1147 xfs_attr3_leaf_hdr_from_disk(args->geo, &ichdr, leaf); in xfs_attr3_leaf_to_shortform()
1148 entry = xfs_attr3_leaf_entryp(leaf); in xfs_attr3_leaf_to_shortform()
1194 name_loc = xfs_attr3_leaf_name_local(leaf, i); in xfs_attr3_leaf_to_shortform()
1211 * Convert from using a single leaf to a root node and a leaf.
1217 struct xfs_attr_leafblock *leaf; in xfs_attr3_leaf_to_node() local
1247 /* copy leaf to new buffer, update identifiers */ in xfs_attr3_leaf_to_node()
1266 leaf = bp2->b_addr; in xfs_attr3_leaf_to_node()
1267 xfs_attr3_leaf_hdr_from_disk(args->geo, &icleafhdr, leaf); in xfs_attr3_leaf_to_node()
1268 entries = xfs_attr3_leaf_entryp(leaf); in xfs_attr3_leaf_to_node()
1286 * Create the initial contents of a leaf attribute list
1287 * or a leaf in a node attribute list.
1295 struct xfs_attr_leafblock *leaf; in xfs_attr3_leaf_create() local
1310 leaf = bp->b_addr; in xfs_attr3_leaf_create()
1311 memset(leaf, 0, args->geo->blksize); in xfs_attr3_leaf_create()
1332 xfs_attr3_leaf_hdr_to_disk(args->geo, leaf, &ichdr); in xfs_attr3_leaf_create()
1340 * Split the leaf node, rebalance, then add the new entry.
1354 * Allocate space for a new leaf node. in xfs_attr3_leaf_split()
1399 * Add a name to the leaf attribute list structure.
1406 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()
1602 * Garbage collect a leaf attribute list block by copying it to a new buffer.
1660 * Compare two leaf blocks "order".
1700 * Redistribute the attribute list entries between two leaf nodes,
1707 * to match what it is doing in splitting the attribute leaf block. Those
1777 * Move any entries required from leaf to leaf: in xfs_attr3_leaf_rebalance()
1781 * Figure the total bytes to be added to the destination leaf. in xfs_attr3_leaf_rebalance()
1810 * Figure the total bytes to be added to the destination leaf. in xfs_attr3_leaf_rebalance()
1870 * On a double leaf split, the original attr location in xfs_attr3_leaf_rebalance()
1881 * decide where in the leaf to place it. in xfs_attr3_leaf_rebalance()
1960 * Figure out if next leaf entry would be too much. in xfs_attr3_leaf_figure_balance()
1991 * Check a leaf block and its neighbors to see if the block should be
2006 struct xfs_attr_leafblock *leaf; in xfs_attr3_leaf_toosmall() local
2025 leaf = blk->bp->b_addr; in xfs_attr3_leaf_toosmall()
2026 xfs_attr3_leaf_hdr_from_disk(state->args->geo, &ichdr, leaf); in xfs_attr3_leaf_toosmall()
2027 bytes = xfs_attr3_leaf_hdr_size(leaf) + in xfs_attr3_leaf_toosmall()
2089 xfs_attr3_leaf_hdr_size(leaf); in xfs_attr3_leaf_toosmall()
2123 * Remove a name from the leaf attribute list structure.
2125 * Return 1 if leaf is less than 37% full, 0 if >= 37% full.
2133 struct xfs_attr_leafblock *leaf; in xfs_attr3_leaf_remove() local
2146 leaf = bp->b_addr; in xfs_attr3_leaf_remove()
2147 xfs_attr3_leaf_hdr_from_disk(args->geo, &ichdr, leaf); in xfs_attr3_leaf_remove()
2152 xfs_attr3_leaf_hdr_size(leaf)); in xfs_attr3_leaf_remove()
2154 entry = &xfs_attr3_leaf_entryp(leaf)[args->index]; in xfs_attr3_leaf_remove()
2166 + xfs_attr3_leaf_hdr_size(leaf); in xfs_attr3_leaf_remove()
2170 entsize = xfs_attr_leaf_entsize(leaf, args->index); in xfs_attr3_leaf_remove()
2228 memset(xfs_attr3_leaf_name(leaf, args->index), 0, entsize); in xfs_attr3_leaf_remove()
2231 XFS_DA_LOGRANGE(leaf, xfs_attr3_leaf_name(leaf, args->index), in xfs_attr3_leaf_remove()
2238 XFS_DA_LOGRANGE(leaf, entry, tmp + sizeof(xfs_attr_leaf_entry_t))); in xfs_attr3_leaf_remove()
2240 entry = &xfs_attr3_leaf_entryp(leaf)[ichdr.count]; in xfs_attr3_leaf_remove()
2251 entry = xfs_attr3_leaf_entryp(leaf); in xfs_attr3_leaf_remove()
2264 xfs_attr3_leaf_hdr_to_disk(args->geo, leaf, &ichdr); in xfs_attr3_leaf_remove()
2266 XFS_DA_LOGRANGE(leaf, &leaf->hdr, in xfs_attr3_leaf_remove()
2267 xfs_attr3_leaf_hdr_size(leaf))); in xfs_attr3_leaf_remove()
2270 * Check if leaf is less than 50% full, caller may want to in xfs_attr3_leaf_remove()
2271 * "join" the leaf with a sibling if so. in xfs_attr3_leaf_remove()
2273 tmp = ichdr.usedbytes + xfs_attr3_leaf_hdr_size(leaf) + in xfs_attr3_leaf_remove()
2276 return tmp < args->geo->magicpct; /* leaf is < 37% full */ in xfs_attr3_leaf_remove()
2307 * Note that we don't check "leaf" for holes because we will in xfs_attr3_leaf_unbalance()
2312 * dest leaf has no holes, so we add there. May need in xfs_attr3_leaf_unbalance()
2330 * 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()
2456 * hashval in the leaf. in xfs_attr3_leaf_lookup_int()
2481 name_loc = xfs_attr3_leaf_name_local(leaf, probe); in xfs_attr3_leaf_lookup_int()
2488 name_rmt = xfs_attr3_leaf_name_remote(leaf, probe); in xfs_attr3_leaf_lookup_int()
2506 * Get the value associated with an attribute name from a leaf attribute
2518 struct xfs_attr_leafblock *leaf; in xfs_attr3_leaf_getvalue() local
2524 leaf = bp->b_addr; in xfs_attr3_leaf_getvalue()
2525 xfs_attr3_leaf_hdr_from_disk(args->geo, &ichdr, leaf); in xfs_attr3_leaf_getvalue()
2529 entry = &xfs_attr3_leaf_entryp(leaf)[args->index]; in xfs_attr3_leaf_getvalue()
2531 name_loc = xfs_attr3_leaf_name_local(leaf, args->index); in xfs_attr3_leaf_getvalue()
2539 name_rmt = xfs_attr3_leaf_name_remote(leaf, args->index); in xfs_attr3_leaf_getvalue()
2554 * Move the indicated entries from one leaf to another.
2600 * Move the entries in the destination leaf up to make a hole? in xfs_attr3_leaf_moveents()
2696 ichdr_s->holes = 1; /* leaf may not be compact */ in xfs_attr3_leaf_moveents()
2700 * Pick up the last hashvalue from a leaf block.
2725 xfs_attr_leaf_entsize(xfs_attr_leafblock_t *leaf, int index) in xfs_attr_leaf_entsize() argument
2732 entries = xfs_attr3_leaf_entryp(leaf); in xfs_attr_leaf_entsize()
2734 name_loc = xfs_attr3_leaf_name_local(leaf, index); in xfs_attr_leaf_entsize()
2738 name_rmt = xfs_attr3_leaf_name_remote(leaf, index); in xfs_attr_leaf_entsize()
2770 * Manage the INCOMPLETE flag in a leaf entry
2774 * Clear the INCOMPLETE flag on an entry in a leaf block.
2780 struct xfs_attr_leafblock *leaf; in xfs_attr3_leaf_clearflag() local
2800 leaf = bp->b_addr; in xfs_attr3_leaf_clearflag()
2801 entry = &xfs_attr3_leaf_entryp(leaf)[args->index]; in xfs_attr3_leaf_clearflag()
2805 xfs_attr3_leaf_hdr_from_disk(args->geo, &ichdr, leaf); in xfs_attr3_leaf_clearflag()
2810 name_loc = xfs_attr3_leaf_name_local(leaf, args->index); in xfs_attr3_leaf_clearflag()
2814 name_rmt = xfs_attr3_leaf_name_remote(leaf, args->index); in xfs_attr3_leaf_clearflag()
2825 XFS_DA_LOGRANGE(leaf, entry, sizeof(*entry))); in xfs_attr3_leaf_clearflag()
2829 name_rmt = xfs_attr3_leaf_name_remote(leaf, args->index); in xfs_attr3_leaf_clearflag()
2833 XFS_DA_LOGRANGE(leaf, name_rmt, sizeof(*name_rmt))); in xfs_attr3_leaf_clearflag()
2840 * Set the INCOMPLETE flag on an entry in a leaf block.
2846 struct xfs_attr_leafblock *leaf; in xfs_attr3_leaf_setflag() local
2864 leaf = bp->b_addr; in xfs_attr3_leaf_setflag()
2866 xfs_attr3_leaf_hdr_from_disk(args->geo, &ichdr, leaf); in xfs_attr3_leaf_setflag()
2870 entry = &xfs_attr3_leaf_entryp(leaf)[args->index]; in xfs_attr3_leaf_setflag()
2875 XFS_DA_LOGRANGE(leaf, entry, sizeof(*entry))); in xfs_attr3_leaf_setflag()
2877 name_rmt = xfs_attr3_leaf_name_remote(leaf, args->index); in xfs_attr3_leaf_setflag()
2881 XFS_DA_LOGRANGE(leaf, name_rmt, sizeof(*name_rmt))); in xfs_attr3_leaf_setflag()
2888 * In a single transaction, clear the INCOMPLETE flag on the leaf entry
2889 * given by args->blkno/index and set the INCOMPLETE flag on the leaf