Skip to content

Commit 253a516

Browse files
chuckleveramschuma-ntap
authored andcommitted
xprtrdma: Refactor frwr_init_mr()
Clean up: prepare for combining the rpcrdma_ia and rpcrdma_ep structures. Take the opportunity to rename the function to be consistent with the "subsystem _ object _ verb" naming scheme. Signed-off-by: Chuck Lever <[email protected]> Signed-off-by: Anna Schumaker <[email protected]>
1 parent 85cd8e2 commit 253a516

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

net/sunrpc/xprtrdma/frwr_ops.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252

5353
/**
5454
* frwr_release_mr - Destroy one MR
55-
* @mr: MR allocated by frwr_init_mr
55+
* @mr: MR allocated by frwr_mr_init
5656
*
5757
*/
5858
void frwr_release_mr(struct rpcrdma_mr *mr)
@@ -106,15 +106,16 @@ void frwr_reset(struct rpcrdma_req *req)
106106
}
107107

108108
/**
109-
* frwr_init_mr - Initialize one MR
110-
* @ia: interface adapter
109+
* frwr_mr_init - Initialize one MR
110+
* @r_xprt: controlling transport instance
111111
* @mr: generic MR to prepare for FRWR
112112
*
113113
* Returns zero if successful. Otherwise a negative errno
114114
* is returned.
115115
*/
116-
int frwr_init_mr(struct rpcrdma_ia *ia, struct rpcrdma_mr *mr)
116+
int frwr_mr_init(struct rpcrdma_xprt *r_xprt, struct rpcrdma_mr *mr)
117117
{
118+
struct rpcrdma_ia *ia = &r_xprt->rx_ia;
118119
unsigned int depth = ia->ri_max_frwr_depth;
119120
struct scatterlist *sg;
120121
struct ib_mr *frmr;
@@ -128,6 +129,7 @@ int frwr_init_mr(struct rpcrdma_ia *ia, struct rpcrdma_mr *mr)
128129
if (!sg)
129130
goto out_list_err;
130131

132+
mr->mr_xprt = r_xprt;
131133
mr->frwr.fr_mr = frmr;
132134
mr->mr_dir = DMA_NONE;
133135
INIT_LIST_HEAD(&mr->mr_list);

net/sunrpc/xprtrdma/verbs.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -896,14 +896,12 @@ rpcrdma_mrs_create(struct rpcrdma_xprt *r_xprt)
896896
if (!mr)
897897
break;
898898

899-
rc = frwr_init_mr(ia, mr);
899+
rc = frwr_mr_init(r_xprt, mr);
900900
if (rc) {
901901
kfree(mr);
902902
break;
903903
}
904904

905-
mr->mr_xprt = r_xprt;
906-
907905
spin_lock(&buf->rb_lock);
908906
rpcrdma_mr_push(mr, &buf->rb_mrs);
909907
list_add(&mr->mr_all, &buf->rb_all_mrs);

net/sunrpc/xprtrdma/xprt_rdma.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,7 @@ rpcrdma_data_dir(bool writing)
536536
void frwr_reset(struct rpcrdma_req *req);
537537
int frwr_query_device(struct rpcrdma_xprt *r_xprt,
538538
const struct ib_device *device);
539-
int frwr_init_mr(struct rpcrdma_ia *ia, struct rpcrdma_mr *mr);
539+
int frwr_mr_init(struct rpcrdma_xprt *r_xprt, struct rpcrdma_mr *mr);
540540
void frwr_release_mr(struct rpcrdma_mr *mr);
541541
struct rpcrdma_mr_seg *frwr_map(struct rpcrdma_xprt *r_xprt,
542542
struct rpcrdma_mr_seg *seg,

0 commit comments

Comments
 (0)