diff options
author | Gao Xiang <gaoxiang25@huawei.com> | 2020-01-21 07:47:47 +0100 |
---|---|---|
committer | Gao Xiang <gaoxiang25@huawei.com> | 2020-01-21 09:46:17 +0100 |
commit | 587a67b77789f822930d8f5e65bdd161c82e6365 (patch) | |
tree | e04153ea10591c338d69100c8361c70df2969c93 /fs/erofs | |
parent | erofs: fix out-of-bound read for shifted uncompressed block (diff) | |
download | linux-587a67b77789f822930d8f5e65bdd161c82e6365.tar.xz linux-587a67b77789f822930d8f5e65bdd161c82e6365.zip |
erofs: fold in postsubmit_is_all_bypassed()
No need to introduce such separated helper since
cache strategy compile configs were changed into
runtime options instead in v5.4. No logic changes.
Link: https://lore.kernel.org/r/20200121064747.138987-1-gaoxiang25@huawei.com
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
Diffstat (limited to 'fs/erofs')
-rw-r--r-- | fs/erofs/zdata.c | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/fs/erofs/zdata.c b/fs/erofs/zdata.c index 4fedeb4496e4..f63a893fe886 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 @@ skippage: 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; } |