Skip to content

Commit 2b872b0

Browse files
dhowellshsiangkao
authored andcommitted
erofs: Don't use certain unnecessary folio_*() functions
Filesystems should use folio->index and folio->mapping, instead of folio_index(folio), folio_mapping() and folio_file_mapping() since they know that it's in the pagecache. Change this automagically with: perl -p -i -e 's/folio_mapping[(]([^)]*)[)]/\1->mapping/g' fs/erofs/*.c perl -p -i -e 's/folio_file_mapping[(]([^)]*)[)]/\1->mapping/g' fs/erofs/*.c perl -p -i -e 's/folio_index[(]([^)]*)[)]/\1->index/g' fs/erofs/*.c Reported-by: Matthew Wilcox <[email protected]> Signed-off-by: David Howells <[email protected]> Reviewed-by: Jeff Layton <[email protected]> Cc: Chao Yu <[email protected]> Cc: Yue Hu <[email protected]> Cc: Jeffle Xu <[email protected]> Cc: [email protected] Cc: [email protected] Signed-off-by: Gao Xiang <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 118a8cf commit 2b872b0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

fs/erofs/fscache.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,10 +165,10 @@ static int erofs_fscache_read_folios_async(struct fscache_cookie *cookie,
165165
static int erofs_fscache_meta_read_folio(struct file *data, struct folio *folio)
166166
{
167167
int ret;
168-
struct erofs_fscache *ctx = folio_mapping(folio)->host->i_private;
168+
struct erofs_fscache *ctx = folio->mapping->host->i_private;
169169
struct erofs_fscache_request *req;
170170

171-
req = erofs_fscache_req_alloc(folio_mapping(folio),
171+
req = erofs_fscache_req_alloc(folio->mapping,
172172
folio_pos(folio), folio_size(folio));
173173
if (IS_ERR(req)) {
174174
folio_unlock(folio);
@@ -276,7 +276,7 @@ static int erofs_fscache_read_folio(struct file *file, struct folio *folio)
276276
struct erofs_fscache_request *req;
277277
int ret;
278278

279-
req = erofs_fscache_req_alloc(folio_mapping(folio),
279+
req = erofs_fscache_req_alloc(folio->mapping,
280280
folio_pos(folio), folio_size(folio));
281281
if (IS_ERR(req)) {
282282
folio_unlock(folio);

0 commit comments

Comments
 (0)