btrfs: Use fs_info directly in btrfs_delete_unused_bgs
authorZhao Lei <zhaolei@cn.fujitsu.com>
Thu, 8 Oct 2015 10:46:44 +0000 (18:46 +0800)
committerChris Mason <clm@fb.com>
Wed, 11 Nov 2015 03:27:24 +0000 (19:27 -0800)
No need to use root->fs_info in btrfs_delete_unused_bgs(),
use fs_info directly instead.

Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
Signed-off-by: Chris Mason <clm@fb.com>
fs/btrfs/extent-tree.c

index b77ffbc3a145af8b1b6ee8353ab248686484bd40..acf3ed11cfb60e95b685aeb009e4d72fbdba3c3b 100644 (file)
@@ -10289,7 +10289,7 @@ void btrfs_delete_unused_bgs(struct btrfs_fs_info *fs_info)
                }
                spin_unlock(&fs_info->unused_bgs_lock);
 
-               mutex_lock(&root->fs_info->delete_unused_bgs_mutex);
+               mutex_lock(&fs_info->delete_unused_bgs_mutex);
 
                /* Don't want to race with allocators so take the groups_sem */
                down_write(&space_info->groups_sem);
@@ -10413,7 +10413,7 @@ void btrfs_delete_unused_bgs(struct btrfs_fs_info *fs_info)
 end_trans:
                btrfs_end_transaction(trans, root);
 next:
-               mutex_unlock(&root->fs_info->delete_unused_bgs_mutex);
+               mutex_unlock(&fs_info->delete_unused_bgs_mutex);
                btrfs_put_block_group(block_group);
                spin_lock(&fs_info->unused_bgs_lock);
        }