diff options
-rw-r--r-- | fs/9p/vfs_addr.c | 3 | ||||
-rw-r--r-- | fs/afs/file.c | 3 | ||||
-rw-r--r-- | fs/ceph/addr.c | 3 | ||||
-rw-r--r-- | fs/nfs/fscache.h | 3 |
4 files changed, 8 insertions, 4 deletions
diff --git a/fs/9p/vfs_addr.c b/fs/9p/vfs_addr.c index f3f349f460e5..c72e9f8f5f32 100644 --- a/fs/9p/vfs_addr.c +++ b/fs/9p/vfs_addr.c @@ -16,6 +16,7 @@ #include <linux/pagemap.h> #include <linux/idr.h> #include <linux/sched.h> +#include <linux/swap.h> #include <linux/uio.h> #include <linux/netfs.h> #include <net/9p/9p.h> @@ -143,7 +144,7 @@ static int v9fs_release_page(struct page *page, gfp_t gfp) return 0; #ifdef CONFIG_9P_FSCACHE if (folio_test_fscache(folio)) { - if (!gfpflags_allow_blocking(gfp) || !(gfp & __GFP_FS)) + if (current_is_kswapd() || !(gfp & __GFP_FS)) return 0; folio_wait_fscache(folio); } diff --git a/fs/afs/file.c b/fs/afs/file.c index 572063dad0b3..5b98db127a1b 100644 --- a/fs/afs/file.c +++ b/fs/afs/file.c @@ -14,6 +14,7 @@ #include <linux/gfp.h> #include <linux/task_io_accounting_ops.h> #include <linux/mm.h> +#include <linux/swap.h> #include <linux/netfs.h> #include "internal.h" @@ -517,7 +518,7 @@ static int afs_releasepage(struct page *page, gfp_t gfp) * elected to wait */ #ifdef CONFIG_AFS_FSCACHE if (folio_test_fscache(folio)) { - if (!gfpflags_allow_blocking(gfp) || !(gfp & __GFP_FS)) + if (current_is_kswapd() || !(gfp & __GFP_FS)) return false; folio_wait_fscache(folio); } diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c index e836f8f1d4f8..b3d9459c9bbd 100644 --- a/fs/ceph/addr.c +++ b/fs/ceph/addr.c @@ -4,6 +4,7 @@ #include <linux/backing-dev.h> #include <linux/fs.h> #include <linux/mm.h> +#include <linux/swap.h> #include <linux/pagemap.h> #include <linux/slab.h> #include <linux/pagevec.h> @@ -174,7 +175,7 @@ static int ceph_releasepage(struct page *page, gfp_t gfp) return 0; if (PageFsCache(page)) { - if (!gfpflags_allow_blocking(gfp) || !(gfp & __GFP_FS)) + if (current_is_kswapd() || !(gfp & __GFP_FS)) return 0; wait_on_page_fscache(page); } diff --git a/fs/nfs/fscache.h b/fs/nfs/fscache.h index e0220fc40366..25a5c0f82392 100644 --- a/fs/nfs/fscache.h +++ b/fs/nfs/fscache.h @@ -8,6 +8,7 @@ #ifndef _NFS_FSCACHE_H #define _NFS_FSCACHE_H +#include <linux/swap.h> #include <linux/nfs_fs.h> #include <linux/nfs_mount.h> #include <linux/nfs4_mount.h> @@ -52,7 +53,7 @@ extern void __nfs_readpage_to_fscache(struct inode *, struct page *); static inline int nfs_fscache_release_page(struct page *page, gfp_t gfp) { if (PageFsCache(page)) { - if (!gfpflags_allow_blocking(gfp) || !(gfp & __GFP_FS)) + if (current_is_kswapd() || !(gfp & __GFP_FS)) return false; wait_on_page_fscache(page); fscache_note_page_release(nfs_i_fscache(page->mapping->host)); |