From: Daejun Park <daejun7.park@samsung.com>
To: harshad shirwadkar <harshadshirwadkar@gmail.com>,
Daejun Park <daejun7.park@samsung.com>
Cc: "tytso@mit.edu" <tytso@mit.edu>,
"adilger.kernel@dilger.ca" <adilger.kernel@dilger.ca>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-ext4@vger.kernel.org" <linux-ext4@vger.kernel.org>
Subject: RE: Re: [PATCH] ext4: Change list_for_each to list_for_each_entry
Date: Mon, 11 Jan 2021 10:18:21 +0900 [thread overview]
Message-ID: <20210111011821epcms2p626def5bccbea257ffbcd95257c1539cc@epcms2p6> (raw)
In-Reply-To: <CAD+ocbwuZ-y--YoC=1khtaQ1A2oYqyQtKGsvVHNvngzsuN0ByA@mail.gmail.com>
Hi Harshad,
> > > list_for_each + list_entry can be changed to list_for_each_entry
> > > It reduces number of variables and lines.
> > >
> > > Signed-off-by: Daejun Park <daejun7.park@samsung.com>
> > > ---
> > > fs/ext4/fast_commit.c | 7 ++-----
> > > 1 file changed, 2 insertions(+), 5 deletions(-)
> > >
> > > diff --git a/fs/ext4/fast_commit.c b/fs/ext4/fast_commit.c
> > > index 5b6bb3ef0f33..dc58471971db 100644
> > > --- a/fs/ext4/fast_commit.c
> > > +++ b/fs/ext4/fast_commit.c
> > > @@ -915,13 +915,11 @@ static int ext4_fc_submit_inode_data_all(journal_t *journal)
> > > struct super_block *sb = (struct super_block *)(journal->j_private);
> > > struct ext4_sb_info *sbi = EXT4_SB(sb);
> > > struct ext4_inode_info *ei;
> > > - struct list_head *pos;
> > > int ret = 0;
> > >
> > > spin_lock(&sbi->s_fc_lock);
> > > ext4_set_mount_flag(sb, EXT4_MF_FC_COMMITTING);
> > > - list_for_each(pos, &sbi->s_fc_q[FC_Q_MAIN]) {
> > > - ei = list_entry(pos, struct ext4_inode_info, i_fc_list);
> > > + list_for_each_entry(ei, &sbi->s_fc_q[FC_Q_MAIN], i_fc_list) {
> > > ext4_set_inode_state(&ei->vfs_inode, EXT4_STATE_FC_COMMITTING);
> > > while (atomic_read(&ei->i_fc_updates)) {
> > > DEFINE_WAIT(wait);
> > > @@ -1099,8 +1097,7 @@ static int ext4_fc_perform_commit(journal_t *journal)
> > > goto out;
> > > }
> > >
> > > - list_for_each(pos, &sbi->s_fc_q[FC_Q_MAIN]) {
> > > - iter = list_entry(pos, struct ext4_inode_info, i_fc_list);
> Variable "pos" isn't used anymore after this patch. You removed it for
> the ext4_fc_submit_inode_data_all() function, but missed removing it
> in this function. That's throwing me a warning.
>
Thanks for comment, I will remove this. And I will change some list_for_each_safe
macro at new patch.
Thanks,
Daejun
prev parent reply other threads:[~2021-01-11 1:19 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20201231015213epcms2p5ef76aa6b26ab74e045a86f6a13b31d51@epcms2p5>
2020-12-31 1:52 ` Daejun Park
2021-01-05 21:56 ` harshad shirwadkar
2021-01-08 23:00 ` harshad shirwadkar
[not found] ` <CGME20201231015213epcms2p5ef76aa6b26ab74e045a86f6a13b31d51@epcms2p6>
2021-01-11 1:18 ` Daejun Park [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=20210111011821epcms2p626def5bccbea257ffbcd95257c1539cc@epcms2p6 \
--to=daejun7.park@samsung.com \
--cc=adilger.kernel@dilger.ca \
--cc=harshadshirwadkar@gmail.com \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tytso@mit.edu \
/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
all inboxes | Powered by JetHome®