[pnfs] [PATCH 04/10] nfs41: NFSv4.1 callback structures

Ricardo Labiaga ricardo.labiaga at netapp.com
Thu Jan 31 06:36:24 EST 2008


Adds new list of rpc_xprt structures, and a readers/writers lock to
protect the list.  The list is used to preallocate resources for
the backchannel during backchannel requests.  Callbacks are not
expected to cause significant latency, so only one callback will
be allowed at this time.

It also adds a pointer to the NFS callback service so that
requests can be directed to it for processing.

Signed-off-by: Ricardo Labiaga <ricardo.labiaga at netapp.com>
---
 include/linux/sunrpc/xprt.h |   24 +++++++++++++++++++++++-
 1 files changed, 23 insertions(+), 1 deletions(-)

diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h
index fa5db04..94f3cf3 100644
--- a/include/linux/sunrpc/xprt.h
+++ b/include/linux/sunrpc/xprt.h
@@ -93,6 +93,12 @@ struct rpc_rqst {
 
 	unsigned long		rq_xtime;	/* when transmitted */
 	int			rq_ntrans;
+
+#if defined(CONFIG_NFS_V4_1)
+	struct list_head	rq_bc_list;	/* Callback service list */
+	unsigned long		rq_bc_pa_state;	/* Backchannel prealloc state */
+	struct list_head	rq_bc_pa_list;	/* Backchannel prealloc list */
+#endif /* CONFIG_NFS_V4_1 */
 };
 #define rq_svec			rq_snd_buf.head
 #define rq_slen			rq_snd_buf.len
@@ -169,7 +175,15 @@ struct rpc_xprt {
 	struct rpc_task *	snd_task;	/* Task blocked in send */
 #if defined(CONFIG_NFSD_V4_1)
 	struct svc_sock	       *svsk;           /* If this is a callback xprt */
-#endif
+#endif /* CONFIG_NFSD_V4_1 */
+#if defined(CONFIG_NFS_V4_1)
+	struct svc_serv		*serv;		/* The RPC service which will */
+						/* process the callback */
+	rwlock_t		bc_pa_lock;	/* Protects the preallocated */
+						/* items */
+	struct list_head	bc_pa_list;	/* List of preallocated */
+						/* backchannel rpc_rqst's */
+#endif /* CONFIG_NFS_V4_1 */
 	struct list_head	recv;
 
 	struct {
@@ -188,6 +202,14 @@ struct rpc_xprt {
 	char *			address_strings[RPC_DISPLAY_MAX];
 };
 
+#if defined(CONFIG_NFS_V4_1)
+/*
+ * Backchannel flags
+ */
+#define	RPC_BC_PA_IN_USE	0x0001		/* Preallocated backchannel */
+						/* buffer in use */
+#endif /* CONFIG_NFS_V4_1 */
+
 struct xprt_create {
 	int			ident;		/* XPRT_TRANSPORT identifier */
 	struct sockaddr *	srcaddr;	/* optional local address */
-- 
1.5.3.3


More information about the pNFS mailing list