>From a872e1751aa9be6b44bb0ad37bc2c4fe5703efff Mon Sep 17 00:00:00 2001
From: Jeff Becker <Jeffrey.C.Becker@nasa.gov>
Date: Wed, 19 Oct 2011 16:03:09 -0700
Subject: [PATCH 4/4] NFSRDMA: forgot a few patches for RHEL6.1
 Signed-off-by: Jeff Becker <Jeffrey.C.Becker@nasa.gov>

---
 ...entralise-most-calls-to-svc_xprt_received.patch |   61 ++++++++++++++++++++
 ...move-struct-file-argument-of-proc_handler.patch |   37 ++++++++++++
 2 files changed, 98 insertions(+), 0 deletions(-)
 create mode 100644 kernel_patches/backport/2.6.32-EL6.1/nfsrdma-sunrpc-centralise-most-calls-to-svc_xprt_received.patch
 create mode 100644 kernel_patches/backport/2.6.32-EL6.1/nfsrdma-sysctl-remove-struct-file-argument-of-proc_handler.patch

diff --git a/kernel_patches/backport/2.6.32-EL6.1/nfsrdma-sunrpc-centralise-most-calls-to-svc_xprt_received.patch b/kernel_patches/backport/2.6.32-EL6.1/nfsrdma-sunrpc-centralise-most-calls-to-svc_xprt_received.patch
new file mode 100644
index 0000000..dea25f7
--- /dev/null
+++ b/kernel_patches/backport/2.6.32-EL6.1/nfsrdma-sunrpc-centralise-most-calls-to-svc_xprt_received.patch
@@ -0,0 +1,61 @@
+From b48fa6b99100dc7772af3cd276035fcec9719ceb Mon Sep 17 00:00:00 2001
+From: Neil Brown <neilb@suse.de>
+Date: Mon, 1 Mar 2010 16:51:14 +1100
+Subject: [PATCH] sunrpc: centralise most calls to svc_xprt_received
+
+svc_xprt_received must be called when ->xpo_recvfrom has finished
+receiving a message, so that the XPT_BUSY flag will be cleared and
+if necessary, requeued for further work.
+
+This call is currently made in each ->xpo_recvfrom function, often
+from multiple different points.  In each case it is the earliest point
+on a particular path where it is known that the protection provided by
+XPT_BUSY is no longer needed.
+
+However there are (still) some error paths which do not call
+svc_xprt_received, and requiring each ->xpo_recvfrom to make the call
+does not encourage robustness.
+
+So: move the svc_xprt_received call to be made just after the
+call to ->xpo_recvfrom(), and move it of the various ->xpo_recvfrom
+methods.
+
+This means that it may not be called at the earliest possible instant,
+but this is unlikely to be a measurable performance issue.
+
+Note that there are still other calls to svc_xprt_received as it is
+also needed when an xprt is newly created.
+
+Signed-off-by: NeilBrown <neilb@suse.de>
+Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
+---
+diff --git a/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c b/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c
+index f92e37e..0194de8 100644
+--- a/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c
++++ b/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c
+@@ -566,7 +566,6 @@ static int rdma_read_complete(struct svc_rqst *rqstp,
+ 		ret, rqstp->rq_arg.len,	rqstp->rq_arg.head[0].iov_base,
+ 		rqstp->rq_arg.head[0].iov_len);
+ 
+-	svc_xprt_received(rqstp->rq_xprt);
+ 	return ret;
+ }
+ 
+@@ -665,7 +664,6 @@ int svc_rdma_recvfrom(struct svc_rqst *rqstp)
+ 		rqstp->rq_arg.head[0].iov_len);
+ 	rqstp->rq_prot = IPPROTO_MAX;
+ 	svc_xprt_copy_addrs(rqstp, xprt);
+-	svc_xprt_received(xprt);
+ 	return ret;
+ 
+  close_out:
+@@ -678,6 +676,5 @@ int svc_rdma_recvfrom(struct svc_rqst *rqstp)
+ 	 */
+ 	set_bit(XPT_CLOSE, &xprt->xpt_flags);
+ defer:
+-	svc_xprt_received(xprt);
+ 	return 0;
+ }
+-- 
+1.7.3.4
+
diff --git a/kernel_patches/backport/2.6.32-EL6.1/nfsrdma-sysctl-remove-struct-file-argument-of-proc_handler.patch b/kernel_patches/backport/2.6.32-EL6.1/nfsrdma-sysctl-remove-struct-file-argument-of-proc_handler.patch
new file mode 100644
index 0000000..fa3793a
--- /dev/null
+++ b/kernel_patches/backport/2.6.32-EL6.1/nfsrdma-sysctl-remove-struct-file-argument-of-proc_handler.patch
@@ -0,0 +1,37 @@
+From 8d65af789f3e2cf4cfbdbf71a0f7a61ebcd41d38 Mon Sep 17 00:00:00 2001
+From: Alexey Dobriyan <adobriyan@gmail.com>
+Date: Wed, 23 Sep 2009 15:57:19 -0700
+Subject: [PATCH] sysctl: remove "struct file *" argument of ->proc_handler
+
+It's unused.
+
+It isn't needed -- read or write flag is already passed and sysctl
+shouldn't care about the rest.
+
+It _was_ used in two places at arch/frv for some reason.
+
+Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
+Cc: David Howells <dhowells@redhat.com>
+Cc: "Eric W. Biederman" <ebiederm@xmission.com>
+Cc: Al Viro <viro@zeniv.linux.org.uk>
+Cc: Ralf Baechle <ralf@linux-mips.org>
+Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
+Cc: Ingo Molnar <mingo@elte.hu>
+Cc: "David S. Miller" <davem@davemloft.net>
+Cc: James Morris <jmorris@namei.org>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+---
+diff --git a/net/sunrpc/xprtrdma/svc_rdma.c b/net/sunrpc/xprtrdma/svc_rdma.c
+index 8710117..35fb68b 100644
+--- a/net/sunrpc/xprtrdma/svc_rdma.c
++++ b/net/sunrpc/xprtrdma/svc_rdma.c
+@@ -80,7 +80,7 @@ struct kmem_cache *svc_rdma_ctxt_cachep;
+  * current value.
+  */
+ static int read_reset_stat(ctl_table *table, int write,
+-			   struct file *filp, void __user *buffer, size_t *lenp,
++			   void __user *buffer, size_t *lenp,
+ 			   loff_t *ppos)
+ {
+ 	atomic_t *stat = (atomic_t *)table->data;
-- 
1.7.3.4

