diff options
author | Chuck Lever <chuck.lever@oracle.com> | 2021-02-04 17:59:07 +0100 |
---|---|---|
committer | Anna Schumaker <Anna.Schumaker@Netapp.com> | 2021-02-05 17:16:55 +0100 |
commit | 54e6aec57c251e36a4c3153ccfee9538f2ec1bcf (patch) | |
tree | 20d8947b8e9ea61f500af994e13ea66b8e632ce9 /net/sunrpc/xprtrdma/frwr_ops.c | |
parent | xprtrdma: Remove FMR support in rpcrdma_convert_iovs() (diff) | |
download | linux-54e6aec57c251e36a4c3153ccfee9538f2ec1bcf.tar.xz linux-54e6aec57c251e36a4c3153ccfee9538f2ec1bcf.zip |
xprtrdma: Simplify rpcrdma_convert_kvec() and frwr_map()
Clean up.
Remove a conditional branch from the SGL set-up loop in frwr_map():
Instead of using either sg_set_page() or sg_set_buf(), initialize
the mr_page field properly when rpcrdma_convert_kvec() converts the
kvec to an SGL entry. frwr_map() can then invoke sg_set_page()
unconditionally.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Reviewed-by: Tom Talpey <tom@talpey.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Diffstat (limited to 'net/sunrpc/xprtrdma/frwr_ops.c')
-rw-r--r-- | net/sunrpc/xprtrdma/frwr_ops.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/net/sunrpc/xprtrdma/frwr_ops.c b/net/sunrpc/xprtrdma/frwr_ops.c index baca49fe83af..13a50f77dddb 100644 --- a/net/sunrpc/xprtrdma/frwr_ops.c +++ b/net/sunrpc/xprtrdma/frwr_ops.c @@ -306,14 +306,10 @@ struct rpcrdma_mr_seg *frwr_map(struct rpcrdma_xprt *r_xprt, if (nsegs > ep->re_max_fr_depth) nsegs = ep->re_max_fr_depth; for (i = 0; i < nsegs;) { - if (seg->mr_page) - sg_set_page(&mr->mr_sg[i], - seg->mr_page, - seg->mr_len, - offset_in_page(seg->mr_offset)); - else - sg_set_buf(&mr->mr_sg[i], seg->mr_offset, - seg->mr_len); + sg_set_page(&mr->mr_sg[i], + seg->mr_page, + seg->mr_len, + offset_in_page(seg->mr_offset)); ++seg; ++i; |