[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d60f4a7d-dd4a-46fb-823b-d3b7497c14a6@wdc.com>
Date: Wed, 13 Sep 2023 05:34:17 +0000
From: Johannes Thumshirn <Johannes.Thumshirn@....com>
To: "dsterba@...e.cz" <dsterba@...e.cz>
CC: Chris Mason <clm@...com>, Josef Bacik <josef@...icpanda.com>,
David Sterba <dsterba@...e.com>,
Christoph Hellwig <hch@....de>,
Naohiro Aota <Naohiro.Aota@....com>, Qu Wenruo <wqu@...e.com>,
Damien Le Moal <dlemoal@...nel.org>,
"linux-btrfs@...r.kernel.org" <linux-btrfs@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v8 08/11] btrfs: add raid stripe tree pretty printer
On 12.09.23 22:42, David Sterba wrote:
>> +struct raid_encoding_map {
>> + u8 encoding;
>> + char name[16];
>> +};
>> +
>> +static const struct raid_encoding_map raid_map[] = {
>> + { BTRFS_STRIPE_DUP, "DUP" },
>> + { BTRFS_STRIPE_RAID0, "RAID0" },
>> + { BTRFS_STRIPE_RAID1, "RAID1" },
>> + { BTRFS_STRIPE_RAID1C3, "RAID1C3" },
>> + { BTRFS_STRIPE_RAID1C4, "RAID1C4" },
>> + { BTRFS_STRIPE_RAID5, "RAID5" },
>> + { BTRFS_STRIPE_RAID6, "RAID6" },
>> + { BTRFS_STRIPE_RAID10, "RAID10" }
>> +};
>
> Instead of another table tranlating constants to raid names, can you
> somehow utilize the btrfs_raid_array table? If the STRIPE values match
> the RAID (the indexes to the table) you could add a simple wrapper.
Sure.
Powered by blists - more mailing lists