diff options
Diffstat (limited to 'fs/btrfs/quick-test.c')
-rw-r--r-- | fs/btrfs/quick-test.c | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/fs/btrfs/quick-test.c b/fs/btrfs/quick-test.c index 8255f79ceca5..6400c7100a6a 100644 --- a/fs/btrfs/quick-test.c +++ b/fs/btrfs/quick-test.c | |||
@@ -19,7 +19,7 @@ int main(int ac, char **av) { | |||
19 | int i; | 19 | int i; |
20 | int num; | 20 | int num; |
21 | int ret; | 21 | int ret; |
22 | int run_size = 1024; | 22 | int run_size = 100000; |
23 | int max_key = 100000000; | 23 | int max_key = 100000000; |
24 | int tree_size = 0; | 24 | int tree_size = 0; |
25 | struct ctree_path path; | 25 | struct ctree_path path; |
@@ -44,9 +44,9 @@ int main(int ac, char **av) { | |||
44 | if (!ret) | 44 | if (!ret) |
45 | tree_size++; | 45 | tree_size++; |
46 | free(buf); | 46 | free(buf); |
47 | |||
47 | } | 48 | } |
48 | write_ctree_super(root, &super); | 49 | close_ctree(root, &super); |
49 | close_ctree(root); | ||
50 | 50 | ||
51 | root = open_ctree("dbfile", &super); | 51 | root = open_ctree("dbfile", &super); |
52 | printf("starting search\n"); | 52 | printf("starting search\n"); |
@@ -65,8 +65,7 @@ int main(int ac, char **av) { | |||
65 | } | 65 | } |
66 | release_path(root, &path); | 66 | release_path(root, &path); |
67 | } | 67 | } |
68 | write_ctree_super(root, &super); | 68 | close_ctree(root, &super); |
69 | close_ctree(root); | ||
70 | root = open_ctree("dbfile", &super); | 69 | root = open_ctree("dbfile", &super); |
71 | printf("node %p level %d total ptrs %d free spc %lu\n", root->node, | 70 | printf("node %p level %d total ptrs %d free spc %lu\n", root->node, |
72 | node_level(root->node->node.header.flags), | 71 | node_level(root->node->node.header.flags), |
@@ -90,8 +89,7 @@ int main(int ac, char **av) { | |||
90 | } | 89 | } |
91 | release_path(root, &path); | 90 | release_path(root, &path); |
92 | } | 91 | } |
93 | write_ctree_super(root, &super); | 92 | close_ctree(root, &super); |
94 | close_ctree(root); | ||
95 | root = open_ctree("dbfile", &super); | 93 | root = open_ctree("dbfile", &super); |
96 | srand(128); | 94 | srand(128); |
97 | for (i = 0; i < run_size; i++) { | 95 | for (i = 0; i < run_size; i++) { |
@@ -106,8 +104,7 @@ int main(int ac, char **av) { | |||
106 | tree_size++; | 104 | tree_size++; |
107 | free(buf); | 105 | free(buf); |
108 | } | 106 | } |
109 | write_ctree_super(root, &super); | 107 | close_ctree(root, &super); |
110 | close_ctree(root); | ||
111 | root = open_ctree("dbfile", &super); | 108 | root = open_ctree("dbfile", &super); |
112 | srand(128); | 109 | srand(128); |
113 | printf("starting search2\n"); | 110 | printf("starting search2\n"); |
@@ -156,10 +153,17 @@ int main(int ac, char **av) { | |||
156 | } | 153 | } |
157 | release_path(root, &path); | 154 | release_path(root, &path); |
158 | } | 155 | } |
156 | /* | ||
157 | printf("previous tree:\n"); | ||
158 | print_tree(root, root->commit_root); | ||
159 | printf("map before commit\n"); | ||
160 | print_tree(root->extent_root, root->extent_root->node); | ||
161 | */ | ||
162 | commit_transaction(root, &super); | ||
159 | printf("tree size is now %d\n", tree_size); | 163 | printf("tree size is now %d\n", tree_size); |
164 | printf("root %p commit root %p\n", root->node, root->commit_root); | ||
160 | printf("map tree\n"); | 165 | printf("map tree\n"); |
161 | print_tree(root->extent_root, root->extent_root->node); | 166 | print_tree(root->extent_root, root->extent_root->node); |
162 | write_ctree_super(root, &super); | 167 | close_ctree(root, &super); |
163 | close_ctree(root); | ||
164 | return 0; | 168 | return 0; |
165 | } | 169 | } |