SUNRPC: Eliminate side effects from rpc_malloc
commitc5a4dd8b7c15927a8fbff83171b57cad675a79b9
authorChuck Lever <chuck.lever@oracle.com>
Thu, 29 Mar 2007 20:47:58 +0000 (29 16:47 -0400)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Tue, 1 May 2007 05:17:11 +0000 (30 22:17 -0700)
tree2d3b1930449b31f69dc70a6e1d4e0f0532f3f118
parent2bea90d43a050bbc4021d44e59beb34f384438db
SUNRPC: Eliminate side effects from rpc_malloc

Currently rpc_malloc sets req->rq_buffer internally.  Make this a more
generic interface:  return a pointer to the new buffer (or NULL) and
make the caller set req->rq_buffer and req->rq_bufsize.  This looks much
more like kmalloc and eliminates the side effects.

To fix a potential deadlock, this patch also replaces GFP_NOFS with
GFP_NOWAIT in rpc_malloc.  This prevents async RPCs from sleeping outside
the RPC's task scheduler while allocating their buffer.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
include/linux/sunrpc/sched.h
include/linux/sunrpc/xprt.h
net/sunrpc/clnt.c
net/sunrpc/sched.c
net/sunrpc/xprt.c