summaryrefslogtreecommitdiffstats
path: root/rpc
diff options
context:
space:
mode:
authorJeff Darcy <jdarcy@redhat.com>2011-09-07 20:03:24 -0400
committerAnand Avati <avati@gluster.com>2011-09-07 23:48:01 -0700
commit694ef54978f382507a5127ce66da7770929ba2c2 (patch)
treeb98ee679c8d5f4b3556c0bf9af44e6b9729c2881 /rpc
parent81530d227deb52af38c7df770aef2200b9de539f (diff)
Eliminate many "var set but not used" warnings with newer gcc.
This fixes ~200 such warnings, but leaves three categories untouched. (1) Rpcgen code. (2) Macros which set variables in the outer (calling function) scope. (3) Variables which are set via function calls which may have side effects. Change-Id: I6554555f78ed26134251504b038da7e94adacbcd BUG: 2550 Reviewed-on: http://review.gluster.com/371 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@gluster.com>
Diffstat (limited to 'rpc')
-rw-r--r--rpc/rpc-lib/src/rpc-clnt.c3
-rw-r--r--rpc/rpc-transport/rdma/src/rdma.c26
2 files changed, 2 insertions, 27 deletions
diff --git a/rpc/rpc-lib/src/rpc-clnt.c b/rpc/rpc-lib/src/rpc-clnt.c
index acc4b0e57..b09f47ed3 100644
--- a/rpc/rpc-lib/src/rpc-clnt.c
+++ b/rpc/rpc-lib/src/rpc-clnt.c
@@ -310,7 +310,6 @@ saved_frames_unwind (struct saved_frames *saved_frames)
{
struct saved_frame *trav = NULL;
struct saved_frame *tmp = NULL;
- struct mem_pool *saved_frames_pool = NULL;
struct tm *frame_sent_tm = NULL;
char timestr[256] = {0,};
@@ -341,8 +340,6 @@ saved_frames_unwind (struct saved_frames *saved_frames)
trav->rpcreq->rpc_status = -1;
trav->rpcreq->cbkfn (trav->rpcreq, &iov, 1, trav->frame);
- saved_frames_pool
- = trav->rpcreq->conn->rpc_clnt->saved_frames_pool;
rpc_clnt_reply_deinit (trav->rpcreq,
trav->rpcreq->conn->rpc_clnt->reqpool);
diff --git a/rpc/rpc-transport/rdma/src/rdma.c b/rpc/rpc-transport/rdma/src/rdma.c
index e88148460..b88b884d5 100644
--- a/rpc/rpc-transport/rdma/src/rdma.c
+++ b/rpc/rpc-transport/rdma/src/rdma.c
@@ -491,8 +491,6 @@ __rdma_create_read_chunks (rdma_peer_t *peer, rdma_ioq_t *entry,
rdma_request_context_t *request_ctx)
{
int32_t ret = -1;
- rdma_device_t *device = NULL;
- rdma_private_t *priv = NULL;
int pos = 0;
GF_VALIDATE_OR_GOTO (RDMA_LOG_NAME, peer, out);
@@ -501,9 +499,6 @@ __rdma_create_read_chunks (rdma_peer_t *peer, rdma_ioq_t *entry,
GF_VALIDATE_OR_GOTO (RDMA_LOG_NAME, *ptr, out);
GF_VALIDATE_OR_GOTO (RDMA_LOG_NAME, request_ctx, out);
- priv = peer->trans->private;
- device = priv->device;
-
request_ctx->iobref = iobref_ref (entry->iobref);
if (type == rdma_areadch) {
@@ -1013,7 +1008,7 @@ __rdma_ioq_churn_request (rdma_peer_t *peer, rdma_ioq_t *entry,
}
if ((wtype != rdma_noch) || (rtype != rdma_noch)) {
- request_ctx = mem_get (priv->device->request_ctx_pool);
+ request_ctx = mem_get (device->request_ctx_pool);
if (request_ctx == NULL) {
ret = -1;
goto out;
@@ -1021,7 +1016,7 @@ __rdma_ioq_churn_request (rdma_peer_t *peer, rdma_ioq_t *entry,
memset (request_ctx, 0, sizeof (*request_ctx));
- request_ctx->pool = priv->device->request_ctx_pool;
+ request_ctx->pool = device->request_ctx_pool;
request_ctx->peer = peer;
entry->msg.request.rpc_req->conn_private = request_ctx;
@@ -1156,11 +1151,6 @@ __rdma_send_reply_inline (rdma_peer_t *peer, rdma_ioq_t *entry,
rdma_header_t *header = NULL;
int32_t send_size = 0, ret = 0;
char *buf = NULL;
- rdma_private_t *priv = NULL;
- rdma_device_t *device = NULL;
-
- priv = peer->trans->private;
- device = priv->device;
send_size = iov_length (entry->rpchdr, entry->rpchdr_count)
+ iov_length (entry->proghdr, entry->proghdr_count)
@@ -1440,14 +1430,9 @@ __rdma_send_reply_type_nomsg (rdma_peer_t *peer, rdma_ioq_t *entry,
char *buf = NULL;
uint32_t payload_size = 0;
int count = 0, i = 0;
- rdma_private_t *priv = NULL;
- rdma_device_t *device = NULL;
int32_t ret = 0;
struct iovec vector[MAX_IOVEC];
- priv = peer->trans->private;
- device = priv->device;
-
header = (rdma_header_t *)post->buf;
__rdma_fill_reply_header (header, entry->rpchdr, reply_info,
@@ -1512,11 +1497,6 @@ __rdma_send_reply_type_msg (rdma_peer_t *peer, rdma_ioq_t *entry,
int32_t send_size = 0, ret = 0;
char *ptr = NULL;
uint32_t payload_size = 0;
- rdma_private_t *priv = NULL;
- rdma_device_t *device = NULL;
-
- priv = peer->trans->private;
- device = priv->device;
send_size = iov_length (entry->rpchdr, entry->rpchdr_count)
+ iov_length (entry->proghdr, entry->proghdr_count)
@@ -4327,7 +4307,6 @@ static int
rdma_handshake_pollerr (rpc_transport_t *this)
{
rdma_private_t *priv = this->private;
- int32_t ret = 0;
char need_unref = 0, connected = 0;
gf_log (RDMA_LOG_NAME, GF_LOG_DEBUG,
@@ -4348,7 +4327,6 @@ rdma_handshake_pollerr (rpc_transport_t *this)
gf_log (RDMA_LOG_NAME, GF_LOG_ERROR,
"close () - error: %s",
strerror (errno));
- ret = -errno;
}
priv->tcp_connected = priv->connected = 0;
priv->sock = -1;