btrfs: use rounddown in decide_stripe_size
PATCH 1/1 btrfs: use rounddown in decide_stripe_size
Signed-off-by Nikolay Borisov <[email protected]>
---
Dave, please fold this into c1ac11142016 ("btrfs: factor out decide_stripe_size()")
fs/btrfs/volumes.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
fs/btrfs/volumes.c +1 -5
@@ -4994,11 +4994,7 @@ static int decide_stripe_size(struct btrfs_fs_devices *fs_devices, {struct btrfs_fs_info *info = fs_devices->fs_info; -/* -* Round down to number of usable stripes, devs_increment can be any -* number so we can't use round_down() -*/ - ctl->ndevs -= ctl->ndevs % ctl->devs_increment; + ctl->ndevs =rounddown (ctl->ndevs, ctl->devs_increment);if (ctl->ndevs < ctl->devs_min) {if (btrfs_test_opt (info,ENOSPC_DEBUG )) {
--
2.17.1
Quoted 1 line · Nikolay Borisov
Signed-off-by Nikolay Borisov <[email protected]>
Reviewed-by Qu Wenruo <[email protected]>
Thanks,
Qu
Quoted 27 lines
---
Dave, please fold this into
c1ac11142016("btrfs: factor outdecide_stripe_size()")fs/btrfs/volumes.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)fs/btrfs/volumes.c +1
-6@@ -4994,11 +4994,7 @@ static int decide_stripe_size(struct btrfs_fs_devices *fs_devices, {struct btrfs_fs_info *info = fs_devices->fs_info; -/* -* Round down to number of usable stripes, devs_increment can be any -* number so we can't use round_down() -*/ - ctl->ndevs -= ctl->ndevs % ctl->devs_increment; + ctl->ndevs =rounddown (ctl->ndevs, ctl->devs_increment);if (ctl->ndevs < ctl->devs_min) {if (btrfs_test_opt (info,ENOSPC_DEBUG )) { --2.17.1
Quoted 4 lines · Nikolay Borisov
Signed-off-by Nikolay Borisov <[email protected]>---
Dave, please fold this into
c1ac11142016("btrfs: factor outdecide_stripe_size()")
Will do, though I'll keep the comment given how confusing the rounddown and round_down things are.