Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit 52f906c3 authored by Gao Xiang's avatar Gao Xiang Committed by Michael Bestas
Browse files

erofs: fold in should_decompress_synchronously()



should_decompress_synchronously() has one single condition
for now, so fold it instead.

Reviewed-by: default avatarChao Yu <yuchao0@huawei.com>
Link: https://lore.kernel.org/r/20200919072730.24989-2-hsiangkao@redhat.com


Change-Id: I54e4a519c9a423d5abd8bca9e0278470540196f1
Signed-off-by: default avatarGao Xiang <hsiangkao@redhat.com>
parent d5c15fcd
Loading
Loading
Loading
Loading
+1 −7
Original line number Diff line number Diff line
@@ -1295,19 +1295,13 @@ 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 int z_erofs_readpages(struct file *filp, struct address_space *mapping,
			     struct list_head *pages, unsigned int nr_pages)
{
	struct inode *const inode = mapping->host;
	struct erofs_sb_info *const sbi = EROFS_I_SB(inode);

	bool sync = should_decompress_synchronously(sbi, nr_pages);
	bool sync = (nr_pages <= sbi->ctx.max_sync_decompress_pages);
	struct z_erofs_decompress_frontend f = DECOMPRESS_FRONTEND_INIT(inode);
	gfp_t gfp = mapping_gfp_constraint(mapping, GFP_KERNEL);
	struct page *head = NULL;