@@ -507,19 +507,17 @@ enum z_erofs_pclustermode {
507
507
*/
508
508
Z_EROFS_PCLUSTER_FOLLOWED_NOINPLACE ,
509
509
/*
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_____|
521
519
*
522
- * [ (*) the above page can be used as inplace I/O. ]
520
+ * [ (*) the page above can be used as inplace I/O. ]
523
521
*/
524
522
Z_EROFS_PCLUSTER_FOLLOWED ,
525
523
};
@@ -851,7 +849,7 @@ static int z_erofs_register_pcluster(struct z_erofs_decompress_frontend *fe)
851
849
return err ;
852
850
}
853
851
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 )
855
853
{
856
854
struct erofs_map_blocks * map = & fe -> map ;
857
855
struct erofs_workgroup * grp = NULL ;
@@ -908,12 +906,12 @@ void erofs_workgroup_free_rcu(struct erofs_workgroup *grp)
908
906
call_rcu (& pcl -> rcu , z_erofs_rcu_callback );
909
907
}
910
908
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 )
912
910
{
913
911
struct z_erofs_pcluster * pcl = fe -> pcl ;
914
912
915
913
if (!pcl )
916
- return false ;
914
+ return ;
917
915
918
916
z_erofs_bvec_iter_end (& fe -> biter );
919
917
mutex_unlock (& pcl -> lock );
@@ -929,7 +927,7 @@ static bool z_erofs_collector_end(struct z_erofs_decompress_frontend *fe)
929
927
erofs_workgroup_put (& pcl -> obj );
930
928
931
929
fe -> pcl = NULL ;
932
- return true ;
930
+ fe -> backmost = false ;
933
931
}
934
932
935
933
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
976
979
977
if (offset + cur < map -> m_la ||
980
978
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 );
983
980
map -> m_la = offset + cur ;
984
981
map -> m_llen = 0 ;
985
982
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
992
map -> m_flags & EROFS_MAP_FRAGMENT )
996
993
goto hitted ;
997
994
998
- err = z_erofs_collector_begin (fe );
995
+ err = z_erofs_pcluster_begin (fe );
999
996
if (err )
1000
997
goto out ;
1001
998
@@ -1862,7 +1859,7 @@ static int z_erofs_read_folio(struct file *file, struct folio *folio)
1862
1859
z_erofs_pcluster_readmore (& f , NULL , true);
1863
1860
err = z_erofs_do_read_page (& f , page );
1864
1861
z_erofs_pcluster_readmore (& f , NULL , false);
1865
- ( void ) z_erofs_collector_end (& f );
1862
+ z_erofs_pcluster_end (& f );
1866
1863
1867
1864
/* if some compressed cluster ready, need submit them anyway */
1868
1865
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
1906
put_page (page );
1910
1907
}
1911
1908
z_erofs_pcluster_readmore (& f , rac , false);
1912
- ( void ) z_erofs_collector_end (& f );
1909
+ z_erofs_pcluster_end (& f );
1913
1910
1914
1911
z_erofs_runqueue (& f , z_erofs_is_sync_decompress (sbi , nr_pages ), true);
1915
1912
erofs_put_metabuf (& f .map .buf );
0 commit comments