diff options
author | Chuck Lever <chuck.lever@oracle.com> | 2017-02-08 23:00:43 +0100 |
---|---|---|
committer | Anna Schumaker <Anna.Schumaker@Netapp.com> | 2017-02-10 20:02:37 +0100 |
commit | 9a5c63e9c4056de8a73555131e6f698ddb0b9e0d (patch) | |
tree | 0227175ffb80c311e4296139308072b2c879bca5 /net/sunrpc/xprtrdma/xprt_rdma.h | |
parent | xprtrdma: Handle stale connection rejection (diff) | |
download | linux-9a5c63e9c4056de8a73555131e6f698ddb0b9e0d.tar.xz linux-9a5c63e9c4056de8a73555131e6f698ddb0b9e0d.zip |
xprtrdma: Refactor management of mw_list field
Clean up some duplicate code.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Diffstat (limited to 'net/sunrpc/xprtrdma/xprt_rdma.h')
-rw-r--r-- | net/sunrpc/xprtrdma/xprt_rdma.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/net/sunrpc/xprtrdma/xprt_rdma.h b/net/sunrpc/xprtrdma/xprt_rdma.h index 852dd0a750a5..171a35116de9 100644 --- a/net/sunrpc/xprtrdma/xprt_rdma.h +++ b/net/sunrpc/xprtrdma/xprt_rdma.h @@ -354,6 +354,22 @@ rpcr_to_rdmar(struct rpc_rqst *rqst) return rqst->rq_xprtdata; } +static inline void +rpcrdma_push_mw(struct rpcrdma_mw *mw, struct list_head *list) +{ + list_add_tail(&mw->mw_list, list); +} + +static inline struct rpcrdma_mw * +rpcrdma_pop_mw(struct list_head *list) +{ + struct rpcrdma_mw *mw; + + mw = list_first_entry(list, struct rpcrdma_mw, mw_list); + list_del(&mw->mw_list); + return mw; +} + /* * struct rpcrdma_buffer -- holds list/queue of pre-registered memory for * inline requests/replies, and client/server credits. |