diff options
author | Chuck Lever <chuck.lever@oracle.com> | 2018-05-04 15:35:31 -0400 |
---|---|---|
committer | Anna Schumaker <Anna.Schumaker@Netapp.com> | 2018-05-07 09:20:04 -0400 |
commit | e68699cc1a025d24608cf1533abc2edd7256d82c (patch) | |
tree | c56e2031b28e5f299e6d0e004cbd60f3f1f0e0fb /net | |
parent | a7986f09986ac1befc85bcab30970312c476dbc7 (diff) | |
download | linux-e68699cc1a025d24608cf1533abc2edd7256d82c.tar.gz linux-e68699cc1a025d24608cf1533abc2edd7256d82c.tar.bz2 linux-e68699cc1a025d24608cf1533abc2edd7256d82c.zip |
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')
-rw-r--r-- | net/sunrpc/xprtrdma/verbs.c | 22 |
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: return rc; } -static struct rpcrdma_req * -rpcrdma_buffer_get_req_locked(struct rpcrdma_buffer *buf) -{ - struct rpcrdma_req *req; - - req = list_first_entry(&buf->rb_send_bufs, - struct rpcrdma_req, rl_list); - list_del_init(&req->rl_list); - return req; -} - static struct rpcrdma_rep * rpcrdma_buffer_get_rep_locked(struct rpcrdma_buffer *buf) { @@ -1351,15 +1340,12 @@ rpcrdma_buffer_get(struct rpcrdma_buffer *buffers) struct rpcrdma_req *req; spin_lock(&buffers->rb_lock); - if (unlikely(list_empty(&buffers->rb_send_bufs))) - goto out_noreqs; - req = rpcrdma_buffer_get_req_locked(buffers); + req = list_first_entry_or_null(&buffers->rb_send_bufs, + struct rpcrdma_req, rl_list); + if (req) + list_del_init(&req->rl_list); spin_unlock(&buffers->rb_lock); return req; - -out_noreqs: - spin_unlock(&buffers->rb_lock); - return NULL; } /** |