nfs: enable swap on NFS
authorMel Gorman <[email protected]>
Tue, 31 Jul 2012 23:45:12 +0000 (16:45 -0700)
committerLinus Torvalds <[email protected]>
Wed, 1 Aug 2012 01:42:48 +0000 (18:42 -0700)
commita564b8f0398636ba30b07c0eaebdef7ff7837249
tree10478aa5cfb2a3696db34618a479413b358c3831
parent29418aa4bd487c82016733ef5c6a06d656ed3c7d
nfs: enable swap on NFS

Implement the new swapfile a_ops for NFS and hook up ->direct_IO.  This
will set the NFS socket to SOCK_MEMALLOC and run socket reconnect under
PF_MEMALLOC as well as reset SOCK_MEMALLOC before engaging the protocol
->connect() method.

PF_MEMALLOC should allow the allocation of struct socket and related
objects and the early (re)setting of SOCK_MEMALLOC should allow us to
receive the packets required for the TCP connection buildup.

[[email protected]: Restore PF_MEMALLOC task flags in all cases]
[[email protected]: Fix handling of multiple swap files]
[[email protected]: Original patch]
Signed-off-by: Mel Gorman <[email protected]>
Acked-by: Rik van Riel <[email protected]>
Cc: Christoph Hellwig <[email protected]>
Cc: David S. Miller <[email protected]>
Cc: Eric B Munson <[email protected]>
Cc: Eric Paris <[email protected]>
Cc: James Morris <[email protected]>
Cc: Mel Gorman <[email protected]>
Cc: Mike Christie <[email protected]>
Cc: Neil Brown <[email protected]>
Cc: Sebastian Andrzej Siewior <[email protected]>
Cc: Trond Myklebust <[email protected]>
Cc: Xiaotian Feng <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
fs/nfs/Kconfig
fs/nfs/direct.c
fs/nfs/file.c
include/linux/nfs_fs.h
include/linux/sunrpc/xprt.h
net/sunrpc/Kconfig
net/sunrpc/clnt.c
net/sunrpc/sched.c
net/sunrpc/xprtsock.c