public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Yue Hu <zbestahu@gmail.com>
To: Gao Xiang <hsiangkao@linux.alibaba.com>
Cc: linux-erofs@lists.ozlabs.org, Chao Yu <chao@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	zhangwen@coolpad.com
Subject: Re: [PATCH 01/16] erofs: get rid of unneeded `inode', `map' and `sb'
Date: Fri, 15 Jul 2022 14:20:58 +0800	[thread overview]
Message-ID: <20220715142058.00005f60.zbestahu@gmail.com> (raw)
In-Reply-To: <20220714132051.46012-2-hsiangkao@linux.alibaba.com>

On Thu, 14 Jul 2022 21:20:36 +0800
Gao Xiang <hsiangkao@linux.alibaba.com> wrote:

> Since commit 5c6dcc57e2e5 ("erofs: get rid of
> `struct z_erofs_collector'"), these arguments can be dropped as well.
> 
> No logic changes.
> 
> Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
> ---
>  fs/erofs/zdata.c | 42 +++++++++++++++++++-----------------------
>  1 file changed, 19 insertions(+), 23 deletions(-)
> 
> diff --git a/fs/erofs/zdata.c b/fs/erofs/zdata.c
> index 724bb57075f6..1b6816dd235f 100644
> --- a/fs/erofs/zdata.c
> +++ b/fs/erofs/zdata.c
> @@ -404,10 +404,9 @@ static void z_erofs_try_to_claim_pcluster(struct z_erofs_decompress_frontend *f)
>  	f->mode = COLLECT_PRIMARY;
>  }
>  
> -static int z_erofs_lookup_pcluster(struct z_erofs_decompress_frontend *fe,
> -				   struct inode *inode,
> -				   struct erofs_map_blocks *map)
> +static int z_erofs_lookup_pcluster(struct z_erofs_decompress_frontend *fe)
>  {
> +	struct erofs_map_blocks *map = &fe->map;
>  	struct z_erofs_pcluster *pcl = fe->pcl;
>  	unsigned int length;
>  
> @@ -449,10 +448,9 @@ static int z_erofs_lookup_pcluster(struct z_erofs_decompress_frontend *fe,
>  	return 0;
>  }
>  
> -static int z_erofs_register_pcluster(struct z_erofs_decompress_frontend *fe,
> -				     struct inode *inode,
> -				     struct erofs_map_blocks *map)
> +static int z_erofs_register_pcluster(struct z_erofs_decompress_frontend *fe)
>  {
> +	struct erofs_map_blocks *map = &fe->map;
>  	bool ztailpacking = map->m_flags & EROFS_MAP_META;
>  	struct z_erofs_pcluster *pcl;
>  	struct erofs_workgroup *grp;
> @@ -494,7 +492,7 @@ static int z_erofs_register_pcluster(struct z_erofs_decompress_frontend *fe,
>  	} else {
>  		pcl->obj.index = map->m_pa >> PAGE_SHIFT;
>  
> -		grp = erofs_insert_workgroup(inode->i_sb, &pcl->obj);
> +		grp = erofs_insert_workgroup(fe->inode->i_sb, &pcl->obj);
>  		if (IS_ERR(grp)) {
>  			err = PTR_ERR(grp);
>  			goto err_out;
> @@ -520,10 +518,9 @@ static int z_erofs_register_pcluster(struct z_erofs_decompress_frontend *fe,
>  	return err;
>  }
>  
> -static int z_erofs_collector_begin(struct z_erofs_decompress_frontend *fe,
> -				   struct inode *inode,
> -				   struct erofs_map_blocks *map)
> +static int z_erofs_collector_begin(struct z_erofs_decompress_frontend *fe)
>  {
> +	struct erofs_map_blocks *map = &fe->map;
>  	struct erofs_workgroup *grp;
>  	int ret;
>  
> @@ -541,19 +538,19 @@ static int z_erofs_collector_begin(struct z_erofs_decompress_frontend *fe,
>  		goto tailpacking;
>  	}
>  
> -	grp = erofs_find_workgroup(inode->i_sb, map->m_pa >> PAGE_SHIFT);
> +	grp = erofs_find_workgroup(fe->inode->i_sb, map->m_pa >> PAGE_SHIFT);
>  	if (grp) {
>  		fe->pcl = container_of(grp, struct z_erofs_pcluster, obj);
>  	} else {
>  tailpacking:
> -		ret = z_erofs_register_pcluster(fe, inode, map);
> +		ret = z_erofs_register_pcluster(fe);
>  		if (!ret)
>  			goto out;
>  		if (ret != -EEXIST)
>  			return ret;
>  	}
>  
> -	ret = z_erofs_lookup_pcluster(fe, inode, map);
> +	ret = z_erofs_lookup_pcluster(fe);
>  	if (ret) {
>  		erofs_workgroup_put(&fe->pcl->obj);
>  		return ret;
> @@ -663,7 +660,7 @@ static int z_erofs_do_read_page(struct z_erofs_decompress_frontend *fe,
>  	if (!(map->m_flags & EROFS_MAP_MAPPED))
>  		goto hitted;
>  
> -	err = z_erofs_collector_begin(fe, inode, map);
> +	err = z_erofs_collector_begin(fe);
>  	if (err)
>  		goto err_out;
>  
> @@ -1259,13 +1256,13 @@ static void z_erofs_decompressqueue_endio(struct bio *bio)
>  	bio_put(bio);
>  }
>  
> -static void z_erofs_submit_queue(struct super_block *sb,
> -				 struct z_erofs_decompress_frontend *f,
> +static void z_erofs_submit_queue(struct z_erofs_decompress_frontend *f,
>  				 struct page **pagepool,
>  				 struct z_erofs_decompressqueue *fgq,
>  				 bool *force_fg)
>  {
> -	struct erofs_sb_info *const sbi = EROFS_SB(sb);
> +	struct super_block *sb = f->inode->i_sb;
> +	struct address_space *mc = MNGD_MAPPING(EROFS_SB(sb));
>  	z_erofs_next_pcluster_t qtail[NR_JOBQUEUES];
>  	struct z_erofs_decompressqueue *q[NR_JOBQUEUES];
>  	void *bi_private;
> @@ -1317,7 +1314,7 @@ static void z_erofs_submit_queue(struct super_block *sb,
>  			struct page *page;
>  
>  			page = pickup_page_for_submission(pcl, i++, pagepool,
> -							  MNGD_MAPPING(sbi));
> +							  mc);
>  			if (!page)
>  				continue;
>  
> @@ -1369,15 +1366,14 @@ static void z_erofs_submit_queue(struct super_block *sb,
>  	z_erofs_decompress_kickoff(q[JQ_SUBMIT], *force_fg, nr_bios);
>  }
>  
> -static void z_erofs_runqueue(struct super_block *sb,
> -			     struct z_erofs_decompress_frontend *f,
> +static void z_erofs_runqueue(struct z_erofs_decompress_frontend *f,
>  			     struct page **pagepool, bool force_fg)
>  {
>  	struct z_erofs_decompressqueue io[NR_JOBQUEUES];
>  
>  	if (f->owned_head == Z_EROFS_PCLUSTER_TAIL)
>  		return;
> -	z_erofs_submit_queue(sb, f, pagepool, io, &force_fg);
> +	z_erofs_submit_queue(f, pagepool, io, &force_fg);
>  
>  	/* handle bypass queue (no i/o pclusters) immediately */
>  	z_erofs_decompress_queue(&io[JQ_BYPASS], pagepool);
> @@ -1475,7 +1471,7 @@ static int z_erofs_read_folio(struct file *file, struct folio *folio)
>  	(void)z_erofs_collector_end(&f);
>  
>  	/* if some compressed cluster ready, need submit them anyway */
> -	z_erofs_runqueue(inode->i_sb, &f, &pagepool,
> +	z_erofs_runqueue(&f, &pagepool,
>  			 z_erofs_get_sync_decompress_policy(sbi, 0));
>  
>  	if (err)
> @@ -1524,7 +1520,7 @@ static void z_erofs_readahead(struct readahead_control *rac)
>  	z_erofs_pcluster_readmore(&f, rac, 0, &pagepool, false);
>  	(void)z_erofs_collector_end(&f);
>  
> -	z_erofs_runqueue(inode->i_sb, &f, &pagepool,
> +	z_erofs_runqueue(&f, &pagepool,
>  			 z_erofs_get_sync_decompress_policy(sbi, nr_pages));
>  	erofs_put_metabuf(&f.map.buf);
>  	erofs_release_pages(&pagepool);

Reviewed-by: Yue Hu <huyue2@coolpad.com>

  reply	other threads:[~2022-07-15  6:19 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-14 13:20 [PATCH 00/16] erofs: prepare for folios, duplication and kill PG_error Gao Xiang
2022-07-14 13:20 ` [PATCH 01/16] erofs: get rid of unneeded `inode', `map' and `sb' Gao Xiang
2022-07-15  6:20   ` Yue Hu [this message]
2022-07-14 13:20 ` [PATCH 02/16] erofs: clean up z_erofs_collector_begin() Gao Xiang
2022-07-15  6:22   ` Yue Hu
2022-07-14 13:20 ` [PATCH 03/16] erofs: introduce `z_erofs_parse_out_bvecs()' Gao Xiang
2022-07-15  6:22   ` Yue Hu
2022-07-14 13:20 ` [PATCH 04/16] erofs: introduce bufvec to store decompressed buffers Gao Xiang
2022-07-15  6:29   ` Yue Hu
2022-07-15  6:36     ` Gao Xiang
2022-07-14 13:20 ` [PATCH 05/16] erofs: drop the old pagevec approach Gao Xiang
2022-07-15  7:07   ` Yue Hu
2022-07-15  7:19     ` Gao Xiang
2022-07-15  7:45       ` Yue Hu
2022-07-14 13:20 ` [PATCH 06/16] erofs: introduce `z_erofs_parse_in_bvecs' Gao Xiang
2022-07-14 13:20 ` [PATCH 07/16] erofs: switch compressed_pages[] to bufvec Gao Xiang
2022-07-15  7:53   ` Yue Hu
2022-07-15  7:59     ` Gao Xiang
2022-07-14 13:20 ` [PATCH 08/16] erofs: rework online page handling Gao Xiang
2022-07-14 13:20 ` [PATCH 09/16] erofs: get rid of `enum z_erofs_page_type' Gao Xiang
2022-07-14 13:20 ` [PATCH 10/16] erofs: clean up `enum z_erofs_collectmode' Gao Xiang
2022-07-14 13:20 ` [PATCH 11/16] erofs: get rid of `z_pagemap_global' Gao Xiang
2022-07-14 13:20 ` [PATCH 12/16] erofs: introduce struct z_erofs_decompress_backend Gao Xiang
2022-07-14 13:20 ` [PATCH 13/16] erofs: try to leave (de)compressed_pages on stack if possible Gao Xiang
2022-07-14 13:20 ` [PATCH 14/16] erofs: introduce z_erofs_do_decompressed_bvec() Gao Xiang
2022-07-14 13:20 ` [PATCH 15/16] erofs: record the longest decompressed size in this round Gao Xiang
2022-07-14 13:20 ` [PATCH 16/16] erofs: introduce multi-reference pclusters (fully-referenced) Gao Xiang
2022-07-14 13:38 ` [PATCH 00/16] erofs: prepare for folios, duplication and kill PG_error Gao Xiang

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=20220715142058.00005f60.zbestahu@gmail.com \
    --to=zbestahu@gmail.com \
    --cc=chao@kernel.org \
    --cc=hsiangkao@linux.alibaba.com \
    --cc=linux-erofs@lists.ozlabs.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=zhangwen@coolpad.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