linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
From: Chao Yu <yuchao0@huawei.com>
To: Liu Song <fishland@aliyun.com>, <jaegeuk@kernel.org>, <chao@kernel.org>
Cc: linux-f2fs-devel@lists.sourceforge.net, liu.song11@zte.com.cn,
	linux-kernel@vger.kernel.org
Subject: Re: [f2fs-dev] [PATCH] f2fs: remove unnecessary judgments in __insert_free_nid()
Date: Sun, 28 Jun 2020 10:56:18 +0800	[thread overview]
Message-ID: <34a73209-8384-2818-b6e1-c97fc9c32e69@huawei.com> (raw)
In-Reply-To: <20200626143927.2792-1-fishland@aliyun.com>

On 2020/6/26 22:39, Liu Song via Linux-f2fs-devel wrote:
> From: Liu Song <liu.song11@zte.com.cn>
> 
> The value of state must be equal to FREE_NID, so the if
> condition judgment can be removed.
> 
> Signed-off-by: Liu Song <liu.song11@zte.com.cn>
> ---
>  fs/f2fs/node.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
> index 03e24df1c84f..0adeb20f19c9 100644
> --- a/fs/f2fs/node.c
> +++ b/fs/f2fs/node.c
> @@ -2118,8 +2118,7 @@ static int __insert_free_nid(struct f2fs_sb_info *sbi,
>  
>  	f2fs_bug_on(sbi, state != i->state);
>  	nm_i->nid_cnt[state]++;
> -	if (state == FREE_NID)
> -		list_add_tail(&i->list, &nm_i->free_nid_list);
> +	list_add_tail(&i->list, &nm_i->free_nid_list);

In previous design, @state allow accepting both FREE_NID and PREALLOC_NID,
If you remove that condition, it's not correct to add free nid entry into
free_nid_list when passing PREALLOC_NID in @state, now, we only pass @state
with FREE_NID, so it's better to remove that parameter directly.

Thanks,

>  	return 0;
>  }
>  
> 


_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

  reply	other threads:[~2020-06-28  2:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-26 14:39 [f2fs-dev] [PATCH] f2fs: remove unnecessary judgments in __insert_free_nid() Liu Song via Linux-f2fs-devel
2020-06-28  2:56 ` Chao Yu [this message]
2020-06-28 12:30   ` fishland via Linux-f2fs-devel

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=34a73209-8384-2818-b6e1-c97fc9c32e69@huawei.com \
    --to=yuchao0@huawei.com \
    --cc=chao@kernel.org \
    --cc=fishland@aliyun.com \
    --cc=jaegeuk@kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liu.song11@zte.com.cn \
    /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).