--- /dev/null
+diff -Naur a/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c b/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c
+--- a/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c 2015-03-11 14:44:18.354200417 -0700
++++ b/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c 2015-03-11 15:35:33.113138831 -0700
+@@ -93,7 +93,9 @@
+ sge_no++;
+ }
+ rqstp->rq_respages = &rqstp->rq_pages[sge_no];
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0))
+ rqstp->rq_next_page = rqstp->rq_respages + 1;
++#endif
+
+ /* We should never run out of SGE because the limit is defined to
+ * support the max allowed RPC data length
+@@ -168,7 +170,9 @@
+ if (!pg_off)
+ head->count++;
+ rqstp->rq_respages = &rqstp->rq_arg.pages[pg_no+1];
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0))
+ rqstp->rq_next_page = rqstp->rq_respages + 1;
++#endif
+ ctxt->sge[pno].addr =
+ ib_dma_map_page(xprt->sc_cm_id->device,
+ head->arg.pages[pg_no], pg_off,
+@@ -273,7 +277,9 @@
+ if (!pg_off)
+ head->count++;
+ rqstp->rq_respages = &rqstp->rq_arg.pages[pg_no+1];
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0))
+ rqstp->rq_next_page = rqstp->rq_respages + 1;
++#endif
+ frmr->page_list->page_list[pno] =
+ ib_dma_map_page(xprt->sc_cm_id->device,
+ head->arg.pages[pg_no], 0,
+@@ -483,7 +489,11 @@
+
+ /* rq_respages starts after the last arg page */
+ rqstp->rq_respages = &rqstp->rq_arg.pages[page_no];
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0))
+ rqstp->rq_next_page = rqstp->rq_respages + 1;
++#else
++ rqstp->rq_resused = 0;
++#endif
+
+ /* Rebuild rq_arg head and tail. */
+ rqstp->rq_arg.head[0] = head->arg.head[0];
+diff -Naur a/net/sunrpc/xprtrdma/svc_rdma_sendto.c b/net/sunrpc/xprtrdma/svc_rdma_sendto.c
+--- a/net/sunrpc/xprtrdma/svc_rdma_sendto.c 2015-03-11 14:44:18.354200417 -0700
++++ b/net/sunrpc/xprtrdma/svc_rdma_sendto.c 2015-03-11 14:59:44.831166432 -0700
+@@ -375,7 +375,9 @@
+ int sge_no;
+ int sge_bytes;
+ int page_no;
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0))
+ int pages;
++#endif
+ int ret;
+
+ /* Post a recv buffer to handle another request. */
+@@ -427,8 +429,12 @@
+ * respages array. They are our pages until the I/O
+ * completes.
+ */
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0))
+ pages = rqstp->rq_next_page - rqstp->rq_respages;
+ for (page_no = 0; page_no < pages; page_no++) {
++#else
++ for (page_no = 0; page_no < rqstp->rq_resused; page_no++) {
++#endif
+ ctxt->pages[page_no+1] = rqstp->rq_respages[page_no];
+ ctxt->count++;
+ rqstp->rq_respages[page_no] = NULL;
+@@ -440,8 +446,9 @@
+ if (page_no+1 >= sge_no)
+ ctxt->sge[page_no+1].length = 0;
+ }
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0))
+ rqstp->rq_next_page = rqstp->rq_respages + 1;
+-
++#endif
+ BUG_ON(sge_no > rdma->sc_max_sge);
+ memset(&send_wr, 0, sizeof send_wr);
+ ctxt->wr_op = IB_WR_SEND;
+diff -Naur a/net/sunrpc/xprtrdma/svc_rdma_transport.c b/net/sunrpc/xprtrdma/svc_rdma_transport.c
+--- a/net/sunrpc/xprtrdma/svc_rdma_transport.c 2015-03-11 14:44:18.358200523 -0700
++++ b/net/sunrpc/xprtrdma/svc_rdma_transport.c 2015-03-11 14:49:30.614613278 -0700
+@@ -467,7 +467,11 @@
+
+ if (!cma_xprt)
+ return NULL;
++#if LINUX_VERSION_CODE > KERNEL_VERSION(3, 1, 0)
+ svc_xprt_init(&init_net, &svc_rdma_class, &cma_xprt->sc_xprt, serv);
++#else
++ svc_xprt_init(&svc_rdma_class, &cma_xprt->sc_xprt, serv);
++#endif
+ INIT_LIST_HEAD(&cma_xprt->sc_accept_q);
+ INIT_LIST_HEAD(&cma_xprt->sc_dto_q);
+ INIT_LIST_HEAD(&cma_xprt->sc_rq_dto_q);
+diff -Naur a/net/sunrpc/xprtrdma/transport.c b/net/sunrpc/xprtrdma/transport.c
+--- a/net/sunrpc/xprtrdma/transport.c 2015-03-11 14:44:18.358200523 -0700
++++ b/net/sunrpc/xprtrdma/transport.c 2015-03-11 16:18:31.130698882 -0700
+@@ -51,7 +51,9 @@
+ #include <linux/init.h>
+ #include <linux/slab.h>
+ #include <linux/seq_file.h>
++#if (LINUX_VERSION_CODE > KERNEL_VERSION(3,8,0))
+ #include <linux/sunrpc/addr.h>
++#endif
+
+ #include "xprt_rdma.h"
+
+@@ -278,7 +280,9 @@
+ }
+
+ xprt = xprt_alloc(args->net, sizeof(struct rpcrdma_xprt),
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0))
+ xprt_rdma_slot_table_entries,
++#endif
+ xprt_rdma_slot_table_entries);
+ if (xprt == NULL) {
+ dprintk("RPC: %s: couldn't allocate rpcrdma_xprt\n",
+@@ -428,8 +432,15 @@
+ }
+
+ static void
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,1,0))
++xprt_rdma_connect(struct rpc_task *task)
++#else
+ xprt_rdma_connect(struct rpc_xprt *xprt, struct rpc_task *task)
++#endif
+ {
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,1,0))
++ struct rpc_xprt *xprt = task->tk_xprt;
++#endif
+ struct rpcrdma_xprt *r_xprt = rpcx_to_rdmax(xprt);
+
+ if (r_xprt->rx_ep.rep_connected != 0) {
+@@ -678,7 +689,9 @@
+ static struct rpc_xprt_ops xprt_rdma_procs = {
+ .reserve_xprt = xprt_reserve_xprt_cong,
+ .release_xprt = xprt_release_xprt_cong, /* sunrpc/xprt.c */
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0))
+ .alloc_slot = xprt_alloc_slot,
++#endif
+ .release_request = xprt_release_rqst_cong, /* ditto */
+ .set_retrans_timeout = xprt_set_retrans_timeout_def, /* ditto */
+ .rpcbind = rpcb_getport_async, /* sunrpc/rpcb_clnt.c */