summaryrefslogtreecommitdiffstats
path: root/net/sunrpc/xprtrdma
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2018-05-04 15:35:31 -0400
committerAnna Schumaker <Anna.Schumaker@Netapp.com>2018-05-07 09:20:04 -0400
commite68699cc1a025d24608cf1533abc2edd7256d82c (patch)
treec56e2031b28e5f299e6d0e004cbd60f3f1f0e0fb /net/sunrpc/xprtrdma
parenta7986f09986ac1befc85bcab30970312c476dbc7 (diff)
xprtrdma: Remove rpcrdma_buffer_get_req_locked()
Clean up. There is only one call-site for this helper, and it can be simplified by using list_first_entry_or_null(). Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Diffstat (limited to 'net/sunrpc/xprtrdma')
-rw-r--r--net/sunrpc/xprtrdma/verbs.c22
1 files changed, 4 insertions, 18 deletions
diff --git a/net/sunrpc/xprtrdma/verbs.c b/net/sunrpc/xprtrdma/verbs.c
index 601b78b64483..b9a6e5d8d8c7 100644
--- a/net/sunrpc/xprtrdma/verbs.c
+++ b/net/sunrpc/xprtrdma/verbs.c
@@ -1175,17 +1175,6 @@ out:
1175 return rc; 1175 return rc;
1176} 1176}
1177 1177
1178static struct rpcrdma_req *
1179rpcrdma_buffer_get_req_locked(struct rpcrdma_buffer *buf)
1180{
1181 struct rpcrdma_req *req;
1182
1183 req = list_first_entry(&buf->rb_send_bufs,
1184 struct rpcrdma_req, rl_list);
1185 list_del_init(&req->rl_list);
1186 return req;
1187}
1188
1189static struct rpcrdma_rep * 1178static struct rpcrdma_rep *
1190rpcrdma_buffer_get_rep_locked(struct rpcrdma_buffer *buf) 1179rpcrdma_buffer_get_rep_locked(struct rpcrdma_buffer *buf)
1191{ 1180{
@@ -1351,15 +1340,12 @@ rpcrdma_buffer_get(struct rpcrdma_buffer *buffers)
1351 struct rpcrdma_req *req; 1340 struct rpcrdma_req *req;
1352 1341
1353 spin_lock(&buffers->rb_lock); 1342 spin_lock(&buffers->rb_lock);
1354 if (unlikely(list_empty(&buffers->rb_send_bufs))) 1343 req = list_first_entry_or_null(&buffers->rb_send_bufs,
1355 goto out_noreqs; 1344 struct rpcrdma_req, rl_list);
1356 req = rpcrdma_buffer_get_req_locked(buffers); 1345 if (req)
1346 list_del_init(&req->rl_list);
1357 spin_unlock(&buffers->rb_lock); 1347 spin_unlock(&buffers->rb_lock);
1358 return req; 1348 return req;
1359
1360out_noreqs:
1361 spin_unlock(&buffers->rb_lock);
1362 return NULL;
1363} 1349}
1364 1350
1365/** 1351/**