]> www.infradead.org Git - users/willy/pagecache.git/commitdiff
f2fs: Use a folio in add_ipu_page()
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Mon, 17 Mar 2025 04:24:06 +0000 (00:24 -0400)
committerMatthew Wilcox (Oracle) <willy@infradead.org>
Mon, 17 Mar 2025 19:55:41 +0000 (15:55 -0400)
Convert the incoming page to a folio at the start, then use the
folio later in the function.  Moves a call to page_folio() earlier,
and removes an access to page->mapping.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
fs/f2fs/data.c

index b73260c38c5e2c1362abe6cf56f29185d801e2e9..e61bbc5f833a2adf1ab054ab49197f12c8bf2f80 100644 (file)
@@ -779,6 +779,7 @@ static void del_bio_entry(struct bio_entry *be)
 static int add_ipu_page(struct f2fs_io_info *fio, struct bio **bio,
                                                        struct page *page)
 {
+       struct folio *fio_folio = page_folio(fio->page);
        struct f2fs_sb_info *sbi = fio->sbi;
        enum temp_type temp;
        bool found = false;
@@ -800,8 +801,8 @@ static int add_ipu_page(struct f2fs_io_info *fio, struct bio **bio,
                                                            *fio->last_block,
                                                            fio->new_blkaddr));
                        if (f2fs_crypt_mergeable_bio(*bio,
-                                       fio->page->mapping->host,
-                                       page_folio(fio->page)->index, fio) &&
+                                       fio_folio->mapping->host,
+                                       fio_folio->index, fio) &&
                            bio_add_page(*bio, page, PAGE_SIZE, 0) ==
                                        PAGE_SIZE) {
                                ret = 0;