From: Wang Xiaojun <wangxiaojun11@huawei.com>
To: <yuchao0@huawei.com>, <jaegeuk@kernel.org>
Cc: linux-f2fs-devel@lists.sourceforge.net
Subject: [f2fs-dev] [PATCH] f2fs: remove unused check on nid
Date: Mon, 21 Sep 2020 14:19:16 +0800 [thread overview]
Message-ID: <20200921061916.1917750-1-wangxiaojun11@huawei.com> (raw)
The case where nid is 0 will be checked in f2fs_check_nid_range.
Remove the unused check.
Signed-off-by: Wang Xiaojun <wangxiaojun11@huawei.com>
---
fs/f2fs/node.c | 8 --------
1 file changed, 8 deletions(-)
diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
index cb1b5b61a1da..c61d5b52e29e 100644
--- a/fs/f2fs/node.c
+++ b/fs/f2fs/node.c
@@ -1319,8 +1319,6 @@ void f2fs_ra_node_page(struct f2fs_sb_info *sbi, nid_t nid)
struct page *apage;
int err;
- if (!nid)
- return;
if (f2fs_check_nid_range(sbi, nid))
return;
@@ -1342,8 +1340,6 @@ static struct page *__get_node_page(struct f2fs_sb_info *sbi, pgoff_t nid,
struct page *page;
int err;
- if (!nid)
- return ERR_PTR(-ENOENT);
if (f2fs_check_nid_range(sbi, nid))
return ERR_PTR(-EINVAL);
repeat:
@@ -2193,10 +2189,6 @@ static bool add_free_nid(struct f2fs_sb_info *sbi,
int err = -EINVAL;
bool ret = false;
- /* 0 nid should not be used */
- if (unlikely(nid == 0))
- return false;
-
if (unlikely(f2fs_check_nid_range(sbi, nid)))
return false;
--
2.25.1
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
next reply other threads:[~2020-09-21 6:17 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-21 6:19 Wang Xiaojun [this message]
2020-09-21 9:20 ` [f2fs-dev] [PATCH] f2fs: remove unused check on nid Chao Yu
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=20200921061916.1917750-1-wangxiaojun11@huawei.com \
--to=wangxiaojun11@huawei.com \
--cc=jaegeuk@kernel.org \
--cc=linux-f2fs-devel@lists.sourceforge.net \
--cc=yuchao0@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).