]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - net/sunrpc/clnt.c
nfs: enable swap on NFS
[karo-tx-linux.git] / net / sunrpc / clnt.c
index b05df36692ff0aec2e370c96fc4a74dfb2f50ff0..fa48c60aef2305430956ef9735b20f6a0f62c073 100644 (file)
@@ -717,6 +717,15 @@ void rpc_task_set_client(struct rpc_task *task, struct rpc_clnt *clnt)
                atomic_inc(&clnt->cl_count);
                if (clnt->cl_softrtry)
                        task->tk_flags |= RPC_TASK_SOFT;
+               if (sk_memalloc_socks()) {
+                       struct rpc_xprt *xprt;
+
+                       rcu_read_lock();
+                       xprt = rcu_dereference(clnt->cl_xprt);
+                       if (xprt->swapper)
+                               task->tk_flags |= RPC_TASK_SWAPPER;
+                       rcu_read_unlock();
+               }
                /* Add to the client's list of all tasks */
                spin_lock(&clnt->cl_lock);
                list_add_tail(&task->tk_task, &clnt->cl_tasks);