Re: [PATCH] raid5: refactor raid5 personality definition
From: Song Liu <song@kernel.org>
Date: 2020-09-30 22:44:39
From: Song Liu <song@kernel.org>
Date: 2020-09-30 22:44:39
On Mon, Sep 28, 2020 at 6:03 PM Jason Yan [off-list ref] wrote:
Hi all, any comments?
Sorry for the late reply. I somehow missed the first email.
在 2020/9/21 14:38, Jason Yan 写道:quoted
The definition of md personality for raid4/raid5/raid6 is almost the same. So introduce a macro 'RAID5_PERSONALITY_ATTR' to help define the personality. This can help us reduce some duplicated code. Signed-off-by: Jason Yan <yanaijie@huawei.com>
[...]
quoted
+} + +#define raid4_check_reshape raid5_check_reshape + +RAID5_PERSONALITY_ATTR(raid4, 4); +RAID5_PERSONALITY_ATTR(raid5, 5); +RAID5_PERSONALITY_ATTR(raid6, 6);
I don't think we benefit much from this change. It doesn't make the code easier to read. Instead, this change adds another level of marco to the code. I would rather keep this code as-is. Thanks, Song