[PATCH v10 23/25] f2fs: Pass the inode to f2fs_mpage_readpages

Matthew Wilcox willy at infradead.org
Tue Mar 24 07:22:57 AEDT 2020

From: "Matthew Wilcox (Oracle)" <willy at infradead.org>

This function now only uses the mapping argument to look up the inode,
and both callers already have the inode, so just pass the inode instead
of the mapping.

Signed-off-by: Matthew Wilcox (Oracle) <willy at infradead.org>
Reviewed-by: William Kucharski <william.kucharski at oracle.com>
Reviewed-by: Eric Biggers <ebiggers at google.com>
Reviewed-by: Chao Yu <yuchao0 at huawei.com>
Acked-by: Jaegeuk Kim <jaegeuk at kernel.org>
 fs/f2fs/data.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index 2109ce23076d..4cd76973e6c8 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -2148,12 +2148,11 @@ int f2fs_read_multi_pages(struct compress_ctx *cc, struct bio **bio_ret,
  * use ->readpage() or do the necessary surgery to decouple ->readpages()
  * from read-ahead.
-static int f2fs_mpage_readpages(struct address_space *mapping,
+static int f2fs_mpage_readpages(struct inode *inode,
 		struct readahead_control *rac, struct page *page)
 	struct bio *bio = NULL;
 	sector_t last_block_in_bio = 0;
-	struct inode *inode = mapping->host;
 	struct f2fs_map_blocks map;
 	struct compress_ctx cc = {
@@ -2265,7 +2264,7 @@ static int f2fs_read_data_page(struct file *file, struct page *page)
 	if (f2fs_has_inline_data(inode))
 		ret = f2fs_read_inline_data(inode, page);
 	if (ret == -EAGAIN)
-		ret = f2fs_mpage_readpages(page_file_mapping(page), NULL, page);
+		ret = f2fs_mpage_readpages(inode, NULL, page);
 	return ret;
@@ -2282,7 +2281,7 @@ static void f2fs_readahead(struct readahead_control *rac)
 	if (f2fs_has_inline_data(inode))
-	f2fs_mpage_readpages(rac->mapping, rac, NULL);
+	f2fs_mpage_readpages(inode, rac, NULL);
 int f2fs_encrypt_one_page(struct f2fs_io_info *fio)

More information about the Linux-erofs mailing list