Commit dcba1b23 authored by Gao Xiang's avatar Gao Xiang

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
87ca34a7 ("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: default avatarYue Hu <huyue2@coolpad.com>
Reviewed-by: default avatarChao Yu <chao@kernel.org>
Signed-off-by: default avatarGao Xiang <hsiangkao@linux.alibaba.com>
Link: https://lore.kernel.org/r/20230817082813.81180-2-hsiangkao@linux.alibaba.com
parent 8b00be16
...@@ -507,19 +507,17 @@ enum z_erofs_pclustermode { ...@@ -507,19 +507,17 @@ enum z_erofs_pclustermode {
*/ */
Z_EROFS_PCLUSTER_FOLLOWED_NOINPLACE, Z_EROFS_PCLUSTER_FOLLOWED_NOINPLACE,
/* /*
* The current collection has been linked with the owned chain, and * The pcluster was just linked to a decompression chain by us. It can
* could also be linked with the remaining collections, which means * also be linked with the remaining pclusters, which means if the
* if the processing page is the tail page of the collection, thus * processing page is the tail page of a pcluster, this pcluster can
* the current collection can safely use the whole page (since * safely use the whole page (since the previous pcluster is within the
* the previous collection is under control) for in-place I/O, as * same chain) for in-place I/O, as illustrated below:
* illustrated below: * ___________________________________________________
* ________________________________________________________________ * | tail (partial) page | head (partial) page |
* | tail (partial) page | head (partial) page | * | (of the current pcl) | (of the previous pcl) |
* | (of the current cl) | (of the previous collection) | * |___PCLUSTER_FOLLOWED___|_____PCLUSTER_FOLLOWED_____|
* | | |
* |__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, Z_EROFS_PCLUSTER_FOLLOWED,
}; };
...@@ -851,7 +849,7 @@ static int z_erofs_register_pcluster(struct z_erofs_decompress_frontend *fe) ...@@ -851,7 +849,7 @@ 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_pcluster_begin(struct z_erofs_decompress_frontend *fe)
{ {
struct erofs_map_blocks *map = &fe->map; struct erofs_map_blocks *map = &fe->map;
struct erofs_workgroup *grp = NULL; struct erofs_workgroup *grp = NULL;
...@@ -908,12 +906,12 @@ void erofs_workgroup_free_rcu(struct erofs_workgroup *grp) ...@@ -908,12 +906,12 @@ void erofs_workgroup_free_rcu(struct erofs_workgroup *grp)
call_rcu(&pcl->rcu, z_erofs_rcu_callback); 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; struct z_erofs_pcluster *pcl = fe->pcl;
if (!pcl) if (!pcl)
return false; return;
z_erofs_bvec_iter_end(&fe->biter); z_erofs_bvec_iter_end(&fe->biter);
mutex_unlock(&pcl->lock); mutex_unlock(&pcl->lock);
...@@ -929,7 +927,7 @@ static bool z_erofs_collector_end(struct z_erofs_decompress_frontend *fe) ...@@ -929,7 +927,7 @@ static bool z_erofs_collector_end(struct z_erofs_decompress_frontend *fe)
erofs_workgroup_put(&pcl->obj); erofs_workgroup_put(&pcl->obj);
fe->pcl = NULL; fe->pcl = NULL;
return true; fe->backmost = false;
} }
static int z_erofs_read_fragment(struct super_block *sb, struct page *page, static int z_erofs_read_fragment(struct super_block *sb, struct page *page,
...@@ -978,8 +976,7 @@ static int z_erofs_do_read_page(struct z_erofs_decompress_frontend *fe, ...@@ -978,8 +976,7 @@ static int z_erofs_do_read_page(struct z_erofs_decompress_frontend *fe,
if (offset + cur < map->m_la || if (offset + cur < map->m_la ||
offset + cur >= map->m_la + map->m_llen) { offset + cur >= map->m_la + map->m_llen) {
if (z_erofs_collector_end(fe)) z_erofs_pcluster_end(fe);
fe->backmost = false;
map->m_la = offset + cur; map->m_la = offset + cur;
map->m_llen = 0; map->m_llen = 0;
err = z_erofs_map_blocks_iter(inode, map, 0); err = z_erofs_map_blocks_iter(inode, map, 0);
...@@ -995,7 +992,7 @@ static int z_erofs_do_read_page(struct z_erofs_decompress_frontend *fe, ...@@ -995,7 +992,7 @@ static int z_erofs_do_read_page(struct z_erofs_decompress_frontend *fe,
map->m_flags & EROFS_MAP_FRAGMENT) map->m_flags & EROFS_MAP_FRAGMENT)
goto hitted; goto hitted;
err = z_erofs_collector_begin(fe); err = z_erofs_pcluster_begin(fe);
if (err) if (err)
goto out; goto out;
...@@ -1862,7 +1859,7 @@ static int z_erofs_read_folio(struct file *file, struct folio *folio) ...@@ -1862,7 +1859,7 @@ static int z_erofs_read_folio(struct file *file, struct folio *folio)
z_erofs_pcluster_readmore(&f, NULL, true); z_erofs_pcluster_readmore(&f, NULL, true);
err = z_erofs_do_read_page(&f, page); err = z_erofs_do_read_page(&f, page);
z_erofs_pcluster_readmore(&f, NULL, false); 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 */ /* if some compressed cluster ready, need submit them anyway */
z_erofs_runqueue(&f, z_erofs_is_sync_decompress(sbi, 0), false); z_erofs_runqueue(&f, z_erofs_is_sync_decompress(sbi, 0), false);
...@@ -1909,7 +1906,7 @@ static void z_erofs_readahead(struct readahead_control *rac) ...@@ -1909,7 +1906,7 @@ static void z_erofs_readahead(struct readahead_control *rac)
put_page(page); put_page(page);
} }
z_erofs_pcluster_readmore(&f, rac, false); 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); z_erofs_runqueue(&f, z_erofs_is_sync_decompress(sbi, nr_pages), true);
erofs_put_metabuf(&f.map.buf); erofs_put_metabuf(&f.map.buf);
......
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