diff options
author | Jeff Mahoney <jeffm@suse.com> | 2017-05-17 11:38:35 -0400 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2017-06-19 18:25:59 +0200 |
commit | 1b86826d12dc4acf9576cad9c43da74025dc8074 (patch) | |
tree | f641fee8f721be73f3808c796e93e983d132ff9e /fs/btrfs/super.c | |
parent | e03733da5aa68fa2ae3f8d1ab12a570c823a647f (diff) | |
download | linux-stable-1b86826d12dc4acf9576cad9c43da74025dc8074.tar.gz linux-stable-1b86826d12dc4acf9576cad9c43da74025dc8074.tar.bz2 linux-stable-1b86826d12dc4acf9576cad9c43da74025dc8074.zip |
btrfs: cleanup root usage by btrfs_get_alloc_profile
There are two places where we don't already know what kind of alloc
profile we need before calling btrfs_get_alloc_profile, but we need
access to a root everywhere we call it.
This patch adds helpers for btrfs_{data,metadata,system}_alloc_profile()
and relegates btrfs_system_alloc_profile to a static for use in those
two cases. The next patch will eliminate one of those.
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Reviewed-by: Liu Bo <bo.li.liu@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/super.c')
-rw-r--r-- | fs/btrfs/super.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index 4f1cdd5058f1..3371213924bd 100644 --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c @@ -1898,7 +1898,6 @@ static inline void btrfs_descending_sort_devices( static int btrfs_calc_avail_data_space(struct btrfs_fs_info *fs_info, u64 *free_bytes) { - struct btrfs_root *root = fs_info->tree_root; struct btrfs_device_info *devices_info; struct btrfs_fs_devices *fs_devices = fs_info->fs_devices; struct btrfs_device *device; @@ -1932,7 +1931,7 @@ static int btrfs_calc_avail_data_space(struct btrfs_fs_info *fs_info, return -ENOMEM; /* calc min stripe number for data space allocation */ - type = btrfs_get_alloc_profile(root, 1); + type = btrfs_data_alloc_profile(fs_info); if (type & BTRFS_BLOCK_GROUP_RAID0) { min_stripes = 2; num_stripes = nr_devices; |