Lines Matching defs: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,
270 lentry = xfs_attr3_leaf_name_local(leaf, idx);
277 rentry = xfs_attr3_leaf_name_remote(leaf, idx);
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;
325 xfs_attr3_leaf_hdr_from_disk(mp->m_attr_geo, &ichdr, leaf);
337 if (ichdr.firstused < xfs_attr3_leaf_hdr_size(leaf))
347 * NOTE: This verifier historically failed empty leaf buffers because
351 * cannot assume leaf blocks are non-empty until that is addressed.
355 fa = xfs_attr3_leaf_verify_entry(mp, buf_end, leaf, &ichdr,
416 * leaf/node format detection on trees is sketchy, so a node read can be done on
417 * leaf level blocks when detection identifies the tree as a node format tree
865 /* 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;
948 leaf = bp->b_addr;
949 xfs_attr3_leaf_hdr_from_disk(mp->m_attr_geo, &leafhdr, leaf);
950 entry = xfs_attr3_leaf_entryp(leaf);
958 name_loc = xfs_attr3_leaf_name_local(leaf, i);
1042 * Convert a leaf attribute list to shortform attribute list
1050 struct xfs_attr_leafblock *leaf;
1068 leaf = (xfs_attr_leafblock_t *)tmpbuffer;
1069 xfs_attr3_leaf_hdr_from_disk(args->geo, &ichdr, leaf);
1070 entry = xfs_attr3_leaf_entryp(leaf);
1116 name_loc = xfs_attr3_leaf_name_local(leaf, i);
1133 * Convert from using a single leaf to a root node and a leaf.
1139 struct xfs_attr_leafblock *leaf;
1170 * Copy leaf to new buffer and log it.
1184 leaf = bp2->b_addr;
1185 xfs_attr3_leaf_hdr_from_disk(args->geo, &icleafhdr, leaf);
1186 entries = xfs_attr3_leaf_entryp(leaf);
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;
1228 leaf = bp->b_addr;
1229 memset(leaf, 0, args->geo->blksize);
1250 xfs_attr3_leaf_hdr_to_disk(args->geo, leaf, &ichdr);
1258 * Split the leaf node, rebalance, then add the new entry.
1272 * Allocate space for a new leaf node.
1317 * Add a name to the leaf attribute list structure.
1324 struct xfs_attr_leafblock *leaf;
1334 leaf = bp->b_addr;
1335 xfs_attr3_leaf_hdr_from_disk(args->geo, &ichdr, leaf);
1344 + xfs_attr3_leaf_hdr_size(leaf);
1388 xfs_attr3_leaf_hdr_to_disk(args->geo, leaf, &ichdr);
1390 XFS_DA_LOGRANGE(leaf, &leaf->hdr,
1391 xfs_attr3_leaf_hdr_size(leaf)));
1396 * Add a name to a leaf attribute list structure.
1405 struct xfs_attr_leafblock *leaf;
1415 leaf = bp->b_addr;
1422 entry = &xfs_attr3_leaf_entryp(leaf)[args->index];
1428 XFS_DA_LOGRANGE(leaf, entry, tmp + sizeof(*entry)));
1460 XFS_DA_LOGRANGE(leaf, entry, sizeof(*entry)));
1474 name_loc = xfs_attr3_leaf_name_local(leaf, args->index);
1481 name_rmt = xfs_attr3_leaf_name_remote(leaf, args->index);
1493 XFS_DA_LOGRANGE(leaf, xfs_attr3_leaf_name(leaf, args->index),
1494 xfs_attr_leaf_entsize(leaf, args->index)));
1497 * Update the control info for this leaf node
1503 + xfs_attr3_leaf_hdr_size(leaf));
1505 + xfs_attr3_leaf_hdr_size(leaf);
1515 ichdr->usedbytes += xfs_attr_leaf_entsize(leaf, args->index);
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:
1699 * Figure the total bytes to be added to the destination leaf.
1728 * Figure the total bytes to be added to the destination leaf.
1788 * On a double leaf split, the original attr location
1799 * decide where in the leaf to place it.
1878 * Figure out if next leaf entry would be too much.
1909 * Check a leaf block and its neighbors to see if the block should be
1924 struct xfs_attr_leafblock *leaf;
1943 leaf = blk->bp->b_addr;
1944 xfs_attr3_leaf_hdr_from_disk(state->args->geo, &ichdr, leaf);
1945 bytes = xfs_attr3_leaf_hdr_size(leaf) +
2007 xfs_attr3_leaf_hdr_size(leaf);
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;
2064 leaf = bp->b_addr;
2065 xfs_attr3_leaf_hdr_from_disk(args->geo, &ichdr, leaf);
2070 xfs_attr3_leaf_hdr_size(leaf));
2072 entry = &xfs_attr3_leaf_entryp(leaf)[args->index];
2084 + xfs_attr3_leaf_hdr_size(leaf);
2088 entsize = xfs_attr_leaf_entsize(leaf, args->index);
2146 memset(xfs_attr3_leaf_name(leaf, args->index), 0, entsize);
2149 XFS_DA_LOGRANGE(leaf, xfs_attr3_leaf_name(leaf, args->index),
2156 XFS_DA_LOGRANGE(leaf, entry, tmp + sizeof(xfs_attr_leaf_entry_t)));
2158 entry = &xfs_attr3_leaf_entryp(leaf)[ichdr.count];
2169 entry = xfs_attr3_leaf_entryp(leaf);
2182 xfs_attr3_leaf_hdr_to_disk(args->geo, leaf, &ichdr);
2184 XFS_DA_LOGRANGE(leaf, &leaf->hdr,
2185 xfs_attr3_leaf_hdr_size(leaf)));
2188 * Check if leaf is less than 50% full, caller may want to
2189 * "join" the leaf with a sibling if so.
2191 tmp = ichdr.usedbytes + xfs_attr3_leaf_hdr_size(leaf) +
2194 return tmp < args->geo->magicpct; /* leaf is < 37% full */
2225 * Note that we don't check "leaf" for holes because we will
2230 * dest leaf has no holes, so we add there. May need
2248 * of the leaf and add them both to that.
2257 * Copy the header into the temp leaf so that all the stuff
2313 * Look up a name in a leaf attribute list structure.
2317 * current leaf node. The Btree code must check in adjacent leaf nodes.
2330 struct xfs_attr_leafblock *leaf;
2342 leaf = bp->b_addr;
2343 xfs_attr3_leaf_hdr_from_disk(args->geo, &ichdr, leaf);
2344 entries = xfs_attr3_leaf_entryp(leaf);
2378 * hashval in the leaf.
2403 name_loc = xfs_attr3_leaf_name_local(leaf, probe);
2410 name_rmt = xfs_attr3_leaf_name_remote(leaf, probe);
2428 * Get the value associated with an attribute name from a leaf attribute
2440 struct xfs_attr_leafblock *leaf;
2446 leaf = bp->b_addr;
2447 xfs_attr3_leaf_hdr_from_disk(args->geo, &ichdr, leaf);
2451 entry = &xfs_attr3_leaf_entryp(leaf)[args->index];
2453 name_loc = xfs_attr3_leaf_name_local(leaf, args->index);
2461 name_rmt = xfs_attr3_leaf_name_remote(leaf, args->index);
2476 * Move the indicated entries from one leaf to another.
2522 * Move the entries in the destination leaf up to make a hole?
2618 ichdr_s->holes = 1; /* leaf may not be compact */
2622 * Pick up the last hashvalue from a leaf block.
2647 xfs_attr_leaf_entsize(xfs_attr_leafblock_t *leaf, int index)
2654 entries = xfs_attr3_leaf_entryp(leaf);
2656 name_loc = xfs_attr3_leaf_name_local(leaf, index);
2660 name_rmt = xfs_attr3_leaf_name_remote(leaf, index);
2692 * Manage the INCOMPLETE flag in a leaf entry
2696 * Clear the INCOMPLETE flag on an entry in a leaf block.
2702 struct xfs_attr_leafblock *leaf;
2722 leaf = bp->b_addr;
2723 entry = &xfs_attr3_leaf_entryp(leaf)[args->index];
2727 xfs_attr3_leaf_hdr_from_disk(args->geo, &ichdr, leaf);
2732 name_loc = xfs_attr3_leaf_name_local(leaf, args->index);
2736 name_rmt = xfs_attr3_leaf_name_remote(leaf, args->index);
2747 XFS_DA_LOGRANGE(leaf, entry, sizeof(*entry)));
2751 name_rmt = xfs_attr3_leaf_name_remote(leaf, args->index);
2755 XFS_DA_LOGRANGE(leaf, name_rmt, sizeof(*name_rmt)));
2762 * Set the INCOMPLETE flag on an entry in a leaf block.
2768 struct xfs_attr_leafblock *leaf;
2786 leaf = bp->b_addr;
2788 xfs_attr3_leaf_hdr_from_disk(args->geo, &ichdr, leaf);
2792 entry = &xfs_attr3_leaf_entryp(leaf)[args->index];
2797 XFS_DA_LOGRANGE(leaf, entry, sizeof(*entry)));
2799 name_rmt = xfs_attr3_leaf_name_remote(leaf, args->index);
2803 XFS_DA_LOGRANGE(leaf, name_rmt, sizeof(*name_rmt)));
2810 * In a single transaction, clear the INCOMPLETE flag on the leaf entry
2811 * given by args->blkno/index and set the INCOMPLETE flag on the leaf