summaryrefslogtreecommitdiff
path: root/dir-test.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2007-03-16 08:46:49 -0400
committerDavid Woodhouse <dwmw2@hera.kernel.org>2007-03-16 08:46:49 -0400
commit80fabe2ee05261505fbf39603e910d6d2f28d400 (patch)
treeb05aaf3e360d93a1cabf0a9984a5bae655f56673 /dir-test.c
parentda085a5803bb0cbeedbd75e773e7ba464896ff50 (diff)
add a name_len to dir items, reorder key
Diffstat (limited to 'dir-test.c')
-rw-r--r--dir-test.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/dir-test.c b/dir-test.c
index b482b8f4..f73aa762 100644
--- a/dir-test.c
+++ b/dir-test.c
@@ -81,8 +81,7 @@ error:
di = btrfs_item_ptr(&path.nodes[0]->leaf, path.slots[0],
struct btrfs_dir_item);
found = (char *)(di + 1);
- found_len = btrfs_dir_name_len(path.nodes[0]->leaf.items +
- path.slots[0]);
+ found_len = btrfs_dir_name_len(di);
btrfs_name_hash(buf, strlen(buf), &myhash);
btrfs_name_hash(found, found_len, &foundhash);
if (myhash != foundhash)
@@ -227,8 +226,7 @@ static int empty_tree(struct btrfs_root *root, struct radix_tree_root *radix,
slot = path.slots[0];
di = btrfs_item_ptr(&path.nodes[0]->leaf, slot,
struct btrfs_dir_item);
- found_len = btrfs_dir_name_len(path.nodes[0]->leaf.items +
- slot);
+ found_len = btrfs_dir_name_len(di);
memcpy(buf, (char *)(di + 1), found_len);
BUG_ON(found_len > 128);
buf[found_len] = '\0';