btrfs-progs: Use more loose open ctree flags for dump-tree and restore
[platform/upstream/btrfs-progs.git] / random-test.c
index b7c6cdb..d5f830a 100644 (file)
@@ -37,7 +37,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->type = BTRFS_STRING_ITEM_KEY;
        key->offset = 0;
 again:
        ret = radix_tree_gang_lookup(root, (void **)res, num, 2);
@@ -184,7 +184,7 @@ static int empty_tree(struct btrfs_trans_handle *trans, struct btrfs_root
 
        key.offset = 0;
        key.flags = 0;
-       btrfs_set_key_type(&key, BTRFS_STRING_ITEM_KEY);
+       key.type = BTRFS_STRING_ITEM_KEY;
        key.objectid = (unsigned long)-1;
        while(nr-- >= 0) {
                btrfs_init_path(&path);
@@ -288,7 +288,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.type = BTRFS_STRING_ITEM_KEY;
        key.objectid = (unsigned long)-1;
        while(1) {
                btrfs_init_path(&path);
@@ -380,6 +380,7 @@ int main(int ac, char **av)
        }
        printf("initial fill\n");
        trans = btrfs_start_transaction(root, 1);
+       BUG_ON(IS_ERR(trans));
        ret = fill_tree(trans, root, &radix, init_fill_count);
        printf("starting run\n");
        if (ret) {