aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/relocation.c
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.cz>2013-03-12 11:13:28 -0400
committerJosef Bacik <jbacik@fusionio.com>2013-05-06 15:54:21 -0400
commit9d1a2a3ad59f7ae810bf04a5a05995bf2d79300c (patch)
tree1648c620a5264275004bd09c207292697b450367 /fs/btrfs/relocation.c
parent6841ebee6b02abe178abd30f40806e385cd96777 (diff)
btrfs: clean snapshots one by one
Each time pick one dead root from the list and let the caller know if it's needed to continue. This should improve responsiveness during umount and balance which at some point waits for cleaning all currently queued dead roots. A new dead root is added to the end of the list, so the snapshots disappear in the order of deletion. The snapshot cleaning work is now done only from the cleaner thread and the others wake it if needed. Signed-off-by: David Sterba <dsterba@suse.cz> Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Diffstat (limited to 'fs/btrfs/relocation.c')
-rw-r--r--fs/btrfs/relocation.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c
index 86f192ffc212..4ef5f7455fb3 100644
--- a/fs/btrfs/relocation.c
+++ b/fs/btrfs/relocation.c
@@ -4148,10 +4148,7 @@ int btrfs_relocate_block_group(struct btrfs_root *extent_root, u64 group_start)
4148 4148
4149 while (1) { 4149 while (1) {
4150 mutex_lock(&fs_info->cleaner_mutex); 4150 mutex_lock(&fs_info->cleaner_mutex);
4151
4152 btrfs_clean_old_snapshots(fs_info->tree_root);
4153 ret = relocate_block_group(rc); 4151 ret = relocate_block_group(rc);
4154
4155 mutex_unlock(&fs_info->cleaner_mutex); 4152 mutex_unlock(&fs_info->cleaner_mutex);
4156 if (ret < 0) { 4153 if (ret < 0) {
4157 err = ret; 4154 err = ret;