All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Thumshirn <johannes.thumshirn@wdc.com>
To: David Sterba <dsterba@suse.cz>
Cc: linux-btrfs@vger.kernel.org,
	Johannes Thumshirn <johannes.thumshirn@wdc.com>
Subject: [PATCH 15/15] btrfs-progs: consolidate num_stripes setting for striping RAID levels
Date: Wed, 10 Jun 2020 21:32:58 +0900	[thread overview]
Message-ID: <20200610123258.12382-16-johannes.thumshirn@wdc.com> (raw)
In-Reply-To: <20200610123258.12382-1-johannes.thumshirn@wdc.com>

All striping RAID Levels use the same method to set the number of RAID
stripes, so consolidate it.

Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
---
 volumes.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/volumes.c b/volumes.c
index ec31acd57aa7..7c57d6cb376e 100644
--- a/volumes.c
+++ b/volumes.c
@@ -1077,17 +1077,12 @@ static void init_alloc_chunk_ctl(struct btrfs_fs_info *info,
 		ctl->num_stripes = min(ctl->min_stripes, ctl->total_devs);
 		break;
 	case BTRFS_RAID_RAID0:
-		ctl->num_stripes = min(ctl->max_stripes, ctl->total_devs);
-		break;
 	case BTRFS_RAID_RAID10:
-		ctl->num_stripes = min(ctl->max_stripes, ctl->total_devs);
-		ctl->num_stripes &= ~(u32)1;
-		break;
 	case BTRFS_RAID_RAID5:
-		ctl->num_stripes = min(ctl->max_stripes, ctl->total_devs);
-		break;
 	case BTRFS_RAID_RAID6:
 		ctl->num_stripes = min(ctl->max_stripes, ctl->total_devs);
+		if (type == BTRFS_RAID_RAID10)
+			ctl->num_stripes &= ~(u32)1;
 		break;
 	default:
 		break;
-- 
2.26.2


  parent reply	other threads:[~2020-06-10 12:33 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-10 12:32 [PATCH 00/15] btrfs-progs: simplify chunk allocation a bit Johannes Thumshirn
2020-06-10 12:32 ` [PATCH 01/15] btrfs-progs: simplify minimal stripe number checking Johannes Thumshirn
2020-06-23  5:58   ` Qu Wenruo
2020-06-10 12:32 ` [PATCH 02/15] btrfs-progs: simplify assignment of number of RAID stripes Johannes Thumshirn
2020-06-10 12:32 ` [PATCH 03/15] btrfs-progs: introduce alloc_chunk_ctl structure Johannes Thumshirn
2020-06-10 12:32 ` [PATCH 04/15] btrfs-progs: cache number of devices for chunk allocation Johannes Thumshirn
2020-06-10 12:32 ` [PATCH 05/15] btrfs-progs: pass alloc_chunk_ctl to chunk_bytes_by_type Johannes Thumshirn
2020-06-10 12:32 ` [PATCH 06/15] btrfs-progs: introduce raid profile table for chunk allocation Johannes Thumshirn
2020-06-11 13:39   ` David Sterba
2020-06-12  7:44     ` Johannes Thumshirn
2020-06-10 12:32 ` [PATCH 07/15] btrfs-progs: consolidate assignment of minimal stripe number Johannes Thumshirn
2020-06-10 12:32 ` [PATCH 08/15] btrfs-progs: consolidate assignment of sub_stripes Johannes Thumshirn
2020-06-10 12:32 ` [PATCH 09/15] btrfs-progs: consolidate setting of RAID1 stripes Johannes Thumshirn
2020-06-10 12:32 ` [PATCH 10/15] btrfs-progs: do table lookup for simple RAID profiles' num_stripes Johannes Thumshirn
2020-06-10 12:32 ` [PATCH 11/15] btrfs-progs: consolidate num_stripes sanity check Johannes Thumshirn
2020-06-10 12:32 ` [PATCH 12/15] btrfs-progs: compactify num_stripe setting in btrfs_alloc_chunk Johannes Thumshirn
2020-06-10 12:32 ` [PATCH 13/15] btrfs-progs: introduce init_alloc_chunk_ctl Johannes Thumshirn
2020-06-23  6:02   ` Qu Wenruo
2020-06-10 12:32 ` [PATCH 14/15] btrfs-progs: don't pretend RAID56 has a different stripe length Johannes Thumshirn
2020-06-10 12:32 ` Johannes Thumshirn [this message]
2020-06-11 13:44 ` [PATCH 00/15] btrfs-progs: simplify chunk allocation a bit David Sterba
2020-06-23  6:33 ` Qu Wenruo
2020-06-23  8:01   ` Johannes Thumshirn

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=20200610123258.12382-16-johannes.thumshirn@wdc.com \
    --to=johannes.thumshirn@wdc.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.