提交 ad99f053 编写于 作者: C Chuck Lever 提交者: Anna Schumaker

xprtrdma: Clean up SGE accounting in rpcrdma_prepare_msg_sges()

Clean up. rpcrdma_prepare_hdr_sge() sets num_sge to one, then
rpcrdma_prepare_msg_sges() sets num_sge again to the count of SGEs
it added, plus one for the header SGE just mapped in
rpcrdma_prepare_hdr_sge(). This is confusing, and nails in an
assumption about when these functions are called.

Instead, maintain a running count that both functions can update
with just the number of SGEs they have added to the SGE array.
Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
Signed-off-by: NAnna Schumaker <Anna.Schumaker@Netapp.com>
上级 be798f90
......@@ -637,7 +637,7 @@ rpcrdma_prepare_msg_sges(struct rpcrdma_ia *ia, struct rpcrdma_req *req,
}
out:
req->rl_send_wr.num_sge = sge_no + 1;
req->rl_send_wr.num_sge += sge_no;
return true;
out_mapping_overflow:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册