alistair23-linux/net/sunrpc
Ricardo Labiaga fb7a0b9add nfs41: New backchannel helper routines
This patch introduces support to setup the callback xprt on the client side.
It allocates/ destroys the preallocated memory structures used to process
backchannel requests.

At setup time, xprt_setup_backchannel() is invoked to allocate one or
more rpc_rqst structures and substructures.  This ensures that they
are available when an RPC callback arrives.  The rpc_rqst structures
are maintained in a linked list attached to the rpc_xprt structure.
We keep track of the number of allocations so that they can be correctly
removed when the channel is destroyed.

When an RPC callback arrives, xprt_alloc_bc_request() is invoked to
obtain a preallocated rpc_rqst structure.  An rpc_xprt structure is
returned, and its RPC_BC_PREALLOC_IN_USE bit is set in
rpc_xprt->bc_flags.  The structure is removed from the the list
since it is now in use, and it will be later added back when its
user is done with it.

After the RPC callback replies, the rpc_rqst structure is returned
by invoking xprt_free_bc_request().  This clears the
RPC_BC_PREALLOC_IN_USE bit and adds it back to the list, allowing it
to be reused by a subsequent RPC callback request.

To be consistent with the reception of RPC messages, the backchannel requests
should be placed into the 'struct rpc_rqst' rq_rcv_buf, which is then in turn
copied to the 'struct rpc_rqst' rq_private_buf.

[nfs41: Preallocate rpc_rqst receive buffer for handling callbacks]
Signed-off-by: Ricardo Labiaga <Ricardo.Labiaga@netapp.com>
Signed-off-by: Benny Halevy <bhalevy@panasas.com>
[Update copyright notice and explain page allocation]
Signed-off-by: Ricardo Labiaga <Ricardo.Labiaga@netapp.com>
Signed-off-by: Benny Halevy <bhalevy@panasas.com>
2009-06-17 13:06:14 -07:00
..
auth_gss rpc: add service field to new upcall 2008-12-23 16:19:56 -05:00
xprtrdma Merge branch 'for-2.6.30' of git://linux-nfs.org/~bfields/linux 2009-05-29 08:49:09 -07:00
auth.c Merge branch 'devel' into next 2008-12-30 16:51:43 -05:00
auth_generic.c SUNRPC: Fix a performance regression in the RPC authentication code 2008-11-20 13:17:40 -08:00
auth_null.c
auth_unix.c
backchannel_rqst.c nfs41: New backchannel helper routines 2009-06-17 13:06:14 -07:00
cache.c proc 2/2: remove struct proc_dir_entry::owner 2009-03-31 01:14:44 +04:00
clnt.c nfs41: Process the RPC call direction 2009-06-17 12:43:46 -07:00
Kconfig Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2009-04-03 15:24:35 -07:00
Makefile nfs41: New backchannel helper routines 2009-06-17 13:06:14 -07:00
rpc_pipe.c constify dentry_operations: rest 2009-03-27 14:44:03 -04:00
rpcb_clnt.c SUNRPC: rpcb_register() should handle errors silently 2009-03-28 15:59:48 -04:00
sched.c nfs41: sunrpc: Export the call prepare state for session reset 2009-06-17 12:25:07 -07:00
socklib.c
stats.c proc 2/2: remove struct proc_dir_entry::owner 2009-03-31 01:14:44 +04:00
sunrpc_syms.c
svc.c Merge branch 'for-2.6.30' of git://linux-nfs.org/~bfields/linux 2009-04-06 13:25:56 -07:00
svc_xprt.c Merge branch 'for-2.6.30' of git://linux-nfs.org/~bfields/linux 2009-04-06 13:25:56 -07:00
svcauth.c SUNRPC: The sunrpc server code should not be used by out-of-tree modules 2009-01-07 17:18:42 -05:00
svcauth_unix.c SUNRPC: The sunrpc server code should not be used by out-of-tree modules 2009-01-07 17:18:42 -05:00
svcsock.c nfsd: Revert "svcrpc: take advantage of tcp autotuning" 2009-05-27 18:51:06 -04:00
sysctl.c
timer.c
xdr.c SUNRPC: Convert the xdr helpers and rpc_pipefs to EXPORT_SYMBOL_GPL 2008-12-23 15:21:31 -05:00
xprt.c nfs41: Initialize new rpc_xprt callback related fields 2009-06-17 13:06:14 -07:00
xprtsock.c nfs41: Process the RPC call direction 2009-06-17 12:43:46 -07:00