aboutsummaryrefslogtreecommitdiffstats
path: root/random-test.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2007-03-15 12:56:47 -0400
committerDavid Woodhouse <dwmw2@hera.kernel.org>2007-03-15 12:56:47 -0400
commitda99898c78a5c580ef1cb54fdcbd66cb7d48d429 (patch)
tree900b308ad2abe7abbb13030ff2272c71b849916d /random-test.c
parentc8afca944b9cf606924adf5c0efaef4132f9d8cd (diff)
downloadbtrfs-progs-da99898c78a5c580ef1cb54fdcbd66cb7d48d429.tar.gz
btrfs-progs-da99898c78a5c580ef1cb54fdcbd66cb7d48d429.tar.xz
btrfs-progs-da99898c78a5c580ef1cb54fdcbd66cb7d48d429.zip
Use a chunk of the key flags to record the item type.
Add (untested and simple) directory item code Fix comp_keys to use the new key ordering Add btrfs_insert_empty_item
Diffstat (limited to 'random-test.c')
-rw-r--r--random-test.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/random-test.c b/random-test.c
index a8ef047..f05135f 100644
--- a/random-test.c
+++ b/random-test.c
@@ -18,6 +18,7 @@ static int setup_key(struct radix_tree_root *root, struct btrfs_key *key,
int ret;
key->flags = 0;
+ btrfs_set_key_type(key, BTRFS_STRING_ITEM_KEY);
key->offset = 0;
again:
ret = radix_tree_gang_lookup(root, (void **)res, num, 2);
@@ -157,6 +158,7 @@ static int empty_tree(struct btrfs_root *root, struct radix_tree_root *radix,
key.offset = 0;
key.flags = 0;
+ btrfs_set_key_type(&key, BTRFS_STRING_ITEM_KEY);
key.objectid = (unsigned long)-1;
while(nr-- >= 0) {
btrfs_init_path(&path);
@@ -173,7 +175,8 @@ static int empty_tree(struct btrfs_root *root, struct radix_tree_root *radix,
path.slots[0] -= 1;
}
slot = path.slots[0];
- found=btrfs_key_objectid(&path.nodes[0]->leaf.items[slot].key);
+ found = btrfs_disk_key_objectid(
+ &path.nodes[0]->leaf.items[slot].key);
ret = btrfs_del_item(root, &path);
count++;
if (ret) {
@@ -257,6 +260,7 @@ static int fill_radix(struct btrfs_root *root, struct radix_tree_root *radix)
key.offset = 0;
key.flags = 0;
+ btrfs_set_key_type(&key, BTRFS_STRING_ITEM_KEY);
key.objectid = (unsigned long)-1;
while(1) {
btrfs_init_path(&path);
@@ -274,8 +278,8 @@ static int fill_radix(struct btrfs_root *root, struct radix_tree_root *radix)
slot -= 1;
}
for (i = slot; i >= 0; i--) {
- found = btrfs_key_objectid(&path.nodes[0]->
- leaf.items[i].key);
+ found = btrfs_disk_key_objectid(&path.nodes[0]->
+ leaf.items[i].key);
radix_tree_preload(GFP_KERNEL);
ret = radix_tree_insert(radix, found, (void *)found);
if (ret) {