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

Unverified Commit 8e64e25a authored by Chao Yu's avatar Chao Yu Committed by Michael Bestas
Browse files

erofs: remove unneeded parameter



After commit 0615090c5044 ("erofs: convert compressed files from
readpages to readahead"), add_to_page_cache_lru() was moved to mm
code, so that in below call path, no page will be cached into
@pagepool list or grabbed from @pagepool list:
- z_erofs_readpage
 - z_erofs_do_read_page
  - preload_compressed_pages
  - erofs_allocpage

Let's get rid of this unneeded @pagepool parameter.

Change-Id: I2c3b8555b1f183b5d44fa8c4ce410ac0b44bb594
Signed-off-by: default avatarChao Yu <yuchao0@huawei.com>
Link: https://lore.kernel.org/r/20200917011821.22767-1-yuchao0@huawei.com


Reviewed-by: default avatarGao Xiang <hsiangkao@redhat.com>
Signed-off-by: default avatarGao Xiang <hsiangkao@redhat.com>
parent c2741e1c
Loading
Loading
Loading
Loading
+6 −9
Original line number Diff line number Diff line
@@ -153,8 +153,7 @@ static DEFINE_MUTEX(z_pagemap_global_lock);

static void preload_compressed_pages(struct z_erofs_collector *clt,
				     struct address_space *mc,
				     enum z_erofs_cache_alloctype type,
				     struct list_head *pagepool)
				     enum z_erofs_cache_alloctype type)
{
	const struct z_erofs_pcluster *pcl = clt->pcl;
	const unsigned int clusterpages = BIT(pcl->clusterbits);
@@ -560,8 +559,7 @@ static bool should_alloc_managed_pages(struct z_erofs_decompress_frontend *fe,
}

static int z_erofs_do_read_page(struct z_erofs_decompress_frontend *fe,
				struct page *page,
				struct list_head *pagepool)
				struct page *page)
{
	struct inode *const inode = fe->inode;
	struct erofs_sb_info *const sbi = EROFS_I_SB(inode);
@@ -618,8 +616,7 @@ static int z_erofs_do_read_page(struct z_erofs_decompress_frontend *fe,
	else
		cache_strategy = DONTALLOC;

	preload_compressed_pages(clt, MNGD_MAPPING(sbi),
				 cache_strategy, pagepool);
	preload_compressed_pages(clt, MNGD_MAPPING(sbi), cache_strategy);

hitted:
	/*
@@ -654,7 +651,7 @@ static int z_erofs_do_read_page(struct z_erofs_decompress_frontend *fe,
	/* should allocate an additional staging page for pagevec */
	if (err == -EAGAIN) {
		struct page *const newpage =
			erofs_allocpage(pagepool, GFP_NOFS | __GFP_NOFAIL);
				alloc_page(GFP_NOFS | __GFP_NOFAIL);

		newpage->mapping = Z_EROFS_MAPPING_STAGING;
		err = z_erofs_attach_page(clt, newpage,
@@ -1283,7 +1280,7 @@ static int z_erofs_readpage(struct file *file, struct page *page)

	f.headoffset = (erofs_off_t)page->index << PAGE_SHIFT;

	err = z_erofs_do_read_page(&f, page, &pagepool);
	err = z_erofs_do_read_page(&f, page);
	(void)z_erofs_collector_end(&f.clt);

	/* if some compressed cluster ready, need submit them anyway */
@@ -1352,7 +1349,7 @@ static int z_erofs_readpages(struct file *filp, struct address_space *mapping,
		/* traversal in reverse order */
		head = (void *)page_private(page);

		err = z_erofs_do_read_page(&f, page, &pagepool);
		err = z_erofs_do_read_page(&f, page);
		if (err)
			erofs_err(inode->i_sb,
				  "readahead error at page %lu @ nid %llu",