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
864 /* Convert from using the shortform to the leaf format. */
932 * Check a leaf attribute block to see if all the entries would fit into
940 struct xfs_attr_leafblock *leaf; in xfs_attr_shortform_allfit() local
948 leaf = bp->b_addr; in xfs_attr_shortform_allfit()
949 xfs_attr3_leaf_hdr_from_disk(mp->m_attr_geo, &leafhdr, leaf); in xfs_attr_shortform_allfit()
950 entry = xfs_attr3_leaf_entryp(leaf); in xfs_attr_shortform_allfit()
958 name_loc = xfs_attr3_leaf_name_local(leaf, i); in xfs_attr_shortform_allfit()
1042 * Convert a leaf attribute list to shortform attribute list
1050 struct xfs_attr_leafblock *leaf; in xfs_attr3_leaf_to_shortform() local
1068 leaf = (xfs_attr_leafblock_t *)tmpbuffer; in xfs_attr3_leaf_to_shortform()
1069 xfs_attr3_leaf_hdr_from_disk(args->geo, &ichdr, leaf); in xfs_attr3_leaf_to_shortform()
1070 entry = xfs_attr3_leaf_entryp(leaf); in xfs_attr3_leaf_to_shortform()
1116 name_loc = xfs_attr3_leaf_name_local(leaf, i); in xfs_attr3_leaf_to_shortform()
1133 * Convert from using a single leaf to a root node and a leaf.
1139 struct xfs_attr_leafblock *leaf; in xfs_attr3_leaf_to_node() local
1170 * Copy leaf to new buffer and log it. in xfs_attr3_leaf_to_node()
1184 leaf = bp2->b_addr; in xfs_attr3_leaf_to_node()
1185 xfs_attr3_leaf_hdr_from_disk(args->geo, &icleafhdr, leaf); in xfs_attr3_leaf_to_node()
1186 entries = xfs_attr3_leaf_entryp(leaf); in xfs_attr3_leaf_to_node()
1204 * Create the initial contents of a leaf attribute list
1205 * or a leaf in a node attribute list.
1213 struct xfs_attr_leafblock *leaf; in xfs_attr3_leaf_create() local
1228 leaf = bp->b_addr; in xfs_attr3_leaf_create()
1229 memset(leaf, 0, args->geo->blksize); in xfs_attr3_leaf_create()
1250 xfs_attr3_leaf_hdr_to_disk(args->geo, leaf, &ichdr); in xfs_attr3_leaf_create()
1258 * Split the leaf node, rebalance, then add the new entry.
1272 * Allocate space for a new leaf node. in xfs_attr3_leaf_split()
1317 * Add a name to the leaf attribute list structure.
1324 struct xfs_attr_leafblock *leaf; in xfs_attr3_leaf_add() local
1334 leaf = bp->b_addr; in xfs_attr3_leaf_add()
1335 xfs_attr3_leaf_hdr_from_disk(args->geo, &ichdr, leaf); in xfs_attr3_leaf_add()
1344 + xfs_attr3_leaf_hdr_size(leaf); in xfs_attr3_leaf_add()
1388 xfs_attr3_leaf_hdr_to_disk(args->geo, leaf, &ichdr); in xfs_attr3_leaf_add()
1390 XFS_DA_LOGRANGE(leaf, &leaf->hdr, in xfs_attr3_leaf_add()
1391 xfs_attr3_leaf_hdr_size(leaf))); in xfs_attr3_leaf_add()
1396 * Add a name to a leaf attribute list structure.
1405 struct xfs_attr_leafblock *leaf; in xfs_attr3_leaf_add_work() local
1415 leaf = bp->b_addr; in xfs_attr3_leaf_add_work()
1422 entry = &xfs_attr3_leaf_entryp(leaf)[args->index]; in xfs_attr3_leaf_add_work()
1428 XFS_DA_LOGRANGE(leaf, entry, tmp + sizeof(*entry))); in xfs_attr3_leaf_add_work()
1460 XFS_DA_LOGRANGE(leaf, entry, sizeof(*entry))); in xfs_attr3_leaf_add_work()
1474 name_loc = xfs_attr3_leaf_name_local(leaf, args->index); in xfs_attr3_leaf_add_work()
1481 name_rmt = xfs_attr3_leaf_name_remote(leaf, args->index); in xfs_attr3_leaf_add_work()
1493 XFS_DA_LOGRANGE(leaf, xfs_attr3_leaf_name(leaf, args->index), in xfs_attr3_leaf_add_work()
1494 xfs_attr_leaf_entsize(leaf, args->index))); in xfs_attr3_leaf_add_work()
1497 * Update the control info for this leaf node in xfs_attr3_leaf_add_work()
1503 + xfs_attr3_leaf_hdr_size(leaf)); in xfs_attr3_leaf_add_work()
1505 + xfs_attr3_leaf_hdr_size(leaf); in xfs_attr3_leaf_add_work()
1515 ichdr->usedbytes += xfs_attr_leaf_entsize(leaf, args->index); in xfs_attr3_leaf_add_work()
1520 * Garbage collect a leaf attribute list block by copying it to a new buffer.
1578 * Compare two leaf blocks "order".
1618 * Redistribute the attribute list entries between two leaf nodes,
1625 * to match what it is doing in splitting the attribute leaf block. Those
1695 * Move any entries required from leaf to leaf: in xfs_attr3_leaf_rebalance()
1699 * Figure the total bytes to be added to the destination leaf. in xfs_attr3_leaf_rebalance()
1728 * Figure the total bytes to be added to the destination leaf. in xfs_attr3_leaf_rebalance()
1788 * On a double leaf split, the original attr location in xfs_attr3_leaf_rebalance()
1799 * decide where in the leaf to place it. in xfs_attr3_leaf_rebalance()
1878 * Figure out if next leaf entry would be too much. in xfs_attr3_leaf_figure_balance()
1909 * Check a leaf block and its neighbors to see if the block should be
1924 struct xfs_attr_leafblock *leaf; in xfs_attr3_leaf_toosmall() local
1943 leaf = blk->bp->b_addr; in xfs_attr3_leaf_toosmall()
1944 xfs_attr3_leaf_hdr_from_disk(state->args->geo, &ichdr, leaf); in xfs_attr3_leaf_toosmall()
1945 bytes = xfs_attr3_leaf_hdr_size(leaf) + in xfs_attr3_leaf_toosmall()
2007 xfs_attr3_leaf_hdr_size(leaf); in xfs_attr3_leaf_toosmall()
2041 * Remove a name from the leaf attribute list structure.
2043 * Return 1 if leaf is less than 37% full, 0 if >= 37% full.
2051 struct xfs_attr_leafblock *leaf; in xfs_attr3_leaf_remove() local
2064 leaf = bp->b_addr; in xfs_attr3_leaf_remove()
2065 xfs_attr3_leaf_hdr_from_disk(args->geo, &ichdr, leaf); in xfs_attr3_leaf_remove()
2070 xfs_attr3_leaf_hdr_size(leaf)); in xfs_attr3_leaf_remove()
2072 entry = &xfs_attr3_leaf_entryp(leaf)[args->index]; in xfs_attr3_leaf_remove()
2084 + xfs_attr3_leaf_hdr_size(leaf); in xfs_attr3_leaf_remove()
2088 entsize = xfs_attr_leaf_entsize(leaf, args->index); in xfs_attr3_leaf_remove()
2146 memset(xfs_attr3_leaf_name(leaf, args->index), 0, entsize); in xfs_attr3_leaf_remove()
2149 XFS_DA_LOGRANGE(leaf, xfs_attr3_leaf_name(leaf, args->index), in xfs_attr3_leaf_remove()
2156 XFS_DA_LOGRANGE(leaf, entry, tmp + sizeof(xfs_attr_leaf_entry_t))); in xfs_attr3_leaf_remove()
2158 entry = &xfs_attr3_leaf_entryp(leaf)[ichdr.count]; in xfs_attr3_leaf_remove()
2169 entry = xfs_attr3_leaf_entryp(leaf); in xfs_attr3_leaf_remove()
2182 xfs_attr3_leaf_hdr_to_disk(args->geo, leaf, &ichdr); in xfs_attr3_leaf_remove()
2184 XFS_DA_LOGRANGE(leaf, &leaf->hdr, in xfs_attr3_leaf_remove()
2185 xfs_attr3_leaf_hdr_size(leaf))); in xfs_attr3_leaf_remove()
2188 * Check if leaf is less than 50% full, caller may want to in xfs_attr3_leaf_remove()
2189 * "join" the leaf with a sibling if so. in xfs_attr3_leaf_remove()
2191 tmp = ichdr.usedbytes + xfs_attr3_leaf_hdr_size(leaf) + in xfs_attr3_leaf_remove()
2194 return tmp < args->geo->magicpct; /* leaf is < 37% full */ in xfs_attr3_leaf_remove()
2225 * Note that we don't check "leaf" for holes because we will in xfs_attr3_leaf_unbalance()
2230 * dest leaf has no holes, so we add there. May need in xfs_attr3_leaf_unbalance()
2248 * of the leaf and add them both to that. in xfs_attr3_leaf_unbalance()
2256 * Copy the header into the temp leaf so that all the stuff in xfs_attr3_leaf_unbalance()
2312 * Look up a name in a leaf attribute list structure.
2316 * current leaf node. The Btree code must check in adjacent leaf nodes.
2329 struct xfs_attr_leafblock *leaf; in xfs_attr3_leaf_lookup_int() local
2341 leaf = bp->b_addr; in xfs_attr3_leaf_lookup_int()
2342 xfs_attr3_leaf_hdr_from_disk(args->geo, &ichdr, leaf); in xfs_attr3_leaf_lookup_int()
2343 entries = xfs_attr3_leaf_entryp(leaf); in xfs_attr3_leaf_lookup_int()
2374 * hashval in the leaf. in xfs_attr3_leaf_lookup_int()
2399 name_loc = xfs_attr3_leaf_name_local(leaf, probe); in xfs_attr3_leaf_lookup_int()
2406 name_rmt = xfs_attr3_leaf_name_remote(leaf, probe); in xfs_attr3_leaf_lookup_int()
2424 * Get the value associated with an attribute name from a leaf attribute
2436 struct xfs_attr_leafblock *leaf; in xfs_attr3_leaf_getvalue() local
2442 leaf = bp->b_addr; in xfs_attr3_leaf_getvalue()
2443 xfs_attr3_leaf_hdr_from_disk(args->geo, &ichdr, leaf); in xfs_attr3_leaf_getvalue()
2447 entry = &xfs_attr3_leaf_entryp(leaf)[args->index]; in xfs_attr3_leaf_getvalue()
2449 name_loc = xfs_attr3_leaf_name_local(leaf, args->index); in xfs_attr3_leaf_getvalue()
2457 name_rmt = xfs_attr3_leaf_name_remote(leaf, args->index); in xfs_attr3_leaf_getvalue()
2472 * Move the indicated entries from one leaf to another.
2518 * Move the entries in the destination leaf up to make a hole? in xfs_attr3_leaf_moveents()
2614 ichdr_s->holes = 1; /* leaf may not be compact */ in xfs_attr3_leaf_moveents()
2618 * Pick up the last hashvalue from a leaf block.
2643 xfs_attr_leaf_entsize(xfs_attr_leafblock_t *leaf, int index) in xfs_attr_leaf_entsize() argument
2650 entries = xfs_attr3_leaf_entryp(leaf); in xfs_attr_leaf_entsize()
2652 name_loc = xfs_attr3_leaf_name_local(leaf, index); in xfs_attr_leaf_entsize()
2656 name_rmt = xfs_attr3_leaf_name_remote(leaf, index); in xfs_attr_leaf_entsize()
2688 * Manage the INCOMPLETE flag in a leaf entry
2692 * Clear the INCOMPLETE flag on an entry in a leaf block.
2698 struct xfs_attr_leafblock *leaf; in xfs_attr3_leaf_clearflag() local
2718 leaf = bp->b_addr; in xfs_attr3_leaf_clearflag()
2719 entry = &xfs_attr3_leaf_entryp(leaf)[args->index]; in xfs_attr3_leaf_clearflag()
2723 xfs_attr3_leaf_hdr_from_disk(args->geo, &ichdr, leaf); in xfs_attr3_leaf_clearflag()
2728 name_loc = xfs_attr3_leaf_name_local(leaf, args->index); in xfs_attr3_leaf_clearflag()
2732 name_rmt = xfs_attr3_leaf_name_remote(leaf, args->index); in xfs_attr3_leaf_clearflag()
2743 XFS_DA_LOGRANGE(leaf, entry, sizeof(*entry))); in xfs_attr3_leaf_clearflag()
2747 name_rmt = xfs_attr3_leaf_name_remote(leaf, args->index); in xfs_attr3_leaf_clearflag()
2751 XFS_DA_LOGRANGE(leaf, name_rmt, sizeof(*name_rmt))); in xfs_attr3_leaf_clearflag()
2758 * Set the INCOMPLETE flag on an entry in a leaf block.
2764 struct xfs_attr_leafblock *leaf; in xfs_attr3_leaf_setflag() local
2782 leaf = bp->b_addr; in xfs_attr3_leaf_setflag()
2784 xfs_attr3_leaf_hdr_from_disk(args->geo, &ichdr, leaf); in xfs_attr3_leaf_setflag()
2788 entry = &xfs_attr3_leaf_entryp(leaf)[args->index]; in xfs_attr3_leaf_setflag()
2793 XFS_DA_LOGRANGE(leaf, entry, sizeof(*entry))); in xfs_attr3_leaf_setflag()
2795 name_rmt = xfs_attr3_leaf_name_remote(leaf, args->index); in xfs_attr3_leaf_setflag()
2799 XFS_DA_LOGRANGE(leaf, name_rmt, sizeof(*name_rmt))); in xfs_attr3_leaf_setflag()
2806 * In a single transaction, clear the INCOMPLETE flag on the leaf entry
2807 * given by args->blkno/index and set the INCOMPLETE flag on the leaf