erofs: Don't use certain internal folio_*() functions
Subsystems (2)
PATCH v2 3/4 erofs: Don't use certain internal folio_*() functions
From: David Howells <[email protected]>
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
---
Hi folks,
I tend to apply this patch upstream since compressed data fscache adaption touches this part too. If there is no objection, I'm going to take this patch separately for -next shortly..
Thanks,
Gao Xiang
Change since v1:
- a better commit message pointed out by Jeff Layton.
fs/erofs/fscache.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
fs/erofs/fscache.c +3 -3
@@ -165,10 +165,10 @@ static int erofs_fscache_read_folios_async(struct fscache_cookie *cookie,static int erofs_fscache_meta_read_folio (struct file *data,struct folio *folio) {int ret; -struct erofs_fscache *ctx =folio_mapping (folio)->host->i_private; +struct erofs_fscache *ctx = folio->mapping->host->i_private;struct erofs_fscache_request *req; - req =erofs_fscache_req_alloc (folio_mapping (folio), + req =erofs_fscache_req_alloc (folio->mapping,folio_pos (folio),folio_size (folio));if (IS_ERR (req)) {folio_unlock (folio);
@@ -276,7 +276,7 @@ static int erofs_fscache_read_folio(struct file *file, struct folio *folio)struct erofs_fscache_request *req;int ret; - req =erofs_fscache_req_alloc (folio_mapping (folio), + req =erofs_fscache_req_alloc (folio->mapping,folio_pos (folio),folio_size (folio));if (IS_ERR (req)) {folio_unlock (folio);
Signature · 1 line
2.39.3
Quoted 21 lines · Gao Xiang
From: David Howells <[email protected]>
Filesystems should use
folio->indexandfolio->mapping, instead offolio_index(folio),folio_mapping()andfolio_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/*.cperl -p -i -e 's/folio_file_mapping[(]([^)]*)[)]/\1->mapping/g'fs/erofs/*.cperl -p -i -e 's/folio_index[(]([^)]*)[)]/\1->index/g'fs/erofs/*.cReported-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]>Signed-off-by Gao Xiang <[email protected]>
Quoted 6 lines
---
Hi folks,I tend to apply this patch upstream since compressed data fscache adaption touches this part too. If there is no objection, I'm going to take this patch separately for -next shortly..
Could you change the subject? It's not that the functions are "internal", it's that filesystems don't need to use them because they're guaranteed to not see swap pages. Maybe just s/internal/unnecessary/
Quoted 38 lines
Thanks,
Gao XiangChange since v1:
- a better commit message pointed out by Jeff Layton.fs/erofs/fscache.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)fs/erofs/fscache.c +3
-3@@ -165,10 +165,10 @@ static int erofs_fscache_read_folios_async(struct fscache_cookie *cookie,static int erofs_fscache_meta_read_folio (struct file *data,struct folio *folio) {int ret; -struct erofs_fscache *ctx =folio_mapping (folio)->host->i_private; +struct erofs_fscache *ctx = folio->mapping->host->i_private;struct erofs_fscache_request *req; - req =erofs_fscache_req_alloc (folio_mapping (folio), + req =erofs_fscache_req_alloc (folio->mapping,folio_pos (folio),folio_size (folio));if (IS_ERR (req)) {folio_unlock (folio);@@ -276,7 +276,7 @@ static int erofs_fscache_read_folio(struct file *file, struct folio *folio)struct erofs_fscache_request *req;int ret; - req =erofs_fscache_req_alloc (folio_mapping (folio), + req =erofs_fscache_req_alloc (folio->mapping,folio_pos (folio),folio_size (folio));if (IS_ERR (req)) {folio_unlock (folio);Signature · 1 line
2.39.3
Hi Matthew,
Quoted 25 lines · Matthew Wilcox
Quoted 24 lines · Gao Xiang
From: David Howells <[email protected]>
Filesystems should use
folio->indexandfolio->mapping, instead offolio_index(folio),folio_mapping()andfolio_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/*.cperl -p -i -e 's/folio_file_mapping[(]([^)]*)[)]/\1->mapping/g'fs/erofs/*.cperl -p -i -e 's/folio_index[(]([^)]*)[)]/\1->index/g'fs/erofs/*.cReported-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]>Signed-off-by Gao Xiang <[email protected]>---
Hi folks,
Quoted 7 lines
Quoted 3 lines
I tend to apply this patch upstream since compressed data fscache adaption touches this part too. If there is no objection, I'm going to take this patch separately for -next shortly..
Could you change the subject? It's not that the functions are "internal", it's that filesystems don't need to use them because they're guaranteed to not see swap pages. Maybe just s/internal/unnecessary/
Yes, the subject line was inherited from the original one.
Such helpers are useful if the type of a folio is unknown, let me revise it.
Thanks,
Gao Xiang
PATCH v3 3/4 erofs: Don't use certain unnecessary folio_*() functions
In reply to Gao XiangFrom: David Howells <[email protected]>
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
---
change since v2:
- update the words s/internal/unnecessary/ in the subject line pointed out by Matthew.
fs/erofs/fscache.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
fs/erofs/fscache.c +3 -3
@@ -165,10 +165,10 @@ static int erofs_fscache_read_folios_async(struct fscache_cookie *cookie,static int erofs_fscache_meta_read_folio (struct file *data,struct folio *folio) {int ret; -struct erofs_fscache *ctx =folio_mapping (folio)->host->i_private; +struct erofs_fscache *ctx = folio->mapping->host->i_private;struct erofs_fscache_request *req; - req =erofs_fscache_req_alloc (folio_mapping (folio), + req =erofs_fscache_req_alloc (folio->mapping,folio_pos (folio),folio_size (folio));if (IS_ERR (req)) {folio_unlock (folio);
@@ -276,7 +276,7 @@ static int erofs_fscache_read_folio(struct file *file, struct folio *folio)struct erofs_fscache_request *req;int ret; - req =erofs_fscache_req_alloc (folio_mapping (folio), + req =erofs_fscache_req_alloc (folio->mapping,folio_pos (folio),folio_size (folio));if (IS_ERR (req)) {folio_unlock (folio);
Signature · 1 line
2.39.3