}
xprt = xprt_alloc(args->net, sizeof(struct rpcrdma_xprt),
-+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0))
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0) || CONFIG_COMPAT_XPRTRDMA_NEEDED)
xprt_rdma_slot_table_entries,
+#endif
xprt_rdma_slot_table_entries);
}
static int
-+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0))
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0) || CONFIG_COMPAT_XPRTRDMA_NEEDED)
xprt_rdma_reserve_xprt(struct rpc_xprt *xprt, struct rpc_task *task)
{
+#else
BUG_ON(r_xprt->rx_buf.rb_cwndscale <= 0);
}
xprt->cwnd = credits * r_xprt->rx_buf.rb_cwndscale;
-+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0))
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0) || CONFIG_COMPAT_XPRTRDMA_NEEDED)
return xprt_reserve_xprt_cong(xprt, task);
+#else
+ return xprt_reserve_xprt_cong(task);
}
/*
+
+--- a/net/sunrpc/xprtrdma/rpc_rdma.c 2012-08-10 14:24:49.029166778 -0700
++++ b/net/sunrpc/xprtrdma/rpc_rdma.c 2012-08-20 15:10:21.838979969 -0700
+@@ -338,9 +338,17 @@
+ curlen = copy_len;
+ dprintk("RPC: %s: page %d destp 0x%p len %d curlen %d\n",
+ __func__, i, destp, copy_len, curlen);
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
+ srcp = kmap_atomic(ppages[i]);
++#else
++ srcp = kmap_atomic(ppages[i], KM_SKB_SUNRPC_DATA);
++#endif
+ memcpy(destp, srcp+page_base, curlen);
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
+ kunmap_atomic(srcp);
++#else
++ kunmap_atomic(srcp, KM_SKB_SUNRPC_DATA);
++#endif
+ rqst->rq_svec[0].iov_len += curlen;
+ destp += curlen;
+ copy_len -= curlen;
+@@ -639,10 +647,18 @@
+ dprintk("RPC: %s: page %d"
+ " srcp 0x%p len %d curlen %d\n",
+ __func__, i, srcp, copy_len, curlen);
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
+ destp = kmap_atomic(ppages[i]);
++#else
++ destp = kmap_atomic(ppages[i], KM_SKB_SUNRPC_DATA);
++#endif
+ memcpy(destp + page_base, srcp, curlen);
+ flush_dcache_page(ppages[i]);
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0))
+ kunmap_atomic(destp);
++#else
++ kunmap_atomic(destp, KM_SKB_SUNRPC_DATA);
++#endif
+ srcp += curlen;
+ copy_len -= curlen;
+ if (copy_len == 0)