linux-stable/fs/9p
David Howells d7bdba1c81 9p, afs, ceph, nfs: Use current_is_kswapd() rather than gfpflags_allow_blocking()
In 9p, afs ceph, and nfs, gfpflags_allow_blocking() (which wraps a
test for __GFP_DIRECT_RECLAIM being set) is used to determine if
->releasepage() should wait for the completion of a DIO write to fscache
with something like:

	if (folio_test_fscache(folio)) {
		if (!gfpflags_allow_blocking(gfp) || !(gfp & __GFP_FS))
			return false;
		folio_wait_fscache(folio);
	}

Instead, current_is_kswapd() should be used instead.

Note that this is based on a patch originally by Zhaoyang Huang[1].  In
addition to extending it to the other network filesystems and putting it on
top of my fscache rewrite, it also needs to include linux/swap.h in a bunch
of places.  Can current_is_kswapd() be moved to linux/mm.h?

Changes
=======
ver #5:
 - Dropping the changes for cifs.

Originally-signed-off-by: Zhaoyang Huang <zhaoyang.huang@unisoc.com>
Co-developed-by: David Howells <dhowells@redhat.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
cc: Zhaoyang Huang <zhaoyang.huang@unisoc.com>
cc: Dominique Martinet <asmadeus@codewreck.org>
cc: Marc Dionne <marc.dionne@auristor.com>
cc: Steve French <smfrench@gmail.com>
cc: Trond Myklebust <trond.myklebust@hammerspace.com>
cc: linux-cachefs@redhat.com
cc: v9fs-developer@lists.sourceforge.net
cc: linux-afs@lists.infradead.org
cc: ceph-devel@vger.kernel.org
cc: linux-cifs@vger.kernel.org
cc: linux-nfs@vger.kernel.org
cc: linux-mm@kvack.org
Link: https://lore.kernel.org/r/1638952658-20285-1-git-send-email-huangzhaoyang@gmail.com/ [1]
Link: https://lore.kernel.org/r/164021590773.640689.16777975200823659231.stgit@warthog.procyon.org.uk/ # v4
2022-01-11 22:27:42 +00:00
..
acl.c 9p: fix a bunch of checkpatch warnings 2021-11-04 21:04:25 +09:00
acl.h 9p: fix a bunch of checkpatch warnings 2021-11-04 21:04:25 +09:00
cache.c 9p: Use fscache indexing rewrite and reenable caching 2022-01-10 11:53:06 +00:00
cache.h 9p: Use fscache indexing rewrite and reenable caching 2022-01-10 11:53:06 +00:00
fid.c fs/9p: fix indentation and Add missing a blank line after declaration 2021-11-03 17:45:03 +09:00
fid.h 9p: apply review requests for fid refcounting 2020-11-19 17:21:34 +01:00
Kconfig 9p: Use fscache indexing rewrite and reenable caching 2022-01-10 11:53:06 +00:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
v9fs.c 9p: Use fscache indexing rewrite and reenable caching 2022-01-10 11:53:06 +00:00
v9fs.h 9p: Use fscache indexing rewrite and reenable caching 2022-01-10 11:53:06 +00:00
v9fs_vfs.h 9p: fix a bunch of checkpatch warnings 2021-11-04 21:04:25 +09:00
vfs_addr.c 9p, afs, ceph, nfs: Use current_is_kswapd() rather than gfpflags_allow_blocking() 2022-01-11 22:27:42 +00:00
vfs_dentry.c 9p: fix a bunch of checkpatch warnings 2021-11-04 21:04:25 +09:00
vfs_dir.c 9p: Use fscache indexing rewrite and reenable caching 2022-01-10 11:53:06 +00:00
vfs_file.c 9p: Use fscache indexing rewrite and reenable caching 2022-01-10 11:53:06 +00:00
vfs_inode.c 9p: Copy local writes to the cache when writing to the server 2022-01-10 11:53:25 +00:00
vfs_inode_dotl.c 9p: Use fscache indexing rewrite and reenable caching 2022-01-10 11:53:06 +00:00
vfs_super.c 9p: Copy local writes to the cache when writing to the server 2022-01-10 11:53:25 +00:00
xattr.c 9p: fix file headers 2021-11-03 17:45:04 +09:00
xattr.h 9p: fix a bunch of checkpatch warnings 2021-11-04 21:04:25 +09:00