Message ID | 20200302104651.1703-1-nborisov@suse.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | btrfs: use rounddown in decide_stripe_size | expand |
On 2020/3/2 下午6:46, Nikolay Borisov wrote: > Signed-off-by: Nikolay Borisov <nborisov@suse.com> Reviewed-by: Qu Wenruo <wqu@suse.com> Thanks, Qu > --- > > Dave, please fold this into c1ac11142016 ("btrfs: factor out decide_stripe_size()") > > fs/btrfs/volumes.c | 6 +----- > 1 file changed, 1 insertion(+), 5 deletions(-) > > diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c > index 267847c72c22..111c1270f800 100644 > --- a/fs/btrfs/volumes.c > +++ b/fs/btrfs/volumes.c > @@ -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 >
On Mon, Mar 02, 2020 at 12:46:51PM +0200, Nikolay Borisov wrote: > Signed-off-by: Nikolay Borisov <nborisov@suse.com> > --- > > Dave, please fold this into c1ac11142016 ("btrfs: factor out decide_stripe_size()") Will do, though I'll keep the comment given how confusing the rounddown and round_down things are.
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 267847c72c22..111c1270f800 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -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)) {
Signed-off-by: Nikolay Borisov <nborisov@suse.com> --- Dave, please fold this into c1ac11142016 ("btrfs: factor out decide_stripe_size()") fs/btrfs/volumes.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) -- 2.17.1