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) <wi...@infradead.org>
---
 fs/f2fs/data.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index 70dab1b6fdf4..8d25af7a4cfd 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -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;
-- 
2.47.2



_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

Reply via email to