Merge tag 'folio-5.19' of git://git.infradead.org/users/willy/pagecache
[linux-2.6-microblaze.git] / fs / f2fs / f2fs.h
index 2b2b3c8..10d1f13 100644 (file)
@@ -18,6 +18,7 @@
 #include <linux/kobject.h>
 #include <linux/sched.h>
 #include <linux/cred.h>
+#include <linux/sched/mm.h>
 #include <linux/vmalloc.h>
 #include <linux/bio.h>
 #include <linux/blkdev.h>
@@ -2654,6 +2655,7 @@ static inline struct page *f2fs_grab_cache_page(struct address_space *mapping,
                                                pgoff_t index, bool for_write)
 {
        struct page *page;
+       unsigned int flags;
 
        if (IS_ENABLED(CONFIG_F2FS_FAULT_INJECTION)) {
                if (!for_write)
@@ -2673,7 +2675,12 @@ static inline struct page *f2fs_grab_cache_page(struct address_space *mapping,
 
        if (!for_write)
                return grab_cache_page(mapping, index);
-       return grab_cache_page_write_begin(mapping, index, AOP_FLAG_NOFS);
+
+       flags = memalloc_nofs_save();
+       page = grab_cache_page_write_begin(mapping, index);
+       memalloc_nofs_restore(flags);
+
+       return page;
 }
 
 static inline struct page *f2fs_pagecache_get_page(
@@ -3761,7 +3768,7 @@ int f2fs_write_single_data_page(struct page *page, int *submitted,
                                int compr_blocks, bool allow_balance);
 void f2fs_write_failed(struct inode *inode, loff_t to);
 void f2fs_invalidate_folio(struct folio *folio, size_t offset, size_t length);
-int f2fs_release_page(struct page *page, gfp_t wait);
+bool f2fs_release_folio(struct folio *folio, gfp_t wait);
 #ifdef CONFIG_MIGRATION
 int f2fs_migrate_page(struct address_space *mapping, struct page *newpage,
                        struct page *page, enum migrate_mode mode);