summaryrefslogtreecommitdiff
path: root/fs/erofs
diff options
context:
space:
mode:
authorGao Xiang <hsiangkao@redhat.com>2020-09-19 15:27:29 +0800
committerGao Xiang <hsiangkao@redhat.com>2020-09-19 15:35:57 +0800
commitbf9a123b9cf8d8c67c4c59757cbf4e4b2c4ab2e3 (patch)
treecf103091072c9c54fbd86ae46b648cfcd70d0122 /fs/erofs
parent6c3e485ea37da2bcca68e6b8c635ddd2b4da540d (diff)
erofs: fold in should_decompress_synchronously()
should_decompress_synchronously() has one single condition for now, so fold it instead. Reviewed-by: Chao Yu <yuchao0@huawei.com> Link: https://lore.kernel.org/r/20200919072730.24989-2-hsiangkao@redhat.com Signed-off-by: Gao Xiang <hsiangkao@redhat.com>
Diffstat (limited to 'fs/erofs')
-rw-r--r--fs/erofs/zdata.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/fs/erofs/zdata.c b/fs/erofs/zdata.c
index e43684b23fdd..bee6ce783c64 100644
--- a/fs/erofs/zdata.c
+++ b/fs/erofs/zdata.c
@@ -1294,24 +1294,18 @@ static int z_erofs_readpage(struct file *file, struct page *page)
return err;
}
-static bool should_decompress_synchronously(struct erofs_sb_info *sbi,
- unsigned int nr)
-{
- return nr <= sbi->ctx.max_sync_decompress_pages;
-}
-
static void z_erofs_readahead(struct readahead_control *rac)
{
struct inode *const inode = rac->mapping->host;
struct erofs_sb_info *const sbi = EROFS_I_SB(inode);
- bool sync = should_decompress_synchronously(sbi, readahead_count(rac));
+ unsigned int nr_pages = readahead_count(rac);
+ bool sync = (nr_pages <= sbi->ctx.max_sync_decompress_pages);
struct z_erofs_decompress_frontend f = DECOMPRESS_FRONTEND_INIT(inode);
struct page *page, *head = NULL;
LIST_HEAD(pagepool);
- trace_erofs_readpages(inode, readahead_index(rac),
- readahead_count(rac), false);
+ trace_erofs_readpages(inode, readahead_index(rac), nr_pages, false);
f.headoffset = readahead_pos(rac);