/* Recover reply buffers from pool. This happens when recovering from error conditions. Post-increment counter/array index.  */
void rpcrdma_recv_buffer_get(struct rpcrdma_req *req)
/* Recover reply buffers from pool. This happens when recovering from error conditions. Post-increment counter/array index.  */
void rpcrdma_recv_buffer_get(struct rpcrdma_req *req)
{
	struct rpcrdma_buffer *buffers = req->rl_buffer;
	unsigned long flags;
	if (req->rl_iov.length == 0)
		buffers = ((struct rpcrdma_req *) buffers)->rl_buffer;
	spin_lock_irqsave(&buffers->rb_lock, flags);
	if (buffers->rb_recv_index < buffers->rb_max_requests) {
		req->rl_reply = buffers->rb_recv_bufs[buffers->rb_recv_index];
		buffers->rb_recv_bufs[buffers->rb_recv_index++] = NULL;
	}
	spin_unlock_irqrestore(&buffers->rb_lock, flags);
}