aboutsummaryrefslogtreecommitdiffstats
path: root/random-test.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2007-03-02 10:06:43 -0500
committerDavid Woodhouse <dwmw2@hera.kernel.org>2007-03-02 10:06:43 -0500
commitbd530a2cff3945b4f79f591f936315b9f6d2929f (patch)
treec422682b2f1a79e91733903e3a6c32e975552309 /random-test.c
parent11bc1cd2a565ab90f16dba2da40cba5e30128783 (diff)
downloadbtrfs-progs-bd530a2cff3945b4f79f591f936315b9f6d2929f.tar.gz
btrfs-progs-bd530a2cff3945b4f79f591f936315b9f6d2929f.tar.xz
btrfs-progs-bd530a2cff3945b4f79f591f936315b9f6d2929f.zip
period commit during initial fill in the random tester
Diffstat (limited to 'random-test.c')
-rw-r--r--random-test.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/random-test.c b/random-test.c
index 2295575..53245c5 100644
--- a/random-test.c
+++ b/random-test.c
@@ -202,15 +202,23 @@ static int fill_tree(struct ctree_root *root, struct radix_tree_root *radix,
int count)
{
int i;
- int err;
int ret = 0;
for (i = 0; i < count; i++) {
ret = ins_one(root, radix);
if (ret) {
- printf("fill failed\n");
- err = ret;
+ fprintf(stderr, "fill failed\n");
goto out;
}
+ if (i % 1000 == 0) {
+ ret = commit_transaction(root);
+ if (ret) {
+ fprintf(stderr, "fill commit failed\n");
+ return ret;
+ }
+ }
+ if (i % 10000 == 0) {
+ printf("bigfill %d\n", i);
+ }
if (!keep_running)
break;
}