From 713851ed942d22921b57630109e51cc938d72aaf Mon Sep 17 00:00:00 2001 From: Chris Mason Date: Fri, 2 Mar 2007 10:06:43 -0500 Subject: [PATCH] --- yaml --- r: 128260 b: refs/heads/master c: 77ce6846c40e83193df01295e5af437f8b6c7a2d h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/fs/btrfs/disk-io.c | 3 +-- trunk/fs/btrfs/random-test.c | 14 +++++++++++--- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/[refs] b/[refs] index f717b17ba195..201965626f2c 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: f0930a37f1c096c3a8f6a17b1e251c7fdf4d4457 +refs/heads/master: 77ce6846c40e83193df01295e5af437f8b6c7a2d diff --git a/trunk/fs/btrfs/disk-io.c b/trunk/fs/btrfs/disk-io.c index f7ca5362291e..b1a8149bbc84 100644 --- a/trunk/fs/btrfs/disk-io.c +++ b/trunk/fs/btrfs/disk-io.c @@ -11,7 +11,6 @@ #include "disk-io.h" static int allocated_blocks = 0; -int cache_size = 0; int cache_max = 10000; 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) list_del_init(&b->cache); tree_block_release(root, b); if (root->cache_size < cache_max) - return 0; + break; } } return 0; diff --git a/trunk/fs/btrfs/random-test.c b/trunk/fs/btrfs/random-test.c index 22955753c3a7..53245c5039dc 100644 --- a/trunk/fs/btrfs/random-test.c +++ b/trunk/fs/btrfs/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; }