X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=quick-test.c;h=b1e7999d6546866085cb7fd6c8c79ffffd92a897;hb=877494861d4d02b40c033a58785a43f3ef8a3e6f;hp=5dfb2feb8d9ce889ec2f116f725f31f51fa638e1;hpb=4735d0bb8248a3900f420cb9144e4f7969f0b44d;p=platform%2Fupstream%2Fbtrfs-progs.git diff --git a/quick-test.c b/quick-test.c index 5dfb2fe..b1e7999 100644 --- a/quick-test.c +++ b/quick-test.c @@ -46,8 +46,7 @@ int main(int ac, char **av) { struct btrfs_root *root; struct btrfs_trans_handle *trans; - buf = malloc(512); - memset(buf, 0, 512); + buf = calloc(1, 512); radix_tree_init(); @@ -57,8 +56,9 @@ int main(int ac, char **av) { exit(1); } trans = btrfs_start_transaction(root, 1); + BUG_ON(IS_ERR(trans)); srand(55); - btrfs_set_key_type(&ins, BTRFS_STRING_ITEM_KEY); + ins.type = BTRFS_STRING_ITEM_KEY; for (i = 0; i < run_size; i++) { num = next_key(i, max_key); // num = i; @@ -73,6 +73,7 @@ int main(int ac, char **av) { if (i == run_size - 5) { btrfs_commit_transaction(trans, root); trans = btrfs_start_transaction(root, 1); + BUG_ON(IS_ERR(trans)); } } btrfs_commit_transaction(trans, root); @@ -115,6 +116,7 @@ int main(int ac, char **av) { i = 0; srand(55); trans = btrfs_start_transaction(root, 1); + BUG_ON(IS_ERR(trans)); for (i = 0 ; i < run_size/4; i++) { num = next_key(i, max_key); ins.objectid = num; @@ -139,6 +141,7 @@ int main(int ac, char **av) { exit(1); } trans = btrfs_start_transaction(root, 1); + BUG_ON(IS_ERR(trans)); srand(128); for (i = 0; i < run_size; i++) { num = next_key(i, max_key); @@ -176,6 +179,7 @@ int main(int ac, char **av) { } printf("starting big long delete run\n"); trans = btrfs_start_transaction(root, 1); + BUG_ON(IS_ERR(trans)); while(root->node && btrfs_header_nritems(root->node) > 0) { struct extent_buffer *leaf; int slot;