BACKPORT: erofs: avoid obsolete {collector,collection} terms
{collector,collection} were once reserved in order to indicate different
runtime logical extent instance of multi-reference pclusters.
However, de-duplicated decompression has been landed in a more flexable
way, thus `struct z_erofs_collection` was formally removed in commit
87ca34a706
("erofs: get rid of `struct z_erofs_collection'").
Let's handle the remaining leftovers, for example:
`z_erofs_collector_begin` => `z_erofs_pcluster_begin`
`z_erofs_collector_end` => `z_erofs_pcluster_end`
as well as some comments. No logic changes.
Reviewed-by: Yue Hu <huyue2@coolpad.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Link: https://lore.kernel.org/r/20230817082813.81180-2-hsiangkao@linux.alibaba.com
Bug: 318378021
Change-Id: I61b812b5ae3dd564e52012d082415b1fc198383d
(cherry picked from commit dcba1b232e26ebadbd215728199455d38a59253e)
[dhavale: fixed minor conflict zdata.c in z_erofs_do_read_page()]
Signed-off-by: Sandeep Dhavale <dhavale@google.com>
This commit is contained in:
parent
d0dbf74792
commit
7751567a71
@ -512,19 +512,17 @@ enum z_erofs_pclustermode {
|
||||
*/
|
||||
Z_EROFS_PCLUSTER_FOLLOWED_NOINPLACE,
|
||||
/*
|
||||
* The current collection has been linked with the owned chain, and
|
||||
* could also be linked with the remaining collections, which means
|
||||
* if the processing page is the tail page of the collection, thus
|
||||
* the current collection can safely use the whole page (since
|
||||
* the previous collection is under control) for in-place I/O, as
|
||||
* illustrated below:
|
||||
* ________________________________________________________________
|
||||
* | tail (partial) page | head (partial) page |
|
||||
* | (of the current cl) | (of the previous collection) |
|
||||
* | | |
|
||||
* |__PCLUSTER_FOLLOWED___|___________PCLUSTER_FOLLOWED____________|
|
||||
* The pcluster was just linked to a decompression chain by us. It can
|
||||
* also be linked with the remaining pclusters, which means if the
|
||||
* processing page is the tail page of a pcluster, this pcluster can
|
||||
* safely use the whole page (since the previous pcluster is within the
|
||||
* same chain) for in-place I/O, as illustrated below:
|
||||
* ___________________________________________________
|
||||
* | tail (partial) page | head (partial) page |
|
||||
* | (of the current pcl) | (of the previous pcl) |
|
||||
* |___PCLUSTER_FOLLOWED___|_____PCLUSTER_FOLLOWED_____|
|
||||
*
|
||||
* [ (*) the above page can be used as inplace I/O. ]
|
||||
* [ (*) the page above can be used as inplace I/O. ]
|
||||
*/
|
||||
Z_EROFS_PCLUSTER_FOLLOWED,
|
||||
};
|
||||
@ -855,7 +853,7 @@ 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)
|
||||
static int z_erofs_pcluster_begin(struct z_erofs_decompress_frontend *fe)
|
||||
{
|
||||
struct erofs_map_blocks *map = &fe->map;
|
||||
struct erofs_workgroup *grp = NULL;
|
||||
@ -912,12 +910,12 @@ void erofs_workgroup_free_rcu(struct erofs_workgroup *grp)
|
||||
call_rcu(&pcl->rcu, z_erofs_rcu_callback);
|
||||
}
|
||||
|
||||
static bool z_erofs_collector_end(struct z_erofs_decompress_frontend *fe)
|
||||
static void z_erofs_pcluster_end(struct z_erofs_decompress_frontend *fe)
|
||||
{
|
||||
struct z_erofs_pcluster *pcl = fe->pcl;
|
||||
|
||||
if (!pcl)
|
||||
return false;
|
||||
return;
|
||||
|
||||
z_erofs_bvec_iter_end(&fe->biter);
|
||||
mutex_unlock(&pcl->lock);
|
||||
@ -933,7 +931,7 @@ static bool z_erofs_collector_end(struct z_erofs_decompress_frontend *fe)
|
||||
erofs_workgroup_put(&pcl->obj);
|
||||
|
||||
fe->pcl = NULL;
|
||||
return true;
|
||||
fe->backmost = false;
|
||||
}
|
||||
|
||||
static int z_erofs_read_fragment(struct super_block *sb, struct page *page,
|
||||
@ -984,8 +982,7 @@ static int z_erofs_do_read_page(struct z_erofs_decompress_frontend *fe,
|
||||
offset + cur >= map->m_la + map->m_llen) {
|
||||
erofs_dbg("out-of-range map @ pos %llu", offset + cur);
|
||||
|
||||
if (z_erofs_collector_end(fe))
|
||||
fe->backmost = false;
|
||||
z_erofs_pcluster_end(fe);
|
||||
map->m_la = offset + cur;
|
||||
map->m_llen = 0;
|
||||
err = z_erofs_map_blocks_iter(inode, map, 0);
|
||||
@ -1001,7 +998,7 @@ static int z_erofs_do_read_page(struct z_erofs_decompress_frontend *fe,
|
||||
map->m_flags & EROFS_MAP_FRAGMENT)
|
||||
goto hitted;
|
||||
|
||||
err = z_erofs_collector_begin(fe);
|
||||
err = z_erofs_pcluster_begin(fe);
|
||||
if (err)
|
||||
goto out;
|
||||
|
||||
@ -1877,7 +1874,7 @@ static int z_erofs_read_folio(struct file *file, struct folio *folio)
|
||||
z_erofs_pcluster_readmore(&f, NULL, true);
|
||||
err = z_erofs_do_read_page(&f, page);
|
||||
z_erofs_pcluster_readmore(&f, NULL, false);
|
||||
(void)z_erofs_collector_end(&f);
|
||||
z_erofs_pcluster_end(&f);
|
||||
|
||||
/* if some compressed cluster ready, need submit them anyway */
|
||||
z_erofs_runqueue(&f, z_erofs_is_sync_decompress(sbi, 0), false);
|
||||
@ -1924,7 +1921,7 @@ static void z_erofs_readahead(struct readahead_control *rac)
|
||||
put_page(page);
|
||||
}
|
||||
z_erofs_pcluster_readmore(&f, rac, false);
|
||||
(void)z_erofs_collector_end(&f);
|
||||
z_erofs_pcluster_end(&f);
|
||||
|
||||
z_erofs_runqueue(&f, z_erofs_is_sync_decompress(sbi, nr_pages), true);
|
||||
erofs_put_metabuf(&f.map.buf);
|
||||
|
Loading…
Reference in New Issue
Block a user