X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=quick-test.c;h=5da47c322bcc90ca410ed010182972eb59616ae4;hb=e875cd98e38f9fdc7f812a7575a3a2afd6b6094b;hp=ffde85d9a8ce0c74215b1d08b4cf023286fd4797;hpb=c47a831cd653fa4ef4979ae7007e60037eddcb37;p=platform%2Fupstream%2Fbtrfs-progs.git diff --git a/quick-test.c b/quick-test.c index ffde85d..5da47c3 100644 --- a/quick-test.c +++ b/quick-test.c @@ -56,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; @@ -72,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); @@ -108,12 +110,13 @@ int main(int ac, char **av) { printf("node %p level %d total ptrs %d free spc %lu\n", root->node, btrfs_header_level(root->node), btrfs_header_nritems(root->node), - (unsigned long)BTRFS_NODEPTRS_PER_BLOCK(root) - + (unsigned long)BTRFS_NODEPTRS_PER_BLOCK(root->fs_info) - btrfs_header_nritems(root->node)); printf("all searches good, deleting some items\n"); 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; @@ -138,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); @@ -175,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;