diff options
author | Chuck Lever <chuck.lever@oracle.com> | 2015-01-21 11:02:29 -0500 |
---|---|---|
committer | Anna Schumaker <Anna.Schumaker@Netapp.com> | 2015-01-30 10:47:48 -0500 |
commit | f2846481b4bf758cf7c3fe8f24b35950306f1db2 (patch) | |
tree | e0d5e559cbcef05e8893a7966693bb89f89c251f /net | |
parent | 052151a9798ef7a79372fdc688018dc405a6063c (diff) |
xprtrdma: Clean up hdrlen
Clean up: Replace naked integers with a documenting macro.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Reviewed-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/sunrpc/xprtrdma/rpc_rdma.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/net/sunrpc/xprtrdma/rpc_rdma.c b/net/sunrpc/xprtrdma/rpc_rdma.c index 150dd7641803..dcf5ebc3d373 100644 --- a/net/sunrpc/xprtrdma/rpc_rdma.c +++ b/net/sunrpc/xprtrdma/rpc_rdma.c | |||
@@ -472,7 +472,7 @@ rpcrdma_marshal_req(struct rpc_rqst *rqst) | |||
472 | return -EIO; | 472 | return -EIO; |
473 | } | 473 | } |
474 | 474 | ||
475 | hdrlen = 28; /*sizeof *headerp;*/ | 475 | hdrlen = RPCRDMA_HDRLEN_MIN; |
476 | padlen = 0; | 476 | padlen = 0; |
477 | 477 | ||
478 | /* | 478 | /* |
@@ -748,7 +748,7 @@ rpcrdma_reply_handler(struct rpcrdma_rep *rep) | |||
748 | } | 748 | } |
749 | return; | 749 | return; |
750 | } | 750 | } |
751 | if (rep->rr_len < 28) { | 751 | if (rep->rr_len < RPCRDMA_HDRLEN_MIN) { |
752 | dprintk("RPC: %s: short/invalid reply\n", __func__); | 752 | dprintk("RPC: %s: short/invalid reply\n", __func__); |
753 | goto repost; | 753 | goto repost; |
754 | } | 754 | } |
@@ -830,8 +830,9 @@ repost: | |||
830 | } else { | 830 | } else { |
831 | /* else ordinary inline */ | 831 | /* else ordinary inline */ |
832 | rdmalen = 0; | 832 | rdmalen = 0; |
833 | iptr = (__be32 *)((unsigned char *)headerp + 28); | 833 | iptr = (__be32 *)((unsigned char *)headerp + |
834 | rep->rr_len -= 28; /*sizeof *headerp;*/ | 834 | RPCRDMA_HDRLEN_MIN); |
835 | rep->rr_len -= RPCRDMA_HDRLEN_MIN; | ||
835 | status = rep->rr_len; | 836 | status = rep->rr_len; |
836 | } | 837 | } |
837 | /* Fix up the rpc results for upper layer */ | 838 | /* Fix up the rpc results for upper layer */ |
@@ -845,7 +846,8 @@ repost: | |||
845 | headerp->rm_body.rm_chunks[2] != xdr_one || | 846 | headerp->rm_body.rm_chunks[2] != xdr_one || |
846 | req->rl_nchunks == 0) | 847 | req->rl_nchunks == 0) |
847 | goto badheader; | 848 | goto badheader; |
848 | iptr = (__be32 *)((unsigned char *)headerp + 28); | 849 | iptr = (__be32 *)((unsigned char *)headerp + |
850 | RPCRDMA_HDRLEN_MIN); | ||
849 | rdmalen = rpcrdma_count_chunks(rep, req->rl_nchunks, 0, &iptr); | 851 | rdmalen = rpcrdma_count_chunks(rep, req->rl_nchunks, 0, &iptr); |
850 | if (rdmalen < 0) | 852 | if (rdmalen < 0) |
851 | goto badheader; | 853 | goto badheader; |