Hi Xiaojun,
On 2020/9/21 14:19, Wang Xiaojun wrote:
The case where nid is 0 will be checked in f2fs_check_nid_range.
Remove the unused check.
Signed-off-by: Wang Xiaojun <[email protected]>
---
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;
They have different usage, first condition is used to bypass @nid = 0 case which
is legal case; second condition is used to check sanity of nid value, in where
warn log would be printed once nid is a illegal value and in addition,
SBI_NEED_FSCK
will be set for later fsck.
So let's keep it as it is. :)
Thanks,
@@ -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;
_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel