Btrfs: add a name_len to dir items, reorder key
[linux-2.6-block.git] / fs / btrfs / dir-test.c
index b482b8f49f8ab79cb6078ddd455360a7c2d439e4..f73aa7623398b873977b459d609a57e66d9d1468 100644 (file)
@@ -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';