• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-WNDR4500v2-V1.0.0.60_1.0.38/src/linux/linux-2.6/fs/xfs/

Lines Matching refs:leaf

49  * Routines to implement leaf blocks of attributes as Btrees of hashed names.
91 STATIC int xfs_attr_leaf_entsize(xfs_attr_leafblock_t *leaf, int index);
478 * Convert from using the shortform to the leaf.
758 * Check a leaf attribute block to see if all the entries would fit into
764 xfs_attr_leafblock_t *leaf;
769 leaf = bp->data;
770 ASSERT(be16_to_cpu(leaf->hdr.info.magic) == XFS_ATTR_LEAF_MAGIC);
772 entry = &leaf->entries[0];
774 for (i = 0; i < be16_to_cpu(leaf->hdr.count); entry++, i++) {
779 name_loc = XFS_ATTR_LEAF_NAME_LOCAL(leaf, i);
796 * Convert a leaf attribute list to shortform attribute list
801 xfs_attr_leafblock_t *leaf;
815 leaf = (xfs_attr_leafblock_t *)tmpbuffer;
816 ASSERT(be16_to_cpu(leaf->hdr.info.magic) == XFS_ATTR_LEAF_MAGIC);
859 entry = &leaf->entries[0];
860 for (i = 0; i < be16_to_cpu(leaf->hdr.count); entry++, i++) {
866 name_loc = XFS_ATTR_LEAF_NAME_LOCAL(leaf, i);
883 * Convert from using a single leaf to a root node and a leaf.
888 xfs_attr_leafblock_t *leaf;
923 leaf = bp2->data;
924 ASSERT(be16_to_cpu(leaf->hdr.info.magic) == XFS_ATTR_LEAF_MAGIC);
927 leaf->entries[be16_to_cpu(leaf->hdr.count)-1 ].hashval;
946 * Create the initial contents of a leaf attribute list
947 * or a leaf in a node attribute list.
952 xfs_attr_leafblock_t *leaf;
965 leaf = bp->data;
966 memset((char *)leaf, 0, XFS_LBSIZE(dp->i_mount));
967 hdr = &leaf->hdr;
986 * Split the leaf node, rebalance, then add the new entry.
996 * Allocate space for a new leaf node.
1038 * Add a name to the leaf attribute list structure.
1043 xfs_attr_leafblock_t *leaf;
1048 leaf = bp->data;
1049 ASSERT(be16_to_cpu(leaf->hdr.info.magic) == XFS_ATTR_LEAF_MAGIC);
1051 && (args->index <= be16_to_cpu(leaf->hdr.count)));
1052 hdr = &leaf->hdr;
1107 * Add a name to a leaf attribute list structure.
1112 xfs_attr_leafblock_t *leaf;
1121 leaf = bp->data;
1122 ASSERT(be16_to_cpu(leaf->hdr.info.magic) == XFS_ATTR_LEAF_MAGIC);
1123 hdr = &leaf->hdr;
1130 entry = &leaf->entries[args->index];
1136 XFS_DA_LOGRANGE(leaf, entry, tmp + sizeof(*entry)));
1168 XFS_DA_LOGRANGE(leaf, entry, sizeof(*entry)));
1184 name_loc = XFS_ATTR_LEAF_NAME_LOCAL(leaf, args->index);
1191 name_rmt = XFS_ATTR_LEAF_NAME_REMOTE(leaf, args->index);
1202 XFS_DA_LOGRANGE(leaf, XFS_ATTR_LEAF_NAME(leaf, args->index),
1203 xfs_attr_leaf_entsize(leaf, args->index)));
1206 * Update the control info for this leaf node
1224 be16_add(&hdr->usedbytes, xfs_attr_leaf_entsize(leaf, args->index));
1226 XFS_DA_LOGRANGE(leaf, hdr, sizeof(*hdr)));
1231 * Garbage collect a leaf attribute list block by copying it to a new buffer.
1280 * Redistribute the attribute list entries between two leaf nodes,
1287 * to match what it is doing in splitting the attribute leaf block. Those
1344 * Move any entries required from leaf to leaf:
1348 * Figure the total bytes to be added to the destination leaf.
1380 * Figure the total bytes to be added to the destination leaf.
1524 * Figure out if next leaf entry would be too much.
1558 * Check a leaf block and its neighbors to see if the block should be
1571 xfs_attr_leafblock_t *leaf;
1586 leaf = (xfs_attr_leafblock_t *)info;
1587 count = be16_to_cpu(leaf->hdr.count);
1590 be16_to_cpu(leaf->hdr.usedbytes);
1643 leaf = (xfs_attr_leafblock_t *)info;
1644 count = be16_to_cpu(leaf->hdr.count);
1646 bytes -= be16_to_cpu(leaf->hdr.usedbytes);
1647 leaf = bp->data;
1648 ASSERT(be16_to_cpu(leaf->hdr.info.magic) == XFS_ATTR_LEAF_MAGIC);
1649 count += be16_to_cpu(leaf->hdr.count);
1650 bytes -= be16_to_cpu(leaf->hdr.usedbytes);
1685 * Remove a name from the leaf attribute list structure.
1687 * Return 1 if leaf is less than 37% full, 0 if >= 37% full.
1693 xfs_attr_leafblock_t *leaf;
1701 leaf = bp->data;
1702 ASSERT(be16_to_cpu(leaf->hdr.info.magic) == XFS_ATTR_LEAF_MAGIC);
1703 hdr = &leaf->hdr;
1711 entry = &leaf->entries[args->index];
1727 entsize = xfs_attr_leaf_entsize(leaf, args->index);
1792 memset(XFS_ATTR_LEAF_NAME(leaf, args->index), 0, entsize);
1795 XFS_DA_LOGRANGE(leaf, XFS_ATTR_LEAF_NAME(leaf, args->index),
1803 XFS_DA_LOGRANGE(leaf, entry, tmp + sizeof(*entry)));
1804 entry = &leaf->entries[be16_to_cpu(hdr->count)];
1815 entry = &leaf->entries[0];
1833 XFS_DA_LOGRANGE(leaf, hdr, sizeof(*hdr)));
1836 * Check if leaf is less than 50% full, caller may want to
1837 * "join" the leaf with a sibling if so.
1840 tmp += be16_to_cpu(leaf->hdr.count) * sizeof(xfs_attr_leaf_entry_t);
1841 tmp += be16_to_cpu(leaf->hdr.usedbytes);
1842 return(tmp < mp->m_attr_magicpct); /* leaf is < 37% full */
1878 * Note that we don't check "leaf" for holes because we will
1883 * dest leaf has no holes, so we add there. May need
1897 * of the leaf and add them both to that.
1944 * Look up a name in a leaf attribute list structure.
1948 * current leaf node. The Btree code must check in adjacent leaf nodes.
1959 xfs_attr_leafblock_t *leaf;
1966 leaf = bp->data;
1967 ASSERT(be16_to_cpu(leaf->hdr.info.magic) == XFS_ATTR_LEAF_MAGIC);
1968 ASSERT(be16_to_cpu(leaf->hdr.count)
1975 probe = span = be16_to_cpu(leaf->hdr.count) / 2;
1976 for (entry = &leaf->entries[probe]; span > 4;
1977 entry = &leaf->entries[probe]) {
1987 (!leaf->hdr.count
1988 || (probe < be16_to_cpu(leaf->hdr.count))));
1993 * hashval in the leaf.
1999 while ((probe < be16_to_cpu(leaf->hdr.count)) &&
2004 if ((probe == be16_to_cpu(leaf->hdr.count)) ||
2013 for ( ; (probe < be16_to_cpu(leaf->hdr.count)) &&
2028 name_loc = XFS_ATTR_LEAF_NAME_LOCAL(leaf, probe);
2038 name_rmt = XFS_ATTR_LEAF_NAME_REMOTE(leaf, probe);
2058 * Get the value associated with an attribute name from a leaf attribute
2065 xfs_attr_leafblock_t *leaf;
2070 leaf = bp->data;
2071 ASSERT(be16_to_cpu(leaf->hdr.info.magic) == XFS_ATTR_LEAF_MAGIC);
2072 ASSERT(be16_to_cpu(leaf->hdr.count)
2074 ASSERT(args->index < be16_to_cpu(leaf->hdr.count));
2076 entry = &leaf->entries[args->index];
2078 name_loc = XFS_ATTR_LEAF_NAME_LOCAL(leaf, args->index);
2093 name_rmt = XFS_ATTR_LEAF_NAME_REMOTE(leaf, args->index);
2117 * Move the indicated entries from one leaf to another.
2158 * Move the entries in the destination leaf up to make a hole?
2260 hdr_s->holes = 1; /* leaf may not be compact */
2264 * Compare two leaf blocks "order".
2290 * Pick up the last hashvalue from a leaf block.
2295 xfs_attr_leafblock_t *leaf;
2297 leaf = bp->data;
2298 ASSERT(be16_to_cpu(leaf->hdr.info.magic) == XFS_ATTR_LEAF_MAGIC);
2300 *count = be16_to_cpu(leaf->hdr.count);
2301 if (!leaf->hdr.count)
2303 return be32_to_cpu(leaf->entries[be16_to_cpu(leaf->hdr.count)-1].hashval);
2311 xfs_attr_leaf_entsize(xfs_attr_leafblock_t *leaf, int index)
2317 ASSERT(be16_to_cpu(leaf->hdr.info.magic) == XFS_ATTR_LEAF_MAGIC);
2318 if (leaf->entries[index].flags & XFS_ATTR_LOCAL) {
2319 name_loc = XFS_ATTR_LEAF_NAME_LOCAL(leaf, index);
2323 name_rmt = XFS_ATTR_LEAF_NAME_REMOTE(leaf, index);
2355 * Copy out attribute list entries for attr_list(), for leaf attribute lists.
2361 xfs_attr_leafblock_t *leaf;
2366 leaf = bp->data;
2370 xfs_attr_trace_l_cl("blk start", context, leaf);
2373 * Re-find our place in the leaf block if this is a new syscall.
2376 entry = &leaf->entries[0];
2377 for (i = 0; i < be16_to_cpu(leaf->hdr.count); entry++, i++) {
2390 if (i == be16_to_cpu(leaf->hdr.count)) {
2395 entry = &leaf->entries[0];
2404 for ( ; (i < be16_to_cpu(leaf->hdr.count)); entry++, i++) {
2421 XFS_ATTR_LEAF_NAME_LOCAL(leaf, i);
2433 XFS_ATTR_LEAF_NAME_REMOTE(leaf, i);
2473 xfs_attr_trace_l_cl("blk end", context, leaf);
2479 * Manage the INCOMPLETE flag in a leaf entry
2483 * Clear the INCOMPLETE flag on an entry in a leaf block.
2488 xfs_attr_leafblock_t *leaf;
2509 leaf = bp->data;
2510 ASSERT(be16_to_cpu(leaf->hdr.info.magic) == XFS_ATTR_LEAF_MAGIC);
2511 ASSERT(args->index < be16_to_cpu(leaf->hdr.count));
2513 entry = &leaf->entries[ args->index ];
2518 name_loc = XFS_ATTR_LEAF_NAME_LOCAL(leaf, args->index);
2522 name_rmt = XFS_ATTR_LEAF_NAME_REMOTE(leaf, args->index);
2533 XFS_DA_LOGRANGE(leaf, entry, sizeof(*entry)));
2537 name_rmt = XFS_ATTR_LEAF_NAME_REMOTE(leaf, args->index);
2541 XFS_DA_LOGRANGE(leaf, name_rmt, sizeof(*name_rmt)));
2554 * Set the INCOMPLETE flag on an entry in a leaf block.
2559 xfs_attr_leafblock_t *leaf;
2575 leaf = bp->data;
2576 ASSERT(be16_to_cpu(leaf->hdr.info.magic) == XFS_ATTR_LEAF_MAGIC);
2577 ASSERT(args->index < be16_to_cpu(leaf->hdr.count));
2579 entry = &leaf->entries[ args->index ];
2584 XFS_DA_LOGRANGE(leaf, entry, sizeof(*entry)));
2586 name_rmt = XFS_ATTR_LEAF_NAME_REMOTE(leaf, args->index);
2590 XFS_DA_LOGRANGE(leaf, name_rmt, sizeof(*name_rmt)));
2603 * In a single transaction, clear the INCOMPLETE flag on the leaf entry
2604 * given by args->blkno/index and set the INCOMPLETE flag on the leaf
2748 * Invalidate the tree, even if the "tree" is only a single leaf block.
2884 * leaf block.
2891 xfs_attr_leafblock_t *leaf;
2897 leaf = bp->data;
2898 ASSERT(be16_to_cpu(leaf->hdr.info.magic) == XFS_ATTR_LEAF_MAGIC);
2904 entry = &leaf->entries[0];
2905 for (i = 0; i < be16_to_cpu(leaf->hdr.count); entry++, i++) {
2908 name_rmt = XFS_ATTR_LEAF_NAME_REMOTE(leaf, i);
2932 entry = &leaf->entries[0];
2933 for (i = 0; i < be16_to_cpu(leaf->hdr.count); entry++, i++) {
2936 name_rmt = XFS_ATTR_LEAF_NAME_REMOTE(leaf, i);