From: Gao Xiang <xiang@kernel.org>
To: linux-erofs@lists.ozlabs.org, Chao Yu <chao@kernel.org>
Cc: linux-kernel@vger.kernel.org, Gao Xiang <hsiangkao@linux.alibaba.com>
Subject: [PATCH 3/3] erofs: simplify z_erofs_pcluster_readmore()
Date: Sun, 29 May 2022 13:54:25 +0800 [thread overview]
Message-ID: <20220529055425.226363-4-xiang@kernel.org> (raw)
In-Reply-To: <20220529055425.226363-1-xiang@kernel.org>
From: Gao Xiang <hsiangkao@linux.alibaba.com>
Get rid of unnecessary label `skip'. No logic changes.
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
---
fs/erofs/zdata.c | 23 ++++++++++-------------
1 file changed, 10 insertions(+), 13 deletions(-)
diff --git a/fs/erofs/zdata.c b/fs/erofs/zdata.c
index 6dd858f94e44..b33fb64b3393 100644
--- a/fs/erofs/zdata.c
+++ b/fs/erofs/zdata.c
@@ -1436,22 +1436,19 @@ static void z_erofs_pcluster_readmore(struct z_erofs_decompress_frontend *f,
struct page *page;
page = erofs_grab_cache_page_nowait(inode->i_mapping, index);
- if (!page)
- goto skip;
-
- if (PageUptodate(page)) {
- unlock_page(page);
+ if (page) {
+ if (PageUptodate(page)) {
+ unlock_page(page);
+ } else {
+ err = z_erofs_do_read_page(f, page, pagepool);
+ if (err)
+ erofs_err(inode->i_sb,
+ "readmore error at page %lu @ nid %llu",
+ index, EROFS_I(inode)->nid);
+ }
put_page(page);
- goto skip;
}
- err = z_erofs_do_read_page(f, page, pagepool);
- if (err)
- erofs_err(inode->i_sb,
- "readmore error at page %lu @ nid %llu",
- index, EROFS_I(inode)->nid);
- put_page(page);
-skip:
if (cur < PAGE_SIZE)
break;
cur = (index << PAGE_SHIFT) - 1;
--
2.30.2
next prev parent reply other threads:[~2022-05-29 5:57 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-29 5:54 [PATCH 0/3] erofs: random decompression cleanups Gao Xiang
2022-05-29 5:54 ` [PATCH 1/3] erofs: get rid of `struct z_erofs_collection' Gao Xiang
2022-05-29 5:54 ` [PATCH 2/3] erofs: get rid of label `restart_now' Gao Xiang
2022-05-29 5:54 ` Gao Xiang [this message]
2022-05-31 6:45 ` [PATCH 0/3] erofs: random decompression cleanups Chao Yu
2022-05-31 6:50 ` Gao Xiang
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=20220529055425.226363-4-xiang@kernel.org \
--to=xiang@kernel.org \
--cc=chao@kernel.org \
--cc=hsiangkao@linux.alibaba.com \
--cc=linux-erofs@lists.ozlabs.org \
--cc=linux-kernel@vger.kernel.org \
/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