diff options
author | Pavel Emelyanov <xemul@parallels.com> | 2010-09-29 16:02:43 +0400 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2010-10-01 17:18:52 -0400 |
commit | bd1722d4316e42a12fe6337ebe34d7e1e2c088b2 (patch) | |
tree | 358d45aaf5fb08a177fd6fbe5dcf8872160c30fc /net/sunrpc/xprtrdma | |
parent | 2b44f1ba40914777f4b1075254ba97663d4e2574 (diff) | |
download | kernel_samsung_tuna-bd1722d4316e42a12fe6337ebe34d7e1e2c088b2.zip kernel_samsung_tuna-bd1722d4316e42a12fe6337ebe34d7e1e2c088b2.tar.gz kernel_samsung_tuna-bd1722d4316e42a12fe6337ebe34d7e1e2c088b2.tar.bz2 |
sunrpc: Factor out rpc_xprt allocation
Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'net/sunrpc/xprtrdma')
-rw-r--r-- | net/sunrpc/xprtrdma/transport.c | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/net/sunrpc/xprtrdma/transport.c b/net/sunrpc/xprtrdma/transport.c index a85e866..9d77bf2 100644 --- a/net/sunrpc/xprtrdma/transport.c +++ b/net/sunrpc/xprtrdma/transport.c @@ -285,23 +285,14 @@ xprt_setup_rdma(struct xprt_create *args) return ERR_PTR(-EBADF); } - xprt = kzalloc(sizeof(struct rpcrdma_xprt), GFP_KERNEL); + xprt = xprt_alloc(sizeof(struct rpcrdma_xprt), + xprt_rdma_slot_table_entries); if (xprt == NULL) { dprintk("RPC: %s: couldn't allocate rpcrdma_xprt\n", __func__); return ERR_PTR(-ENOMEM); } - xprt->max_reqs = xprt_rdma_slot_table_entries; - xprt->slot = kcalloc(xprt->max_reqs, - sizeof(struct rpc_rqst), GFP_KERNEL); - if (xprt->slot == NULL) { - dprintk("RPC: %s: couldn't allocate %d slots\n", - __func__, xprt->max_reqs); - kfree(xprt); - return ERR_PTR(-ENOMEM); - } - /* 60 second timeout, no retries */ xprt->timeout = &xprt_rdma_default_timeout; xprt->bind_timeout = (60U * HZ); |