root_gen, 0, 0, 1);
BUG_ON(ret);
mutex_unlock(&root->fs_info->alloc_mutex);
+
+ atomic_inc(&root->fs_info->throttle_gen);
+ wake_up(&root->fs_info->transaction_throttle);
+
continue;
}
/*
root_owner = btrfs_header_owner(parent);
root_gen = btrfs_header_generation(parent);
-
mutex_lock(&root->fs_info->alloc_mutex);
ret = __btrfs_free_extent(trans, root, bytenr, blocksize,
root_owner, root_gen, 0, 0, 1);
}
}
while(1) {
- atomic_inc(&root->fs_info->throttle_gen);
wret = walk_down_tree(trans, root, path, &level);
if (wret > 0)
break;
ret = -EAGAIN;
break;
}
+ atomic_inc(&root->fs_info->throttle_gen);
wake_up(&root->fs_info->transaction_throttle);
}
for (i = 0; i <= orig_level; i++) {
{
struct btrfs_fs_info *info = root->fs_info;
-harder:
if (atomic_read(&info->throttles)) {
DEFINE_WAIT(wait);
int thr;
- int harder_count = 0;
thr = atomic_read(&info->throttle_gen);
do {
schedule();
finish_wait(&info->transaction_throttle, &wait);
} while (thr == atomic_read(&info->throttle_gen));
-
- if (harder_count < 5 &&
- info->total_ref_cache_size > 1 * 1024 * 1024) {
- harder_count++;
- goto harder;
- }
-
- if (harder_count < 10 &&
- info->total_ref_cache_size > 5 * 1024 * 1024) {
- harder_count++;
- goto harder;
- }
}
}