]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
f2fs: Convert __read_io_type() to take a folio
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Thu, 28 Nov 2024 04:58:25 +0000 (04:58 +0000)
committerJaegeuk Kim <jaegeuk@kernel.org>
Mon, 16 Dec 2024 16:12:23 +0000 (16:12 +0000)
Remove the last call to page_file_mapping() as both callers can now pass
in a folio.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/data.c

index 30d727808c928b35d6bece50c00afb45c8e86198..e68a4dd9bc177d17c6a2d6c37c197ba9f240aab8 100644 (file)
@@ -70,9 +70,9 @@ bool f2fs_is_cp_guaranteed(struct page *page)
        return false;
 }
 
-static enum count_type __read_io_type(struct page *page)
+static enum count_type __read_io_type(struct folio *folio)
 {
-       struct address_space *mapping = page_file_mapping(page);
+       struct address_space *mapping = folio->mapping;
 
        if (mapping) {
                struct inode *inode = mapping->host;
@@ -150,7 +150,7 @@ static void f2fs_finish_read_bio(struct bio *bio, bool in_task)
                        continue;
                }
 
-               dec_page_count(F2FS_F_SB(folio), __read_io_type(&folio->page));
+               dec_page_count(F2FS_F_SB(folio), __read_io_type(folio));
                folio_end_read(folio, bio->bi_status == 0);
        }
 
@@ -706,7 +706,7 @@ int f2fs_submit_page_bio(struct f2fs_io_info *fio)
                wbc_account_cgroup_owner(fio->io_wbc, fio_folio, PAGE_SIZE);
 
        inc_page_count(fio->sbi, is_read_io(fio->op) ?
-                       __read_io_type(&data_folio->page) : WB_DATA_TYPE(fio->page, false));
+                       __read_io_type(data_folio) : WB_DATA_TYPE(fio->page, false));
 
        if (is_read_io(bio_op(bio)))
                f2fs_submit_read_bio(fio->sbi, bio, fio->type);