Lines Matching defs:leaf

35  * Routines to implement leaf blocks of attributes as Btrees of hashed names.
73 STATIC int xfs_attr_leaf_entsize(xfs_attr_leafblock_t *leaf, int index);
79 * of an attr leaf block. The region starts at the tail of the block and expands
81 * size for an empty leaf block and is reduced from there.
239 struct xfs_attr_leafblock *leaf,
267 lentry = xfs_attr3_leaf_name_local(leaf, idx);
274 rentry = xfs_attr3_leaf_name_remote(leaf, idx);
296 struct xfs_attr_leafblock *leaf = bp->b_addr;
305 xfs_attr3_leaf_hdr_from_disk(mp->m_attr_geo, &ichdr, leaf);
317 if (ichdr.firstused < xfs_attr3_leaf_hdr_size(leaf))
327 * NOTE: This verifier historically failed empty leaf buffers because
331 * cannot assume leaf blocks are non-empty until that is addressed.
335 fa = xfs_attr3_leaf_verify_entry(mp, buf_end, leaf, &ichdr,
396 * leaf/node format detection on trees is sketchy, so a node read can be done on
397 * leaf level blocks when detection identifies the tree as a node format tree
895 * Convert from using the shortform to the leaf. On success, return the
970 * Check a leaf attribute block to see if all the entries would fit into
978 struct xfs_attr_leafblock *leaf;
986 leaf = bp->b_addr;
987 xfs_attr3_leaf_hdr_from_disk(mp->m_attr_geo, &leafhdr, leaf);
988 entry = xfs_attr3_leaf_entryp(leaf);
996 name_loc = xfs_attr3_leaf_name_local(leaf, i);
1088 * Convert a leaf attribute list to shortform attribute list
1096 struct xfs_attr_leafblock *leaf;
1114 leaf = (xfs_attr_leafblock_t *)tmpbuffer;
1115 xfs_attr3_leaf_hdr_from_disk(args->geo, &ichdr, leaf);
1116 entry = xfs_attr3_leaf_entryp(leaf);
1154 name_loc = xfs_attr3_leaf_name_local(leaf, i);
1171 * Convert from using a single leaf to a root node and a leaf.
1177 struct xfs_attr_leafblock *leaf;
1202 /* copy leaf to new buffer, update identifiers */
1221 leaf = bp2->b_addr;
1222 xfs_attr3_leaf_hdr_from_disk(args->geo, &icleafhdr, leaf);
1223 entries = xfs_attr3_leaf_entryp(leaf);
1241 * Create the initial contents of a leaf attribute list
1242 * or a leaf in a node attribute list.
1250 struct xfs_attr_leafblock *leaf;
1265 leaf = bp->b_addr;
1266 memset(leaf, 0, args->geo->blksize);
1287 xfs_attr3_leaf_hdr_to_disk(args->geo, leaf, &ichdr);
1295 * Split the leaf node, rebalance, then add the new entry.
1309 * Allocate space for a new leaf node.
1354 * Add a name to the leaf attribute list structure.
1361 struct xfs_attr_leafblock *leaf;
1371 leaf = bp->b_addr;
1372 xfs_attr3_leaf_hdr_from_disk(args->geo, &ichdr, leaf);
1381 + xfs_attr3_leaf_hdr_size(leaf);
1425 xfs_attr3_leaf_hdr_to_disk(args->geo, leaf, &ichdr);
1427 XFS_DA_LOGRANGE(leaf, &leaf->hdr,
1428 xfs_attr3_leaf_hdr_size(leaf)));
1433 * Add a name to a leaf attribute list structure.
1442 struct xfs_attr_leafblock *leaf;
1452 leaf = bp->b_addr;
1459 entry = &xfs_attr3_leaf_entryp(leaf)[args->index];
1465 XFS_DA_LOGRANGE(leaf, entry, tmp + sizeof(*entry)));
1496 XFS_DA_LOGRANGE(leaf, entry, sizeof(*entry)));
1510 name_loc = xfs_attr3_leaf_name_local(leaf, args->index);
1517 name_rmt = xfs_attr3_leaf_name_remote(leaf, args->index);
1529 XFS_DA_LOGRANGE(leaf, xfs_attr3_leaf_name(leaf, args->index),
1530 xfs_attr_leaf_entsize(leaf, args->index)));
1533 * Update the control info for this leaf node
1539 + xfs_attr3_leaf_hdr_size(leaf));
1541 + xfs_attr3_leaf_hdr_size(leaf);
1551 ichdr->usedbytes += xfs_attr_leaf_entsize(leaf, args->index);
1556 * Garbage collect a leaf attribute list block by copying it to a new buffer.
1614 * Compare two leaf blocks "order".
1654 * Redistribute the attribute list entries between two leaf nodes,
1661 * to match what it is doing in splitting the attribute leaf block. Those
1731 * Move any entries required from leaf to leaf:
1735 * Figure the total bytes to be added to the destination leaf.
1764 * Figure the total bytes to be added to the destination leaf.
1824 * On a double leaf split, the original attr location
1835 * decide where in the leaf to place it.
1914 * Figure out if next leaf entry would be too much.
1945 * Check a leaf block and its neighbors to see if the block should be
1960 struct xfs_attr_leafblock *leaf;
1979 leaf = blk->bp->b_addr;
1980 xfs_attr3_leaf_hdr_from_disk(state->args->geo, &ichdr, leaf);
1981 bytes = xfs_attr3_leaf_hdr_size(leaf) +
2043 xfs_attr3_leaf_hdr_size(leaf);
2077 * Remove a name from the leaf attribute list structure.
2079 * Return 1 if leaf is less than 37% full, 0 if >= 37% full.
2087 struct xfs_attr_leafblock *leaf;
2100 leaf = bp->b_addr;
2101 xfs_attr3_leaf_hdr_from_disk(args->geo, &ichdr, leaf);
2106 xfs_attr3_leaf_hdr_size(leaf));
2108 entry = &xfs_attr3_leaf_entryp(leaf)[args->index];
2120 + xfs_attr3_leaf_hdr_size(leaf);
2124 entsize = xfs_attr_leaf_entsize(leaf, args->index);
2182 memset(xfs_attr3_leaf_name(leaf, args->index), 0, entsize);
2185 XFS_DA_LOGRANGE(leaf, xfs_attr3_leaf_name(leaf, args->index),
2192 XFS_DA_LOGRANGE(leaf, entry, tmp + sizeof(xfs_attr_leaf_entry_t)));
2194 entry = &xfs_attr3_leaf_entryp(leaf)[ichdr.count];
2205 entry = xfs_attr3_leaf_entryp(leaf);
2218 xfs_attr3_leaf_hdr_to_disk(args->geo, leaf, &ichdr);
2220 XFS_DA_LOGRANGE(leaf, &leaf->hdr,
2221 xfs_attr3_leaf_hdr_size(leaf)));
2224 * Check if leaf is less than 50% full, caller may want to
2225 * "join" the leaf with a sibling if so.
2227 tmp = ichdr.usedbytes + xfs_attr3_leaf_hdr_size(leaf) +
2230 return tmp < args->geo->magicpct; /* leaf is < 37% full */
2263 * Note that we don't check "leaf" for holes because we will
2268 * dest leaf has no holes, so we add there. May need
2286 * of the leaf and add them both to that.
2294 * Copy the header into the temp leaf so that all the stuff
2350 * Look up a name in a leaf attribute list structure.
2354 * current leaf node. The Btree code must check in adjacent leaf nodes.
2367 struct xfs_attr_leafblock *leaf;
2379 leaf = bp->b_addr;
2380 xfs_attr3_leaf_hdr_from_disk(args->geo, &ichdr, leaf);
2381 entries = xfs_attr3_leaf_entryp(leaf);
2412 * hashval in the leaf.
2437 name_loc = xfs_attr3_leaf_name_local(leaf, probe);
2444 name_rmt = xfs_attr3_leaf_name_remote(leaf, probe);
2462 * Get the value associated with an attribute name from a leaf attribute
2474 struct xfs_attr_leafblock *leaf;
2480 leaf = bp->b_addr;
2481 xfs_attr3_leaf_hdr_from_disk(args->geo, &ichdr, leaf);
2485 entry = &xfs_attr3_leaf_entryp(leaf)[args->index];
2487 name_loc = xfs_attr3_leaf_name_local(leaf, args->index);
2495 name_rmt = xfs_attr3_leaf_name_remote(leaf, args->index);
2510 * Move the indicated entries from one leaf to another.
2556 * Move the entries in the destination leaf up to make a hole?
2652 ichdr_s->holes = 1; /* leaf may not be compact */
2656 * Pick up the last hashvalue from a leaf block.
2681 xfs_attr_leaf_entsize(xfs_attr_leafblock_t *leaf, int index)
2688 entries = xfs_attr3_leaf_entryp(leaf);
2690 name_loc = xfs_attr3_leaf_name_local(leaf, index);
2694 name_rmt = xfs_attr3_leaf_name_remote(leaf, index);
2726 * Manage the INCOMPLETE flag in a leaf entry
2730 * Clear the INCOMPLETE flag on an entry in a leaf block.
2736 struct xfs_attr_leafblock *leaf;
2756 leaf = bp->b_addr;
2757 entry = &xfs_attr3_leaf_entryp(leaf)[args->index];
2761 xfs_attr3_leaf_hdr_from_disk(args->geo, &ichdr, leaf);
2766 name_loc = xfs_attr3_leaf_name_local(leaf, args->index);
2770 name_rmt = xfs_attr3_leaf_name_remote(leaf, args->index);
2781 XFS_DA_LOGRANGE(leaf, entry, sizeof(*entry)));
2785 name_rmt = xfs_attr3_leaf_name_remote(leaf, args->index);
2789 XFS_DA_LOGRANGE(leaf, name_rmt, sizeof(*name_rmt)));
2796 * Set the INCOMPLETE flag on an entry in a leaf block.
2802 struct xfs_attr_leafblock *leaf;
2820 leaf = bp->b_addr;
2822 xfs_attr3_leaf_hdr_from_disk(args->geo, &ichdr, leaf);
2826 entry = &xfs_attr3_leaf_entryp(leaf)[args->index];
2831 XFS_DA_LOGRANGE(leaf, entry, sizeof(*entry)));
2833 name_rmt = xfs_attr3_leaf_name_remote(leaf, args->index);
2837 XFS_DA_LOGRANGE(leaf, name_rmt, sizeof(*name_rmt)));
2844 * In a single transaction, clear the INCOMPLETE flag on the leaf entry
2845 * given by args->blkno/index and set the INCOMPLETE flag on the leaf