From: Gao Xiang <hsiangkao@linux.alibaba.com>
To: linux-erofs@lists.ozlabs.org, Chao Yu <chao@kernel.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
Gao Xiang <hsiangkao@linux.alibaba.com>
Subject: [PATCH v2 09/16] erofs: get rid of `enum z_erofs_page_type'
Date: Fri, 15 Jul 2022 23:41:56 +0800 [thread overview]
Message-ID: <20220715154203.48093-10-hsiangkao@linux.alibaba.com> (raw)
In-Reply-To: <20220715154203.48093-1-hsiangkao@linux.alibaba.com>
Remove it since pagevec[] is no longer used.
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
---
fs/erofs/zdata.c | 30 +++++-------------------------
1 file changed, 5 insertions(+), 25 deletions(-)
diff --git a/fs/erofs/zdata.c b/fs/erofs/zdata.c
index 2d5e2ed3e5f5..f2a513299d82 100644
--- a/fs/erofs/zdata.c
+++ b/fs/erofs/zdata.c
@@ -27,17 +27,6 @@ static struct z_erofs_pcluster_slab pcluster_pool[] __read_mostly = {
_PCLP(Z_EROFS_PCLUSTER_MAX_PAGES)
};
-/* (obsoleted) page type for online pages */
-enum z_erofs_page_type {
- /* including Z_EROFS_VLE_PAGE_TAIL_EXCLUSIVE */
- Z_EROFS_PAGE_TYPE_EXCLUSIVE,
-
- Z_EROFS_VLE_PAGE_TYPE_TAIL_SHARED,
-
- Z_EROFS_VLE_PAGE_TYPE_HEAD,
- Z_EROFS_VLE_PAGE_TYPE_MAX
-};
-
struct z_erofs_bvec_iter {
struct page *bvpage;
struct z_erofs_bvset *bvset;
@@ -429,7 +418,6 @@ int erofs_try_to_free_cached_page(struct page *page)
return ret;
}
-/* page_type must be Z_EROFS_PAGE_TYPE_EXCLUSIVE */
static bool z_erofs_try_inplace_io(struct z_erofs_decompress_frontend *fe,
struct z_erofs_bvec *bvec)
{
@@ -447,13 +435,11 @@ static bool z_erofs_try_inplace_io(struct z_erofs_decompress_frontend *fe,
/* callers must be with pcluster lock held */
static int z_erofs_attach_page(struct z_erofs_decompress_frontend *fe,
- struct z_erofs_bvec *bvec,
- enum z_erofs_page_type type)
+ struct z_erofs_bvec *bvec, bool exclusive)
{
int ret;
- if (fe->mode >= COLLECT_PRIMARY &&
- type == Z_EROFS_PAGE_TYPE_EXCLUSIVE) {
+ if (fe->mode >= COLLECT_PRIMARY && exclusive) {
/* give priority for inplaceio to use file pages first */
if (z_erofs_try_inplace_io(fe, bvec))
return 0;
@@ -718,10 +704,9 @@ static int z_erofs_do_read_page(struct z_erofs_decompress_frontend *fe,
struct erofs_sb_info *const sbi = EROFS_I_SB(inode);
struct erofs_map_blocks *const map = &fe->map;
const loff_t offset = page_offset(page);
- bool tight = true;
+ bool tight = true, exclusive;
enum z_erofs_cache_alloctype cache_strategy;
- enum z_erofs_page_type page_type;
unsigned int cur, end, spiltted, index;
int err = 0;
@@ -798,12 +783,7 @@ static int z_erofs_do_read_page(struct z_erofs_decompress_frontend *fe,
goto next_part;
}
- /* let's derive page type */
- page_type = cur ? Z_EROFS_VLE_PAGE_TYPE_HEAD :
- (!spiltted ? Z_EROFS_PAGE_TYPE_EXCLUSIVE :
- (tight ? Z_EROFS_PAGE_TYPE_EXCLUSIVE :
- Z_EROFS_VLE_PAGE_TYPE_TAIL_SHARED));
-
+ exclusive = (!cur && (!spiltted || tight));
if (cur)
tight &= (fe->mode >= COLLECT_PRIMARY_FOLLOWED);
@@ -812,7 +792,7 @@ static int z_erofs_do_read_page(struct z_erofs_decompress_frontend *fe,
.page = page,
.offset = offset - map->m_la,
.end = end,
- }), page_type);
+ }), exclusive);
/* should allocate an additional short-lived page for bvset */
if (err == -EAGAIN && !fe->candidate_bvpage) {
fe->candidate_bvpage = alloc_page(GFP_NOFS | __GFP_NOFAIL);
--
2.24.4
next prev parent reply other threads:[~2022-07-15 15:42 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-15 15:41 [PATCH v2 00/16] erofs: prepare for folios, deduplication and kill PG_error Gao Xiang
2022-07-15 15:41 ` [PATCH v2 01/16] erofs: get rid of unneeded `inode', `map' and `sb' Gao Xiang
2022-07-15 15:41 ` [PATCH v2 02/16] erofs: clean up z_erofs_collector_begin() Gao Xiang
2022-07-15 15:41 ` [PATCH v2 03/16] erofs: introduce `z_erofs_parse_out_bvecs()' Gao Xiang
2022-07-15 15:41 ` [PATCH v2 04/16] erofs: introduce bufvec to store decompressed buffers Gao Xiang
2022-07-15 15:41 ` [PATCH v2 05/16] erofs: drop the old pagevec approach Gao Xiang
2022-07-15 15:41 ` [PATCH v2 06/16] erofs: introduce `z_erofs_parse_in_bvecs' Gao Xiang
2022-07-15 15:41 ` [PATCH v2 07/16] erofs: switch compressed_pages[] to bufvec Gao Xiang
2022-07-15 15:41 ` [PATCH v2 08/16] erofs: rework online page handling Gao Xiang
2022-07-15 15:41 ` Gao Xiang [this message]
2022-07-15 15:41 ` [PATCH v2 10/16] erofs: clean up `enum z_erofs_collectmode' Gao Xiang
2022-07-15 15:41 ` [PATCH v2 11/16] erofs: get rid of `z_pagemap_global' Gao Xiang
2022-07-15 15:41 ` [PATCH v2 12/16] erofs: introduce struct z_erofs_decompress_backend Gao Xiang
2022-07-15 15:42 ` [PATCH v2 13/16] erofs: try to leave (de)compressed_pages on stack if possible Gao Xiang
2022-07-15 15:42 ` [PATCH v2 14/16] erofs: introduce z_erofs_do_decompressed_bvec() Gao Xiang
2022-07-15 15:42 ` [PATCH v2 15/16] erofs: record the longest decompressed size in this round Gao Xiang
2022-07-15 15:42 ` [PATCH v2 16/16] erofs: introduce multi-reference pclusters (fully-referenced) Gao Xiang
2022-07-21 14:31 ` [PATCH v2 00/16] erofs: prepare for folios, deduplication and kill PG_error 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=20220715154203.48093-10-hsiangkao@linux.alibaba.com \
--to=hsiangkao@linux.alibaba.com \
--cc=chao@kernel.org \
--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
all inboxes | Powered by JetHome®