forked from Mirrors/btrfs-progs
btrfs-progs: Refactor parameter of BTRFS_MAX_DEVS() from root to fs_info
Signed-off-by: Qu Wenruo <wqu@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>master
parent
9615c23d15
commit
e9097ad593
|
@ -826,7 +826,7 @@ error:
|
||||||
return ret;
|
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_item) \
|
||||||
- sizeof(struct btrfs_chunk)) \
|
- sizeof(struct btrfs_chunk)) \
|
||||||
/ sizeof(struct btrfs_stripe) + 1)
|
/ sizeof(struct btrfs_stripe) + 1)
|
||||||
|
@ -882,12 +882,12 @@ int btrfs_alloc_chunk(struct btrfs_trans_handle *trans,
|
||||||
calc_size = SZ_1G;
|
calc_size = SZ_1G;
|
||||||
max_chunk_size = 10 * calc_size;
|
max_chunk_size = 10 * calc_size;
|
||||||
min_stripe_size = SZ_64M;
|
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) {
|
} else if (type & BTRFS_BLOCK_GROUP_METADATA) {
|
||||||
calc_size = SZ_1G;
|
calc_size = SZ_1G;
|
||||||
max_chunk_size = 4 * calc_size;
|
max_chunk_size = 4 * calc_size;
|
||||||
min_stripe_size = SZ_32M;
|
min_stripe_size = SZ_32M;
|
||||||
max_stripes = BTRFS_MAX_DEVS(chunk_root);
|
max_stripes = BTRFS_MAX_DEVS(info);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (type & BTRFS_BLOCK_GROUP_RAID1) {
|
if (type & BTRFS_BLOCK_GROUP_RAID1) {
|
||||||
|
|
Loading…
Reference in New Issue