Signed-off-by: Chris Mason <chris.mason@oracle.com>
#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)
list_del_init(&b->cache);
tree_block_release(root, b);
if (root->cache_size < cache_max)
- return 0;
+ break;
}
}
return 0;
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;
}