]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
f2fs: Use a folio in f2fs_is_cp_guaranteed()
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Tue, 8 Jul 2025 17:03:36 +0000 (18:03 +0100)
committerJaegeuk Kim <jaegeuk@kernel.org>
Tue, 22 Jul 2025 15:57:09 +0000 (15:57 +0000)
Convert the passed page to a folio and use it throughout.  Removes
a use of fscrypt_is_bounce_page(), which we're trying to remove.

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
fs/f2fs/f2fs.h
include/linux/fscrypt.h

index f3e11f5672ecff3e173726068d79df57a631deb3..c1fc8c7b12568d079118f40deb73bda15e7dab1e 100644 (file)
@@ -47,14 +47,15 @@ void f2fs_destroy_bioset(void)
        bioset_exit(&f2fs_bioset);
 }
 
-bool f2fs_is_cp_guaranteed(struct page *page)
+bool f2fs_is_cp_guaranteed(const struct page *page)
 {
-       struct address_space *mapping = page_folio(page)->mapping;
+       const struct folio *folio = page_folio(page);
+       struct address_space *mapping = folio->mapping;
        struct inode *inode;
        struct f2fs_sb_info *sbi;
 
-       if (fscrypt_is_bounce_page(page))
-               return page_private_gcing(fscrypt_pagecache_page(page));
+       if (fscrypt_is_bounce_folio(folio))
+               return folio_test_f2fs_gcing(fscrypt_pagecache_folio(folio));
 
        inode = mapping->host;
        sbi = F2FS_I_SB(inode);
@@ -65,7 +66,7 @@ bool f2fs_is_cp_guaranteed(struct page *page)
                return true;
 
        if ((S_ISREG(inode->i_mode) && IS_NOQUOTA(inode)) ||
-                       page_private_gcing(page))
+                       folio_test_f2fs_gcing(folio))
                return true;
        return false;
 }
index 0e607305e308fe939d265508efac1414080f505b..be9b7a0120a9cd851dd7615e01c476fc93811991 100644 (file)
@@ -3990,7 +3990,7 @@ void f2fs_init_ckpt_req_control(struct f2fs_sb_info *sbi);
  */
 int __init f2fs_init_bioset(void);
 void f2fs_destroy_bioset(void);
-bool f2fs_is_cp_guaranteed(struct page *page);
+bool f2fs_is_cp_guaranteed(const struct page *page);
 int f2fs_init_bio_entry_cache(void);
 void f2fs_destroy_bio_entry_cache(void);
 void f2fs_submit_read_bio(struct f2fs_sb_info *sbi, struct bio *bio,
index 56fad33043d539b69d1f8c0e4dcd31b4a23138d8..8d9127a0fdb3d12457a1dfcb513e9f77052c6a49 100644 (file)
@@ -332,12 +332,13 @@ static inline struct page *fscrypt_pagecache_page(struct page *bounce_page)
        return (struct page *)page_private(bounce_page);
 }
 
-static inline bool fscrypt_is_bounce_folio(struct folio *folio)
+static inline bool fscrypt_is_bounce_folio(const struct folio *folio)
 {
        return folio->mapping == NULL;
 }
 
-static inline struct folio *fscrypt_pagecache_folio(struct folio *bounce_folio)
+static inline
+struct folio *fscrypt_pagecache_folio(const struct folio *bounce_folio)
 {
        return bounce_folio->private;
 }
@@ -518,12 +519,13 @@ static inline struct page *fscrypt_pagecache_page(struct page *bounce_page)
        return ERR_PTR(-EINVAL);
 }
 
-static inline bool fscrypt_is_bounce_folio(struct folio *folio)
+static inline bool fscrypt_is_bounce_folio(const struct folio *folio)
 {
        return false;
 }
 
-static inline struct folio *fscrypt_pagecache_folio(struct folio *bounce_folio)
+static inline
+struct folio *fscrypt_pagecache_folio(const struct folio *bounce_folio)
 {
        WARN_ON_ONCE(1);
        return ERR_PTR(-EINVAL);