All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Thumshirn <jth@kernel.org>
To: David Sterba <dsterba@suse.com>
Cc: linux-btrfs@vger.kernel.org, Qu Wenruo <wqu@suse.com>,
	Johannes Thumshirn <johannes.thumshirn@wdc.com>
Subject: [PATCH 1/4] btrfs-progs: use sub_stripes property from btrfs_raid_attr
Date: Tue, 23 Jun 2020 16:10:16 +0200	[thread overview]
Message-ID: <20200623141019.23991-2-jth@kernel.org> (raw)
In-Reply-To: <20200623141019.23991-1-jth@kernel.org>

From: Johannes Thumshirn <johannes.thumshirn@wdc.com>

Both btrfs_raid_attr and btrfs_raid_profile define the number of
sub_stripes a raid type has.

Use the one from btrfs_raid_attr and get rid of the field in
btrfs_raid_profile.

Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
---
 volumes.c | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)

diff --git a/volumes.c b/volumes.c
index 7c57d6cb..9d0eeed5 100644
--- a/volumes.c
+++ b/volumes.c
@@ -1002,61 +1002,51 @@ static const struct btrfs_raid_profile {
 	int	num_stripes;
 	int	max_stripes;
 	int	min_stripes;
-	int	sub_stripes;
 } btrfs_raid_profile_table[BTRFS_NR_RAID_TYPES] = {
 	[BTRFS_RAID_RAID10] = {
 		.num_stripes = 0,
 		.max_stripes = 0,
 		.min_stripes = 4,
-		.sub_stripes = 2,
 	},
 	[BTRFS_RAID_RAID1] = {
 		.num_stripes = 0,
 		.max_stripes = 0,
 		.min_stripes = 2,
-		.sub_stripes = 1,
 	},
 	[BTRFS_RAID_RAID1C3] = {
 		.num_stripes = 0,
 		.max_stripes = 0,
 		.min_stripes = 3,
-		.sub_stripes = 1,
 	},
 	[BTRFS_RAID_RAID1C4] = {
 		.num_stripes = 0,
 		.max_stripes = 0,
 		.min_stripes = 4,
-		.sub_stripes = 1,
 	},
 	[BTRFS_RAID_DUP] = {
 		.num_stripes = 2,
 		.max_stripes = 0,
 		.min_stripes = 2,
-		.sub_stripes = 1,
 	},
 	[BTRFS_RAID_RAID0] = {
 		.num_stripes = 0,
 		.max_stripes = 0,
 		.min_stripes = 2,
-		.sub_stripes = 1,
 	},
 	[BTRFS_RAID_SINGLE] = {
 		.num_stripes = 1,
 		.max_stripes = 0,
 		.min_stripes = 1,
-		.sub_stripes = 1,
 	},
 	[BTRFS_RAID_RAID5] = {
 		.num_stripes = 0,
 		.max_stripes = 0,
 		.min_stripes = 2,
-		.sub_stripes = 1,
 	},
 	[BTRFS_RAID_RAID6] = {
 		.num_stripes = 0,
 		.max_stripes = 0,
 		.min_stripes = 3,
-		.sub_stripes = 1,
 	},
 };
 
@@ -1067,7 +1057,7 @@ static void init_alloc_chunk_ctl(struct btrfs_fs_info *info,
 
 	ctl->num_stripes = btrfs_raid_profile_table[type].num_stripes;
 	ctl->min_stripes = btrfs_raid_profile_table[type].min_stripes;
-	ctl->sub_stripes = btrfs_raid_profile_table[type].sub_stripes;
+	ctl->sub_stripes = btrfs_raid_array[type].sub_stripes;
 	ctl->stripe_len = BTRFS_STRIPE_LEN;
 
 	switch (type) {
-- 
2.26.2


  reply	other threads:[~2020-06-23 14:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-23 14:10 [PATCH 0/4] btrfs-progs: get rid of btrfs_raid_profile_table Johannes Thumshirn
2020-06-23 14:10 ` Johannes Thumshirn [this message]
2020-06-23 14:10 ` [PATCH 2/4] btrfs-progs: use minimal number of stripes from btrfs_raid_attr Johannes Thumshirn
2020-06-23 14:10 ` [PATCH 3/4] btrfs-progs: remove unused btrfs_raid_profile::max_stripes Johannes Thumshirn
2020-06-23 14:10 ` [PATCH 4/4] btrfs-progs: remove btrfs_raid_profile_table Johannes Thumshirn
2020-06-23 15:45 ` [PATCH 0/4] btrfs-progs: get rid of btrfs_raid_profile_table 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=20200623141019.23991-2-jth@kernel.org \
    --to=jth@kernel.org \
    --cc=dsterba@suse.com \
    --cc=johannes.thumshirn@wdc.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=wqu@suse.com \
    /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.