From: Gao Xiang <hsiangkao@aol.com>
To: Chao Yu <yuchao0@huawei.com>
Cc: linux-erofs@lists.ozlabs.org, linux-kernel@vger.kernel.org,
Chao Yu <chao@kernel.org>, Miao Xie <miaoxie@huawei.com>,
Gao Xiang <gaoxiang25@huawei.com>
Subject: [PATCH 1/2] erofs: fold in postsubmit_is_all_bypassed()
Date: Mon, 20 Jan 2020 16:57:08 +0800 [thread overview]
Message-ID: <20200120085709.10320-1-hsiangkao@aol.com> (raw)
In-Reply-To: 20200120085709.10320-1-hsiangkao.ref@aol.com
From: Gao Xiang <gaoxiang25@huawei.com>
No need to introduce such separated helper since
cache strategy compile configs was changed into
runtime options instead in v5.4. No logic changes.
Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
---
fs/erofs/zdata.c | 23 +++++++----------------
1 file changed, 7 insertions(+), 16 deletions(-)
diff --git a/fs/erofs/zdata.c b/fs/erofs/zdata.c
index 4fedeb4496e4..6ee5153801b2 100644
--- a/fs/erofs/zdata.c
+++ b/fs/erofs/zdata.c
@@ -1148,20 +1148,6 @@ static void move_to_bypass_jobqueue(struct z_erofs_pcluster *pcl,
qtail[JQ_BYPASS] = &pcl->next;
}
-static bool postsubmit_is_all_bypassed(struct z_erofs_decompressqueue *q[],
- unsigned int nr_bios, bool force_fg)
-{
- /*
- * although background is preferred, no one is pending for submission.
- * don't issue workqueue for decompression but drop it directly instead.
- */
- if (force_fg || nr_bios)
- return false;
-
- kvfree(q[JQ_SUBMIT]);
- return true;
-}
-
static bool z_erofs_submit_queue(struct super_block *sb,
z_erofs_next_pcluster_t owned_head,
struct list_head *pagepool,
@@ -1262,9 +1248,14 @@ static bool z_erofs_submit_queue(struct super_block *sb,
if (bio)
submit_bio(bio);
- if (postsubmit_is_all_bypassed(q, nr_bios, *force_fg))
+ /*
+ * although background is preferred, no one is pending for submission.
+ * don't issue workqueue for decompression but drop it directly instead.
+ */
+ if (!force_fg && !nr_bios) {
+ kvfree(q[JQ_SUBMIT]);
return true;
-
+ }
z_erofs_decompress_kickoff(q[JQ_SUBMIT], *force_fg, nr_bios);
return true;
}
--
2.20.1
next parent reply other threads:[~2020-01-20 8:57 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20200120085709.10320-1-hsiangkao.ref@aol.com>
2020-01-20 8:57 ` Gao Xiang [this message]
2020-01-20 8:57 ` [PATCH 2/2] erofs: clean up z_erofs_submit_queue() Gao Xiang
2020-01-21 6:47 ` [PATCH v2 1/2] erofs: fold in postsubmit_is_all_bypassed() Gao Xiang
2020-01-21 6:48 ` [PATCH v2 2/2] erofs: clean up z_erofs_submit_queue() Gao Xiang
2020-01-21 8:02 ` Chao Yu
2020-01-21 8:01 ` [PATCH v2 1/2] erofs: fold in postsubmit_is_all_bypassed() 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=20200120085709.10320-1-hsiangkao@aol.com \
--to=hsiangkao@aol.com \
--cc=chao@kernel.org \
--cc=gaoxiang25@huawei.com \
--cc=linux-erofs@lists.ozlabs.org \
--cc=linux-kernel@vger.kernel.org \
--cc=miaoxie@huawei.com \
--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).