diff options
author | Anand V. Avati <avati@dev.gluster.com> | 2010-10-29 03:32:44 -0700 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2010-10-29 03:32:44 -0700 |
commit | c1b80f0f590e2d7448b890b57e80f4a1b2e39a03 (patch) | |
tree | 37fbc26dafd9af541de9c7938dc73c875068227a | |
parent | 8ea6882c424afd3f18ad1273ec31d34f5d74e47e (diff) |
Revert "rpc-transport/rdma: create request_context only if message contains read chunks or write chunks."
This reverts commit b66f4598f4dafb6479232b20c5c521ab0da4e84a.
-rw-r--r-- | rpc/rpc-transport/rdma/src/rdma.c | 44 |
1 files changed, 18 insertions, 26 deletions
diff --git a/rpc/rpc-transport/rdma/src/rdma.c b/rpc/rpc-transport/rdma/src/rdma.c index 903536410af..6a95f92945b 100644 --- a/rpc/rpc-transport/rdma/src/rdma.c +++ b/rpc/rpc-transport/rdma/src/rdma.c @@ -1000,25 +1000,22 @@ __rdma_ioq_churn_request (rdma_peer_t *peer, rdma_ioq_t *entry, goto out; } - if ((wtype != rdma_noch) || (rtype != rdma_noch)) { - request_ctx = mem_get (priv->device->request_ctx_pool); - if (request_ctx == NULL) { - ret = -1; - gf_log (RDMA_LOG_NAME, GF_LOG_ERROR, "out of memory"); - goto out; - } - - memset (request_ctx, 0, sizeof (*request_ctx)); + request_ctx = mem_get (priv->device->request_ctx_pool); + if (request_ctx == NULL) { + ret = -1; + gf_log (RDMA_LOG_NAME, GF_LOG_ERROR, "out of memory"); + goto out; + } - request_ctx->pool = priv->device->request_ctx_pool; - request_ctx->peer = peer; + memset (request_ctx, 0, sizeof (*request_ctx)); - entry->msg.request.rpc_req->conn_private = request_ctx; + request_ctx->pool = priv->device->request_ctx_pool; + request_ctx->peer = peer; - if (entry->msg.request.rsp_iobref != NULL) { - request_ctx->rsp_iobref - = iobref_ref (entry->msg.request.rsp_iobref); - } + entry->msg.request.rpc_req->conn_private = request_ctx; + if (entry->msg.request.rsp_iobref != NULL) { + request_ctx->rsp_iobref + = iobref_ref (entry->msg.request.rsp_iobref); } rpc_msg = (struct rpc_msg *) entry->rpchdr[0].iov_base; @@ -1097,10 +1094,7 @@ out: if (ret == -1) { rpc_req = entry->msg.request.rpc_req; - if (request_ctx != NULL) { - __rdma_request_context_destroy (rpc_req->conn_private); - } - + __rdma_request_context_destroy (rpc_req->conn_private); rpc_req->conn_private = NULL; } @@ -3060,13 +3054,11 @@ rdma_pollin_notify (rdma_peer_t *peer, rdma_post_t *post) rpc_req->conn_private = NULL; priv = peer->trans->private; - if (request_context != NULL) { - pthread_mutex_lock (&priv->write_mutex); - { - __rdma_request_context_destroy (request_context); - } - pthread_mutex_unlock (&priv->write_mutex); + pthread_mutex_lock (&priv->write_mutex); + { + __rdma_request_context_destroy (request_context); } + pthread_mutex_unlock (&priv->write_mutex); pollin->is_reply = 1; } |