Commit 83a386c0 authored by Gao Xiang's avatar Gao Xiang

erofs: get rid of unneeded `inode', `map' and `sb'

Since commit 5c6dcc57 ("erofs: get rid of
`struct z_erofs_collector'"), these arguments can be dropped as well.

No logic changes.
Reviewed-by: default avatarYue Hu <huyue2@coolpad.com>
Acked-by: default avatarChao Yu <chao@kernel.org>
Signed-off-by: default avatarGao Xiang <hsiangkao@linux.alibaba.com>
Link: https://lore.kernel.org/r/20220715154203.48093-2-hsiangkao@linux.alibaba.com
parent 448b5a15
...@@ -404,10 +404,9 @@ static void z_erofs_try_to_claim_pcluster(struct z_erofs_decompress_frontend *f) ...@@ -404,10 +404,9 @@ static void z_erofs_try_to_claim_pcluster(struct z_erofs_decompress_frontend *f)
f->mode = COLLECT_PRIMARY; f->mode = COLLECT_PRIMARY;
} }
static int z_erofs_lookup_pcluster(struct z_erofs_decompress_frontend *fe, static int z_erofs_lookup_pcluster(struct z_erofs_decompress_frontend *fe)
struct inode *inode,
struct erofs_map_blocks *map)
{ {
struct erofs_map_blocks *map = &fe->map;
struct z_erofs_pcluster *pcl = fe->pcl; struct z_erofs_pcluster *pcl = fe->pcl;
unsigned int length; unsigned int length;
...@@ -449,10 +448,9 @@ static int z_erofs_lookup_pcluster(struct z_erofs_decompress_frontend *fe, ...@@ -449,10 +448,9 @@ static int z_erofs_lookup_pcluster(struct z_erofs_decompress_frontend *fe,
return 0; return 0;
} }
static int z_erofs_register_pcluster(struct z_erofs_decompress_frontend *fe, static int z_erofs_register_pcluster(struct z_erofs_decompress_frontend *fe)
struct inode *inode,
struct erofs_map_blocks *map)
{ {
struct erofs_map_blocks *map = &fe->map;
bool ztailpacking = map->m_flags & EROFS_MAP_META; bool ztailpacking = map->m_flags & EROFS_MAP_META;
struct z_erofs_pcluster *pcl; struct z_erofs_pcluster *pcl;
struct erofs_workgroup *grp; struct erofs_workgroup *grp;
...@@ -494,7 +492,7 @@ static int z_erofs_register_pcluster(struct z_erofs_decompress_frontend *fe, ...@@ -494,7 +492,7 @@ static int z_erofs_register_pcluster(struct z_erofs_decompress_frontend *fe,
} else { } else {
pcl->obj.index = map->m_pa >> PAGE_SHIFT; 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)) { if (IS_ERR(grp)) {
err = PTR_ERR(grp); err = PTR_ERR(grp);
goto err_out; goto err_out;
...@@ -520,10 +518,9 @@ static int z_erofs_register_pcluster(struct z_erofs_decompress_frontend *fe, ...@@ -520,10 +518,9 @@ static int z_erofs_register_pcluster(struct z_erofs_decompress_frontend *fe,
return err; return err;
} }
static int z_erofs_collector_begin(struct z_erofs_decompress_frontend *fe, static int z_erofs_collector_begin(struct z_erofs_decompress_frontend *fe)
struct inode *inode,
struct erofs_map_blocks *map)
{ {
struct erofs_map_blocks *map = &fe->map;
struct erofs_workgroup *grp; struct erofs_workgroup *grp;
int ret; int ret;
...@@ -541,19 +538,19 @@ static int z_erofs_collector_begin(struct z_erofs_decompress_frontend *fe, ...@@ -541,19 +538,19 @@ static int z_erofs_collector_begin(struct z_erofs_decompress_frontend *fe,
goto tailpacking; 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) { if (grp) {
fe->pcl = container_of(grp, struct z_erofs_pcluster, obj); fe->pcl = container_of(grp, struct z_erofs_pcluster, obj);
} else { } else {
tailpacking: tailpacking:
ret = z_erofs_register_pcluster(fe, inode, map); ret = z_erofs_register_pcluster(fe);
if (!ret) if (!ret)
goto out; goto out;
if (ret != -EEXIST) if (ret != -EEXIST)
return ret; return ret;
} }
ret = z_erofs_lookup_pcluster(fe, inode, map); ret = z_erofs_lookup_pcluster(fe);
if (ret) { if (ret) {
erofs_workgroup_put(&fe->pcl->obj); erofs_workgroup_put(&fe->pcl->obj);
return ret; return ret;
...@@ -663,7 +660,7 @@ static int z_erofs_do_read_page(struct z_erofs_decompress_frontend *fe, ...@@ -663,7 +660,7 @@ static int z_erofs_do_read_page(struct z_erofs_decompress_frontend *fe,
if (!(map->m_flags & EROFS_MAP_MAPPED)) if (!(map->m_flags & EROFS_MAP_MAPPED))
goto hitted; goto hitted;
err = z_erofs_collector_begin(fe, inode, map); err = z_erofs_collector_begin(fe);
if (err) if (err)
goto err_out; goto err_out;
...@@ -1259,13 +1256,13 @@ static void z_erofs_decompressqueue_endio(struct bio *bio) ...@@ -1259,13 +1256,13 @@ static void z_erofs_decompressqueue_endio(struct bio *bio)
bio_put(bio); bio_put(bio);
} }
static void z_erofs_submit_queue(struct super_block *sb, static void z_erofs_submit_queue(struct z_erofs_decompress_frontend *f,
struct z_erofs_decompress_frontend *f,
struct page **pagepool, struct page **pagepool,
struct z_erofs_decompressqueue *fgq, struct z_erofs_decompressqueue *fgq,
bool *force_fg) 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]; z_erofs_next_pcluster_t qtail[NR_JOBQUEUES];
struct z_erofs_decompressqueue *q[NR_JOBQUEUES]; struct z_erofs_decompressqueue *q[NR_JOBQUEUES];
void *bi_private; void *bi_private;
...@@ -1317,7 +1314,7 @@ static void z_erofs_submit_queue(struct super_block *sb, ...@@ -1317,7 +1314,7 @@ static void z_erofs_submit_queue(struct super_block *sb,
struct page *page; struct page *page;
page = pickup_page_for_submission(pcl, i++, pagepool, page = pickup_page_for_submission(pcl, i++, pagepool,
MNGD_MAPPING(sbi)); mc);
if (!page) if (!page)
continue; continue;
...@@ -1369,15 +1366,14 @@ static void z_erofs_submit_queue(struct super_block *sb, ...@@ -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); z_erofs_decompress_kickoff(q[JQ_SUBMIT], *force_fg, nr_bios);
} }
static void z_erofs_runqueue(struct super_block *sb, static void z_erofs_runqueue(struct z_erofs_decompress_frontend *f,
struct z_erofs_decompress_frontend *f,
struct page **pagepool, bool force_fg) struct page **pagepool, bool force_fg)
{ {
struct z_erofs_decompressqueue io[NR_JOBQUEUES]; struct z_erofs_decompressqueue io[NR_JOBQUEUES];
if (f->owned_head == Z_EROFS_PCLUSTER_TAIL) if (f->owned_head == Z_EROFS_PCLUSTER_TAIL)
return; 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 */ /* handle bypass queue (no i/o pclusters) immediately */
z_erofs_decompress_queue(&io[JQ_BYPASS], pagepool); z_erofs_decompress_queue(&io[JQ_BYPASS], pagepool);
...@@ -1475,7 +1471,7 @@ static int z_erofs_read_folio(struct file *file, struct folio *folio) ...@@ -1475,7 +1471,7 @@ static int z_erofs_read_folio(struct file *file, struct folio *folio)
(void)z_erofs_collector_end(&f); (void)z_erofs_collector_end(&f);
/* if some compressed cluster ready, need submit them anyway */ /* 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)); z_erofs_get_sync_decompress_policy(sbi, 0));
if (err) if (err)
...@@ -1524,7 +1520,7 @@ static void z_erofs_readahead(struct readahead_control *rac) ...@@ -1524,7 +1520,7 @@ static void z_erofs_readahead(struct readahead_control *rac)
z_erofs_pcluster_readmore(&f, rac, 0, &pagepool, false); z_erofs_pcluster_readmore(&f, rac, 0, &pagepool, false);
(void)z_erofs_collector_end(&f); (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)); z_erofs_get_sync_decompress_policy(sbi, nr_pages));
erofs_put_metabuf(&f.map.buf); erofs_put_metabuf(&f.map.buf);
erofs_release_pages(&pagepool); erofs_release_pages(&pagepool);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment