diff options
author | Chuck Lever | 2015-03-30 20:34:39 +0200 |
---|---|---|
committer | Anna Schumaker | 2015-03-31 15:52:52 +0200 |
commit | 9c1b4d775f2d7dd5bb806e3de2f3e1244a7cbd16 (patch) | |
tree | 19918df86e24602bb055ff6e5be6fba6cf3b2f25 /net/sunrpc/xprtrdma/rpc_rdma.c | |
parent | xprtrdma: Add a "max_payload" op for each memreg mode (diff) | |
download | kernel-qcow2-linux-9c1b4d775f2d7dd5bb806e3de2f3e1244a7cbd16.tar.gz kernel-qcow2-linux-9c1b4d775f2d7dd5bb806e3de2f3e1244a7cbd16.tar.xz kernel-qcow2-linux-9c1b4d775f2d7dd5bb806e3de2f3e1244a7cbd16.zip |
xprtrdma: Add a "register_external" op for each memreg mode
There is very little common processing among the different external
memory registration functions. Have rpcrdma_create_chunks() call
the registration method directly. This removes a stack frame and a
switch statement from the external registration path.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Tested-by: Devesh Sharma <Devesh.Sharma@Emulex.Com>
Tested-by: Meghana Cheripady <Meghana.Cheripady@Emulex.Com>
Tested-by: Veeresh U. Kokatnur <veereshuk@chelsio.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Diffstat (limited to 'net/sunrpc/xprtrdma/rpc_rdma.c')
-rw-r--r-- | net/sunrpc/xprtrdma/rpc_rdma.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/net/sunrpc/xprtrdma/rpc_rdma.c b/net/sunrpc/xprtrdma/rpc_rdma.c index 41456d9e5a7d..6ab1d03d7f3e 100644 --- a/net/sunrpc/xprtrdma/rpc_rdma.c +++ b/net/sunrpc/xprtrdma/rpc_rdma.c @@ -187,6 +187,7 @@ rpcrdma_create_chunks(struct rpc_rqst *rqst, struct xdr_buf *target, struct rpcrdma_write_array *warray = NULL; struct rpcrdma_write_chunk *cur_wchunk = NULL; __be32 *iptr = headerp->rm_body.rm_chunks; + int (*map)(struct rpcrdma_xprt *, struct rpcrdma_mr_seg *, int, bool); if (type == rpcrdma_readch || type == rpcrdma_areadch) { /* a read chunk - server will RDMA Read our memory */ @@ -209,9 +210,9 @@ rpcrdma_create_chunks(struct rpc_rqst *rqst, struct xdr_buf *target, if (nsegs < 0) return nsegs; + map = r_xprt->rx_ia.ri_ops->ro_map; do { - n = rpcrdma_register_external(seg, nsegs, - cur_wchunk != NULL, r_xprt); + n = map(r_xprt, seg, nsegs, cur_wchunk != NULL); if (n <= 0) goto out; if (cur_rchunk) { /* read */ |