Skip to content

Commit dcba1b2

Browse files
committed
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 87ca34a ("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 <[email protected]> Reviewed-by: Chao Yu <[email protected]> Signed-off-by: Gao Xiang <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 8b00be1 commit dcba1b2

File tree

1 file changed

+18
-21
lines changed

1 file changed

+18
-21
lines changed

fs/erofs/zdata.c

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -507,19 +507,17 @@ enum z_erofs_pclustermode {
507507
*/
508508
Z_EROFS_PCLUSTER_FOLLOWED_NOINPLACE,
509509
/*
510-
* The current collection has been linked with the owned chain, and
511-
* could also be linked with the remaining collections, which means
512-
* if the processing page is the tail page of the collection, thus
513-
* the current collection can safely use the whole page (since
514-
* the previous collection is under control) for in-place I/O, as
515-
* illustrated below:
516-
* ________________________________________________________________
517-
* | tail (partial) page | head (partial) page |
518-
* | (of the current cl) | (of the previous collection) |
519-
* | | |
520-
* |__PCLUSTER_FOLLOWED___|___________PCLUSTER_FOLLOWED____________|
510+
* The pcluster was just linked to a decompression chain by us. It can
511+
* also be linked with the remaining pclusters, which means if the
512+
* processing page is the tail page of a pcluster, this pcluster can
513+
* safely use the whole page (since the previous pcluster is within the
514+
* same chain) for in-place I/O, as illustrated below:
515+
* ___________________________________________________
516+
* | tail (partial) page | head (partial) page |
517+
* | (of the current pcl) | (of the previous pcl) |
518+
* |___PCLUSTER_FOLLOWED___|_____PCLUSTER_FOLLOWED_____|
521519
*
522-
* [ (*) the above page can be used as inplace I/O. ]
520+
* [ (*) the page above can be used as inplace I/O. ]
523521
*/
524522
Z_EROFS_PCLUSTER_FOLLOWED,
525523
};
@@ -851,7 +849,7 @@ static int z_erofs_register_pcluster(struct z_erofs_decompress_frontend *fe)
851849
return err;
852850
}
853851

854-
static int z_erofs_collector_begin(struct z_erofs_decompress_frontend *fe)
852+
static int z_erofs_pcluster_begin(struct z_erofs_decompress_frontend *fe)
855853
{
856854
struct erofs_map_blocks *map = &fe->map;
857855
struct erofs_workgroup *grp = NULL;
@@ -908,12 +906,12 @@ void erofs_workgroup_free_rcu(struct erofs_workgroup *grp)
908906
call_rcu(&pcl->rcu, z_erofs_rcu_callback);
909907
}
910908

911-
static bool z_erofs_collector_end(struct z_erofs_decompress_frontend *fe)
909+
static void z_erofs_pcluster_end(struct z_erofs_decompress_frontend *fe)
912910
{
913911
struct z_erofs_pcluster *pcl = fe->pcl;
914912

915913
if (!pcl)
916-
return false;
914+
return;
917915

918916
z_erofs_bvec_iter_end(&fe->biter);
919917
mutex_unlock(&pcl->lock);
@@ -929,7 +927,7 @@ static bool z_erofs_collector_end(struct z_erofs_decompress_frontend *fe)
929927
erofs_workgroup_put(&pcl->obj);
930928

931929
fe->pcl = NULL;
932-
return true;
930+
fe->backmost = false;
933931
}
934932

935933
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,
978976

979977
if (offset + cur < map->m_la ||
980978
offset + cur >= map->m_la + map->m_llen) {
981-
if (z_erofs_collector_end(fe))
982-
fe->backmost = false;
979+
z_erofs_pcluster_end(fe);
983980
map->m_la = offset + cur;
984981
map->m_llen = 0;
985982
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,
995992
map->m_flags & EROFS_MAP_FRAGMENT)
996993
goto hitted;
997994

998-
err = z_erofs_collector_begin(fe);
995+
err = z_erofs_pcluster_begin(fe);
999996
if (err)
1000997
goto out;
1001998

@@ -1862,7 +1859,7 @@ static int z_erofs_read_folio(struct file *file, struct folio *folio)
18621859
z_erofs_pcluster_readmore(&f, NULL, true);
18631860
err = z_erofs_do_read_page(&f, page);
18641861
z_erofs_pcluster_readmore(&f, NULL, false);
1865-
(void)z_erofs_collector_end(&f);
1862+
z_erofs_pcluster_end(&f);
18661863

18671864
/* if some compressed cluster ready, need submit them anyway */
18681865
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)
19091906
put_page(page);
19101907
}
19111908
z_erofs_pcluster_readmore(&f, rac, false);
1912-
(void)z_erofs_collector_end(&f);
1909+
z_erofs_pcluster_end(&f);
19131910

19141911
z_erofs_runqueue(&f, z_erofs_is_sync_decompress(sbi, nr_pages), true);
19151912
erofs_put_metabuf(&f.map.buf);

0 commit comments

Comments
 (0)