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 4/4] btrfs-progs: remove btrfs_raid_profile_table
Date: Tue, 23 Jun 2020 16:10:19 +0200 [thread overview]
Message-ID: <20200623141019.23991-5-jth@kernel.org> (raw)
In-Reply-To: <20200623141019.23991-1-jth@kernel.org>
From: Johannes Thumshirn <johannes.thumshirn@wdc.com>
For SINGLE and DUP RAID profiles we can get the num_stripes values from
btrfs_raid_attr::dev:stripes. For all other RAID profiles the value is
calculated anyways.
As this was the last remaining member of the btrfs_raid_profile_table we
can remove it as well.
Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
---
volumes.c | 34 +---------------------------------
1 file changed, 1 insertion(+), 33 deletions(-)
diff --git a/volumes.c b/volumes.c
index 71c3735d..e8b4aad8 100644
--- a/volumes.c
+++ b/volumes.c
@@ -998,44 +998,12 @@ error:
- 2 * sizeof(struct btrfs_chunk)) \
/ sizeof(struct btrfs_stripe) + 1)
-static const struct btrfs_raid_profile {
- int num_stripes;
-} btrfs_raid_profile_table[BTRFS_NR_RAID_TYPES] = {
- [BTRFS_RAID_RAID10] = {
- .num_stripes = 0,
- },
- [BTRFS_RAID_RAID1] = {
- .num_stripes = 0,
- },
- [BTRFS_RAID_RAID1C3] = {
- .num_stripes = 0,
- },
- [BTRFS_RAID_RAID1C4] = {
- .num_stripes = 0,
- },
- [BTRFS_RAID_DUP] = {
- .num_stripes = 2,
- },
- [BTRFS_RAID_RAID0] = {
- .num_stripes = 0,
- },
- [BTRFS_RAID_SINGLE] = {
- .num_stripes = 1,
- },
- [BTRFS_RAID_RAID5] = {
- .num_stripes = 0,
- },
- [BTRFS_RAID_RAID6] = {
- .num_stripes = 0,
- },
-};
-
static void init_alloc_chunk_ctl(struct btrfs_fs_info *info,
struct alloc_chunk_ctl *ctl)
{
int type = ctl->type;
- ctl->num_stripes = btrfs_raid_profile_table[type].num_stripes;
+ ctl->num_stripes = btrfs_raid_array[type].dev_stripes;
ctl->min_stripes = btrfs_raid_array[type].devs_min;
ctl->sub_stripes = btrfs_raid_array[type].sub_stripes;
ctl->stripe_len = BTRFS_STRIPE_LEN;
--
2.26.2
next prev parent 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 ` [PATCH 1/4] btrfs-progs: use sub_stripes property from btrfs_raid_attr Johannes Thumshirn
2020-06-23 14:10 ` [PATCH 2/4] btrfs-progs: use minimal number of stripes " 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 ` Johannes Thumshirn [this message]
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-5-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.