diff options
author | Chris Mason <chris.mason@oracle.com> | 2007-03-13 10:46:10 -0400 |
---|---|---|
committer | David Woodhouse <dwmw2@hera.kernel.org> | 2007-03-13 10:46:10 -0400 |
commit | 234b63a091e1df6bd4261dd7b3a7490074830628 (patch) | |
tree | 1947f6e49aa3c19017c948205378c5cb76a7b536 /fs/btrfs/quick-test.c | |
parent | cf27e1eec063fa68a89c57ae0a83f93aa38851d6 (diff) |
rename funcs and structs to btrfs
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/quick-test.c')
-rw-r--r-- | fs/btrfs/quick-test.c | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/fs/btrfs/quick-test.c b/fs/btrfs/quick-test.c index ab3bda53a2f6..66bdc57905d7 100644 --- a/fs/btrfs/quick-test.c +++ b/fs/btrfs/quick-test.c | |||
@@ -22,9 +22,9 @@ int main(int ac, char **av) { | |||
22 | int run_size = 100000; | 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 btrfs_path path; |
26 | struct ctree_super_block super; | 26 | struct btrfs_super_block super; |
27 | struct ctree_root *root; | 27 | struct btrfs_root *root; |
28 | 28 | ||
29 | radix_tree_init(); | 29 | radix_tree_init(); |
30 | 30 | ||
@@ -40,12 +40,12 @@ int main(int ac, char **av) { | |||
40 | ins.objectid = num; | 40 | ins.objectid = num; |
41 | ins.offset = 0; | 41 | ins.offset = 0; |
42 | ins.flags = 0; | 42 | ins.flags = 0; |
43 | ret = insert_item(root, &ins, buf, strlen(buf)); | 43 | ret = btrfs_insert_item(root, &ins, buf, strlen(buf)); |
44 | if (!ret) | 44 | if (!ret) |
45 | tree_size++; | 45 | tree_size++; |
46 | free(buf); | 46 | free(buf); |
47 | if (i == run_size - 5) { | 47 | if (i == run_size - 5) { |
48 | commit_transaction(root, &super); | 48 | btrfs_commit_transaction(root, &super); |
49 | } | 49 | } |
50 | 50 | ||
51 | } | 51 | } |
@@ -57,16 +57,16 @@ int main(int ac, char **av) { | |||
57 | for (i = 0; i < run_size; i++) { | 57 | for (i = 0; i < run_size; i++) { |
58 | num = next_key(i, max_key); | 58 | num = next_key(i, max_key); |
59 | ins.objectid = num; | 59 | ins.objectid = num; |
60 | init_path(&path); | 60 | btrfs_init_path(&path); |
61 | if (i % 10000 == 0) | 61 | if (i % 10000 == 0) |
62 | fprintf(stderr, "search %d:%d\n", num, i); | 62 | fprintf(stderr, "search %d:%d\n", num, i); |
63 | ret = search_slot(root, &ins, &path, 0, 0); | 63 | ret = btrfs_search_slot(root, &ins, &path, 0, 0); |
64 | if (ret) { | 64 | if (ret) { |
65 | print_tree(root, root->node); | 65 | btrfs_print_tree(root, root->node); |
66 | printf("unable to find %d\n", num); | 66 | printf("unable to find %d\n", num); |
67 | exit(1); | 67 | exit(1); |
68 | } | 68 | } |
69 | release_path(root, &path); | 69 | btrfs_release_path(root, &path); |
70 | } | 70 | } |
71 | close_ctree(root, &super); | 71 | close_ctree(root, &super); |
72 | root = open_ctree("dbfile", &super); | 72 | root = open_ctree("dbfile", &super); |
@@ -81,17 +81,17 @@ int main(int ac, char **av) { | |||
81 | for (i = 0 ; i < run_size/4; i++) { | 81 | for (i = 0 ; i < run_size/4; i++) { |
82 | num = next_key(i, max_key); | 82 | num = next_key(i, max_key); |
83 | ins.objectid = num; | 83 | ins.objectid = num; |
84 | init_path(&path); | 84 | btrfs_init_path(&path); |
85 | ret = search_slot(root, &ins, &path, -1, 1); | 85 | ret = btrfs_search_slot(root, &ins, &path, -1, 1); |
86 | if (!ret) { | 86 | if (!ret) { |
87 | if (i % 10000 == 0) | 87 | if (i % 10000 == 0) |
88 | fprintf(stderr, "del %d:%d\n", num, i); | 88 | fprintf(stderr, "del %d:%d\n", num, i); |
89 | ret = del_item(root, &path); | 89 | ret = btrfs_del_item(root, &path); |
90 | if (ret != 0) | 90 | if (ret != 0) |
91 | BUG(); | 91 | BUG(); |
92 | tree_size--; | 92 | tree_size--; |
93 | } | 93 | } |
94 | release_path(root, &path); | 94 | btrfs_release_path(root, &path); |
95 | } | 95 | } |
96 | close_ctree(root, &super); | 96 | close_ctree(root, &super); |
97 | root = open_ctree("dbfile", &super); | 97 | root = open_ctree("dbfile", &super); |
@@ -103,7 +103,7 @@ int main(int ac, char **av) { | |||
103 | ins.objectid = num; | 103 | ins.objectid = num; |
104 | if (i % 10000 == 0) | 104 | if (i % 10000 == 0) |
105 | fprintf(stderr, "insert %d:%d\n", num, i); | 105 | fprintf(stderr, "insert %d:%d\n", num, i); |
106 | ret = insert_item(root, &ins, buf, strlen(buf)); | 106 | ret = btrfs_insert_item(root, &ins, buf, strlen(buf)); |
107 | if (!ret) | 107 | if (!ret) |
108 | tree_size++; | 108 | tree_size++; |
109 | free(buf); | 109 | free(buf); |
@@ -115,25 +115,25 @@ int main(int ac, char **av) { | |||
115 | for (i = 0; i < run_size; i++) { | 115 | for (i = 0; i < run_size; i++) { |
116 | num = next_key(i, max_key); | 116 | num = next_key(i, max_key); |
117 | ins.objectid = num; | 117 | ins.objectid = num; |
118 | init_path(&path); | 118 | btrfs_init_path(&path); |
119 | if (i % 10000 == 0) | 119 | if (i % 10000 == 0) |
120 | fprintf(stderr, "search %d:%d\n", num, i); | 120 | fprintf(stderr, "search %d:%d\n", num, i); |
121 | ret = search_slot(root, &ins, &path, 0, 0); | 121 | ret = btrfs_search_slot(root, &ins, &path, 0, 0); |
122 | if (ret) { | 122 | if (ret) { |
123 | print_tree(root, root->node); | 123 | btrfs_print_tree(root, root->node); |
124 | printf("unable to find %d\n", num); | 124 | printf("unable to find %d\n", num); |
125 | exit(1); | 125 | exit(1); |
126 | } | 126 | } |
127 | release_path(root, &path); | 127 | btrfs_release_path(root, &path); |
128 | } | 128 | } |
129 | printf("starting big long delete run\n"); | 129 | printf("starting big long delete run\n"); |
130 | while(root->node && | 130 | while(root->node && |
131 | btrfs_header_nritems(&root->node->node.header) > 0) { | 131 | btrfs_header_nritems(&root->node->node.header) > 0) { |
132 | struct leaf *leaf; | 132 | struct btrfs_leaf *leaf; |
133 | int slot; | 133 | int slot; |
134 | ins.objectid = (u64)-1; | 134 | ins.objectid = (u64)-1; |
135 | init_path(&path); | 135 | btrfs_init_path(&path); |
136 | ret = search_slot(root, &ins, &path, -1, 1); | 136 | ret = btrfs_search_slot(root, &ins, &path, -1, 1); |
137 | if (ret == 0) | 137 | if (ret == 0) |
138 | BUG(); | 138 | BUG(); |
139 | 139 | ||
@@ -149,26 +149,26 @@ int main(int ac, char **av) { | |||
149 | btrfs_disk_key_to_cpu(&last, &leaf->items[slot].key); | 149 | btrfs_disk_key_to_cpu(&last, &leaf->items[slot].key); |
150 | if (tree_size % 10000 == 0) | 150 | if (tree_size % 10000 == 0) |
151 | printf("big del %d:%d\n", tree_size, i); | 151 | printf("big del %d:%d\n", tree_size, i); |
152 | ret = del_item(root, &path); | 152 | ret = btrfs_del_item(root, &path); |
153 | if (ret != 0) { | 153 | if (ret != 0) { |
154 | printf("del_item returned %d\n", ret); | 154 | printf("del_item returned %d\n", ret); |
155 | BUG(); | 155 | BUG(); |
156 | } | 156 | } |
157 | tree_size--; | 157 | tree_size--; |
158 | } | 158 | } |
159 | release_path(root, &path); | 159 | btrfs_release_path(root, &path); |
160 | } | 160 | } |
161 | /* | 161 | /* |
162 | printf("previous tree:\n"); | 162 | printf("previous tree:\n"); |
163 | print_tree(root, root->commit_root); | 163 | btrfs_print_tree(root, root->commit_root); |
164 | printf("map before commit\n"); | 164 | printf("map before commit\n"); |
165 | print_tree(root->extent_root, root->extent_root->node); | 165 | btrfs_print_tree(root->extent_root, root->extent_root->node); |
166 | */ | 166 | */ |
167 | commit_transaction(root, &super); | 167 | btrfs_commit_transaction(root, &super); |
168 | printf("tree size is now %d\n", tree_size); | 168 | printf("tree size is now %d\n", tree_size); |
169 | printf("root %p commit root %p\n", root->node, root->commit_root); | 169 | printf("root %p commit root %p\n", root->node, root->commit_root); |
170 | printf("map tree\n"); | 170 | printf("map tree\n"); |
171 | print_tree(root->extent_root, root->extent_root->node); | 171 | btrfs_print_tree(root->extent_root, root->extent_root->node); |
172 | close_ctree(root, &super); | 172 | close_ctree(root, &super); |
173 | return 0; | 173 | return 0; |
174 | } | 174 | } |