SUNRPC: Generalize the RPC buffer release API

xprtrdma needs to allocate the Call and Reply buffers separately.
TBH, the reliance on using a single buffer for the pair of XDR
buffers is transport implementation-specific.

Instead of passing just the rq_buffer into the buf_free method, pass
the task structure and let buf_free take care of freeing both
XDR buffers at once.

There's a micro-optimization here. In the common case, both
xprt_release and the transport's buf_free method were checking if
rq_buffer was NULL. Now the check is done only once per RPC.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
这个提交包含在:
Chuck Lever
2016-09-15 10:55:29 -04:00
提交者 Anna Schumaker
父节点 5fe6eaa1f9
当前提交 3435c74aed
修改 8 个文件,包含 20 行新增31 行删除

查看文件

@@ -186,7 +186,7 @@ xprt_rdma_bc_allocate(struct rpc_task *task)
}
static void
xprt_rdma_bc_free(void *buffer)
xprt_rdma_bc_free(struct rpc_task *task)
{
/* No-op: ctxt and page have already been freed. */
}