[PATCH v3 1/9] btrfs-progs: Refactor parameter of BTRFS_MAX_DEVS() from root to fs_info
From: Qu Wenruo <hidden>
Date: 2018-02-22 06:47:44
Subsystem:
the rest · Maintainer:
Linus Torvalds
From: Qu Wenruo <hidden>
Date: 2018-02-22 06:47:44
Subsystem:
the rest · Maintainer:
Linus Torvalds
Signed-off-by: Qu Wenruo <redacted> --- volumes.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/volumes.c b/volumes.c
index edad367b593c..677d085de96c 100644
--- a/volumes.c
+++ b/volumes.c@@ -826,7 +826,7 @@ error: return ret; } -#define BTRFS_MAX_DEVS(r) ((BTRFS_LEAF_DATA_SIZE(r->fs_info) \ +#define BTRFS_MAX_DEVS(info) ((BTRFS_LEAF_DATA_SIZE(info) \ - sizeof(struct btrfs_item) \ - sizeof(struct btrfs_chunk)) \ / sizeof(struct btrfs_stripe) + 1)
@@ -882,12 +882,12 @@ int btrfs_alloc_chunk(struct btrfs_trans_handle *trans, calc_size = SZ_1G; max_chunk_size = 10 * calc_size; min_stripe_size = SZ_64M; - max_stripes = BTRFS_MAX_DEVS(chunk_root); + max_stripes = BTRFS_MAX_DEVS(info); } else if (type & BTRFS_BLOCK_GROUP_METADATA) { calc_size = SZ_1G; max_chunk_size = 4 * calc_size; min_stripe_size = SZ_32M; - max_stripes = BTRFS_MAX_DEVS(chunk_root); + max_stripes = BTRFS_MAX_DEVS(info); } } if (type & BTRFS_BLOCK_GROUP_RAID1) {
--
2.16.2