xprtrdma: Clean up regbuf helpers
For code legibility, clean up the function names to be consistent with the pattern: "rpcrdma" _ object-type _ action Also rpcrdma_regbuf_alloc and rpcrdma_regbuf_free no longer have any callers outside of verbs.c, and can thus be made static. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Este cometimento está contido em:

cometido por
Anna Schumaker

ascendente
0f665ceb71
cometimento
d2832af38d
@@ -550,25 +550,34 @@ struct rpcrdma_req *rpcrdma_buffer_get(struct rpcrdma_buffer *);
|
||||
void rpcrdma_buffer_put(struct rpcrdma_req *);
|
||||
void rpcrdma_recv_buffer_put(struct rpcrdma_rep *);
|
||||
|
||||
struct rpcrdma_regbuf *rpcrdma_alloc_regbuf(size_t, enum dma_data_direction,
|
||||
gfp_t);
|
||||
bool rpcrdma_regbuf_realloc(struct rpcrdma_regbuf *rb, size_t size,
|
||||
gfp_t flags);
|
||||
bool __rpcrdma_dma_map_regbuf(struct rpcrdma_ia *, struct rpcrdma_regbuf *);
|
||||
void rpcrdma_free_regbuf(struct rpcrdma_regbuf *);
|
||||
bool __rpcrdma_regbuf_dma_map(struct rpcrdma_xprt *r_xprt,
|
||||
struct rpcrdma_regbuf *rb);
|
||||
|
||||
static inline bool
|
||||
rpcrdma_regbuf_is_mapped(struct rpcrdma_regbuf *rb)
|
||||
/**
|
||||
* rpcrdma_regbuf_is_mapped - check if buffer is DMA mapped
|
||||
*
|
||||
* Returns true if the buffer is now mapped to rb->rg_device.
|
||||
*/
|
||||
static inline bool rpcrdma_regbuf_is_mapped(struct rpcrdma_regbuf *rb)
|
||||
{
|
||||
return rb->rg_device != NULL;
|
||||
}
|
||||
|
||||
static inline bool
|
||||
rpcrdma_dma_map_regbuf(struct rpcrdma_ia *ia, struct rpcrdma_regbuf *rb)
|
||||
/**
|
||||
* rpcrdma_regbuf_dma_map - DMA-map a regbuf
|
||||
* @r_xprt: controlling transport instance
|
||||
* @rb: regbuf to be mapped
|
||||
*
|
||||
* Returns true if the buffer is currently DMA mapped.
|
||||
*/
|
||||
static inline bool rpcrdma_regbuf_dma_map(struct rpcrdma_xprt *r_xprt,
|
||||
struct rpcrdma_regbuf *rb)
|
||||
{
|
||||
if (likely(rpcrdma_regbuf_is_mapped(rb)))
|
||||
return true;
|
||||
return __rpcrdma_dma_map_regbuf(ia, rb);
|
||||
return __rpcrdma_regbuf_dma_map(r_xprt, rb);
|
||||
}
|
||||
|
||||
/*
|
||||
|
Criar uma nova questão referindo esta
Bloquear um utilizador