All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nikolay Borisov <nborisov@suse.com>
To: dsterba@suse.cz
Cc: linux-btrfs@vger.kernel.org, Nikolay Borisov <nborisov@suse.com>
Subject: [PATCH] btrfs: use rounddown in decide_stripe_size
Date: Mon,  2 Mar 2020 12:46:51 +0200	[thread overview]
Message-ID: <20200302104651.1703-1-nborisov@suse.com> (raw)

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(-)

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


             reply	other threads:[~2020-03-02 10:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-02 10:46 Nikolay Borisov [this message]
2020-03-02 10:48 ` [PATCH] btrfs: use rounddown in decide_stripe_size Qu Wenruo
2020-03-02 20:30 ` David Sterba

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200302104651.1703-1-nborisov@suse.com \
    --to=nborisov@suse.com \
    --cc=dsterba@suse.cz \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.