diff options
author | Chris Mason <chris.mason@oracle.com> | 2007-03-02 10:06:43 -0500 |
---|---|---|
committer | David Woodhouse <dwmw2@hera.kernel.org> | 2007-03-02 10:06:43 -0500 |
commit | 77ce6846c40e83193df01295e5af437f8b6c7a2d (patch) | |
tree | 53aa4e00bb209bc283deb9d7d1d350e60481b5de /fs | |
parent | f0930a37f1c096c3a8f6a17b1e251c7fdf4d4457 (diff) |
Btrfs: period commit during initial fill in the random tester
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/btrfs/disk-io.c | 3 | ||||
-rw-r--r-- | fs/btrfs/random-test.c | 14 |
2 files changed, 12 insertions, 5 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index f7ca5362291e..b1a8149bbc84 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c | |||
@@ -11,7 +11,6 @@ | |||
11 | #include "disk-io.h" | 11 | #include "disk-io.h" |
12 | 12 | ||
13 | static int allocated_blocks = 0; | 13 | static int allocated_blocks = 0; |
14 | int cache_size = 0; | ||
15 | int cache_max = 10000; | 14 | int cache_max = 10000; |
16 | 15 | ||
17 | static int check_tree_block(struct ctree_root *root, struct tree_buffer *buf) | 16 | static int check_tree_block(struct ctree_root *root, struct tree_buffer *buf) |
@@ -36,7 +35,7 @@ static int free_some_buffers(struct ctree_root *root) | |||
36 | list_del_init(&b->cache); | 35 | list_del_init(&b->cache); |
37 | tree_block_release(root, b); | 36 | tree_block_release(root, b); |
38 | if (root->cache_size < cache_max) | 37 | if (root->cache_size < cache_max) |
39 | return 0; | 38 | break; |
40 | } | 39 | } |
41 | } | 40 | } |
42 | return 0; | 41 | return 0; |
diff --git a/fs/btrfs/random-test.c b/fs/btrfs/random-test.c index 22955753c3a7..53245c5039dc 100644 --- a/fs/btrfs/random-test.c +++ b/fs/btrfs/random-test.c | |||
@@ -202,15 +202,23 @@ static int fill_tree(struct ctree_root *root, struct radix_tree_root *radix, | |||
202 | int count) | 202 | int count) |
203 | { | 203 | { |
204 | int i; | 204 | int i; |
205 | int err; | ||
206 | int ret = 0; | 205 | int ret = 0; |
207 | for (i = 0; i < count; i++) { | 206 | for (i = 0; i < count; i++) { |
208 | ret = ins_one(root, radix); | 207 | ret = ins_one(root, radix); |
209 | if (ret) { | 208 | if (ret) { |
210 | printf("fill failed\n"); | 209 | fprintf(stderr, "fill failed\n"); |
211 | err = ret; | ||
212 | goto out; | 210 | goto out; |
213 | } | 211 | } |
212 | if (i % 1000 == 0) { | ||
213 | ret = commit_transaction(root); | ||
214 | if (ret) { | ||
215 | fprintf(stderr, "fill commit failed\n"); | ||
216 | return ret; | ||
217 | } | ||
218 | } | ||
219 | if (i % 10000 == 0) { | ||
220 | printf("bigfill %d\n", i); | ||
221 | } | ||
214 | if (!keep_running) | 222 | if (!keep_running) |
215 | break; | 223 | break; |
216 | } | 224 | } |