From: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
To: Yu Kuai <yukuai1@huaweicloud.com>
Cc: xni@redhat.com, song@kernel.org, linux-raid@vger.kernel.org,
linux-kernel@vger.kernel.org, yukuai3@huawei.com,
yi.zhang@huawei.com, yangerkun@huawei.com
Subject: Re: [PATCH v2 2/2] md: simplify md_seq_ops
Date: Tue, 26 Sep 2023 16:09:38 +0200 [thread overview]
Message-ID: <20230926160938.00001b1c@linux.intel.com> (raw)
In-Reply-To: <20230926025827.671407-3-yukuai1@huaweicloud.com>
On Tue, 26 Sep 2023 10:58:27 +0800
Yu Kuai <yukuai1@huaweicloud.com> wrote:
> From: Yu Kuai <yukuai3@huawei.com>
>
> Before this patch, the implementation is hacky and hard to understand:
>
> 1) md_seq_start set pos to 1;
> 2) md_seq_show found pos is 1, then print Personalities;
> 3) md_seq_next found pos is 1, then it update pos to the first mddev;
> 4) md_seq_show found pos is not 1 or 2, show mddev;
> 5) md_seq_next found pos is not 1 or 2, update pos to next mddev;
> 6) loop 4-5 until the last mddev, then md_seq_next update pos to 2;
> 7) md_seq_show found pos is 2, then print unused devices;
> 8) md_seq_next found pos is 2, stop;
>
> This patch remove the magic value and use seq_list_start/next/stop()
> directly, and move printing "Personalities" to md_sep_start(),
> "unsed devices" to md_seq_stop():
Typo md_sep_start()
>
> 1) md_seq_start print Personalities, and then set pos to first mddev;
> 2) md_seq_show show mddev;
> 3) md_seq_next update pos to next mddev;
> 4) loop 2-3 until the last mddev;
> 5) md_seq_stop print unsed devices;
>
> Signed-off-by: Yu Kuai <yukuai3@huawei.com>
> ---
LGTM. Nice one. Code looks much better now.
Reviewed-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
prev parent reply other threads:[~2023-09-26 14:14 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-26 2:58 [PATCH v2 0/2] md: simplify md_seq_ops Yu Kuai
2023-09-26 2:58 ` [PATCH v2 1/2] md: factor out a new helper to put mddev Yu Kuai
2023-09-26 12:45 ` Mariusz Tkaczyk
2023-09-26 12:54 ` Yu Kuai
2023-09-26 13:19 ` Mariusz Tkaczyk
2023-09-27 0:15 ` Song Liu
2023-09-27 0:54 ` Yu Kuai
2023-09-26 2:58 ` [PATCH v2 2/2] md: simplify md_seq_ops Yu Kuai
2023-09-26 14:09 ` Mariusz Tkaczyk [this message]
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=20230926160938.00001b1c@linux.intel.com \
--to=mariusz.tkaczyk@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-raid@vger.kernel.org \
--cc=song@kernel.org \
--cc=xni@redhat.com \
--cc=yangerkun@huawei.com \
--cc=yi.zhang@huawei.com \
--cc=yukuai1@huaweicloud.com \
--cc=yukuai3@huawei.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).