summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt
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 /xlators/mgmt
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 'xlators/mgmt')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-brick-ops.c9
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-geo-rep.c9
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-log-ops.c3
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-op-sm.c4
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-rebalance.c5
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-replace-brick.c3
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-rpc-ops.c23
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-volume-ops.c3
-rw-r--r--xlators/mgmt/glusterd/src/glusterd.h4
9 files changed, 0 insertions, 63 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-brick-ops.c b/xlators/mgmt/glusterd/src/glusterd-brick-ops.c
index 5fbdfc11660..8b3a03b6f3e 100644
--- a/xlators/mgmt/glusterd/src/glusterd-brick-ops.c
+++ b/xlators/mgmt/glusterd/src/glusterd-brick-ops.c
@@ -50,7 +50,6 @@ glusterd_handle_add_brick (rpcsvc_request_t *req)
char err_str[2048] = {0,};
gf1_cli_add_brick_rsp rsp = {0,};
glusterd_volinfo_t *volinfo = NULL;
- glusterd_conf_t *priv = NULL;
xlator_t *this = NULL;
char *free_ptr = NULL;
glusterd_brickinfo_t *tmpbrkinfo = NULL;
@@ -60,8 +59,6 @@ glusterd_handle_add_brick (rpcsvc_request_t *req)
this = THIS;
GF_ASSERT(this);
- priv = this->private;
-
GF_ASSERT (req);
INIT_LIST_HEAD (&tmpvolinfo.bricks);
@@ -450,9 +447,6 @@ glusterd_op_perform_add_bricks (glusterd_volinfo_t *volinfo, int32_t count,
char *free_ptr2 = NULL;
char *saveptr = NULL;
int32_t ret = -1;
- glusterd_conf_t *priv = NULL;
-
- priv = THIS->private;
GF_ASSERT (volinfo);
@@ -523,14 +517,11 @@ glusterd_op_perform_remove_brick (glusterd_volinfo_t *volinfo, char *brick)
glusterd_brickinfo_t *brickinfo = NULL;
char *dup_brick = NULL;
- glusterd_conf_t *priv = NULL;
int32_t ret = -1;
GF_ASSERT (volinfo);
GF_ASSERT (brick);
- priv = THIS->private;
-
dup_brick = gf_strdup (brick);
if (!dup_brick)
goto out;
diff --git a/xlators/mgmt/glusterd/src/glusterd-geo-rep.c b/xlators/mgmt/glusterd/src/glusterd-geo-rep.c
index 9630546b42a..86681146bb2 100644
--- a/xlators/mgmt/glusterd/src/glusterd-geo-rep.c
+++ b/xlators/mgmt/glusterd/src/glusterd-geo-rep.c
@@ -832,15 +832,12 @@ glusterd_op_verify_gsync_running (glusterd_volinfo_t *volinfo,
int ret = -1;
char msg[2048] = {0};
uuid_t uuid = {0};
- glusterd_conf_t *priv = NULL;
GF_ASSERT (THIS && THIS->private);
GF_ASSERT (volinfo);
GF_ASSERT (slave);
GF_ASSERT (op_errstr);
- priv = THIS->private;
-
if (GLUSTERD_STATUS_STARTED != volinfo->status) {
snprintf (msg, sizeof (msg), "Volume %s needs to be started "
"before "GEOREP" start", volinfo->volname);
@@ -1004,13 +1001,10 @@ stop_gsync (char *master, char *slave, char **msg)
char pidfile[PATH_MAX] = {0,};
char buf [1024] = {0,};
int i = 0;
- glusterd_conf_t *priv = NULL;
GF_ASSERT (THIS);
GF_ASSERT (THIS->private);
- priv = THIS->private;
-
pfd = gsyncd_getpidfile (master, slave, pidfile);
if (pfd == -2) {
gf_log ("", GF_LOG_ERROR, GEOREP" stop validation "
@@ -1310,13 +1304,10 @@ glusterd_set_marker_gsync (glusterd_volinfo_t *volinfo)
int ret = -1;
int marker_set = _gf_false;
char *gsync_status = NULL;
- glusterd_conf_t *priv = NULL;
GF_ASSERT (THIS);
GF_ASSERT (THIS->private);
- priv = THIS->private;
-
marker_set = glusterd_volinfo_get_boolean (volinfo, VKEY_MARKER_XTIME);
if (marker_set == -1) {
gf_log ("", GF_LOG_ERROR, "failed to get the marker status");
diff --git a/xlators/mgmt/glusterd/src/glusterd-log-ops.c b/xlators/mgmt/glusterd/src/glusterd-log-ops.c
index 7274d102418..77275ca95a1 100644
--- a/xlators/mgmt/glusterd/src/glusterd-log-ops.c
+++ b/xlators/mgmt/glusterd/src/glusterd-log-ops.c
@@ -89,7 +89,6 @@ glusterd_handle_log_locate (rpcsvc_request_t *req)
int32_t ret = -1;
gf1_cli_log_locate_req cli_req = {0,};
gf1_cli_log_locate_rsp rsp = {0,};
- glusterd_conf_t *priv = NULL;
glusterd_volinfo_t *volinfo = NULL;
glusterd_brickinfo_t *brickinfo = NULL;
char tmp_str[PATH_MAX] = {0,};
@@ -99,8 +98,6 @@ glusterd_handle_log_locate (rpcsvc_request_t *req)
GF_ASSERT (req);
- priv = THIS->private;
-
if (!xdr_to_generic (req->msg[0], &cli_req,
(xdrproc_t)xdr_gf1_cli_log_locate_req)) {
//failed to decode msg;
diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
index 7fe68ded0b3..44298d6637a 100644
--- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c
+++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
@@ -1922,14 +1922,12 @@ glusterd_op_brick_disconnect (void *data)
static int
glusterd_op_ac_rcvd_commit_op_acc (glusterd_op_sm_event_t *event, void *ctx)
{
- glusterd_conf_t *priv = NULL;
dict_t *dict = NULL;
int ret = 0;
gf_boolean_t commit_ack_inject = _gf_true;
glusterd_op_t op = GD_OP_NONE;
op = glusterd_op_get_op ();
- priv = THIS->private;
GF_ASSERT (event);
if (opinfo.pending_count > 0)
@@ -2800,7 +2798,6 @@ glusterd_op_ac_rcvd_brick_op_acc (glusterd_op_sm_event_t *event, void *ctx)
char *op_errstr = NULL;
glusterd_op_t op = GD_OP_NONE;
dict_t *op_ctx = NULL;
- gf_boolean_t free_errstr = _gf_true;
glusterd_req_ctx_t *req_ctx = NULL;
GF_ASSERT (event);
@@ -2818,7 +2815,6 @@ glusterd_op_ac_rcvd_brick_op_acc (glusterd_op_sm_event_t *event, void *ctx)
gf_log ("glusterd", GF_LOG_ERROR, "unknown response received "
"from %s:%s", brickinfo->hostname, brickinfo->path);
ret = -1;
- free_errstr = _gf_true;
goto out;
}
diff --git a/xlators/mgmt/glusterd/src/glusterd-rebalance.c b/xlators/mgmt/glusterd/src/glusterd-rebalance.c
index 68cbab54b62..3cfa04bdd32 100644
--- a/xlators/mgmt/glusterd/src/glusterd-rebalance.c
+++ b/xlators/mgmt/glusterd/src/glusterd-rebalance.c
@@ -569,11 +569,9 @@ glusterd_handle_defrag_volume_v2 (rpcsvc_request_t *req)
glusterd_volinfo_t *volinfo = NULL;
gf2_cli_defrag_vol_rsp rsp = {0,};
char msg[2048] = {0};
- glusterd_conf_t *priv = NULL;
GF_ASSERT (req);
- priv = THIS->private;
if (!xdr_to_generic (req->msg[0], &cli_req,
(xdrproc_t)xdr_gf1_cli_defrag_vol_req)) {
//failed to decode msg;
@@ -628,7 +626,6 @@ glusterd_handle_defrag_volume (rpcsvc_request_t *req)
{
int32_t ret = -1;
gf1_cli_defrag_vol_req cli_req = {0,};
- glusterd_conf_t *priv = NULL;
char cmd_str[4096] = {0,};
glusterd_volinfo_t *volinfo = NULL;
gf1_cli_defrag_vol_rsp rsp = {0,};
@@ -636,8 +633,6 @@ glusterd_handle_defrag_volume (rpcsvc_request_t *req)
GF_ASSERT (req);
- priv = THIS->private;
-
if (!xdr_to_generic (req->msg[0], &cli_req,
(xdrproc_t)xdr_gf1_cli_defrag_vol_req)) {
//failed to decode msg;
diff --git a/xlators/mgmt/glusterd/src/glusterd-replace-brick.c b/xlators/mgmt/glusterd/src/glusterd-replace-brick.c
index f8f0e8a844d..f84dae17484 100644
--- a/xlators/mgmt/glusterd/src/glusterd-replace-brick.c
+++ b/xlators/mgmt/glusterd/src/glusterd-replace-brick.c
@@ -1449,9 +1449,6 @@ glusterd_op_perform_replace_brick (glusterd_volinfo_t *volinfo,
glusterd_brickinfo_t *old_brickinfo = NULL;
glusterd_brickinfo_t *new_brickinfo = NULL;
int32_t ret = -1;
- glusterd_conf_t *priv = NULL;
-
- priv = THIS->private;
GF_ASSERT (volinfo);
diff --git a/xlators/mgmt/glusterd/src/glusterd-rpc-ops.c b/xlators/mgmt/glusterd/src/glusterd-rpc-ops.c
index 06dff923bf8..06cbdd7935d 100644
--- a/xlators/mgmt/glusterd/src/glusterd-rpc-ops.c
+++ b/xlators/mgmt/glusterd/src/glusterd-rpc-ops.c
@@ -431,14 +431,11 @@ glusterd3_1_probe_cbk (struct rpc_req *req, struct iovec *iov,
int count, void *myframe)
{
gd1_mgmt_probe_rsp rsp = {{0},};
- glusterd_conf_t *conf = NULL;
int ret = 0;
glusterd_peerinfo_t *peerinfo = NULL;
glusterd_friend_sm_event_t *event = NULL;
glusterd_probe_ctx_t *ctx = NULL;
- conf = THIS->private;
-
if (-1 == req->rpc_status) {
goto out;
}
@@ -512,7 +509,6 @@ glusterd3_1_friend_add_cbk (struct rpc_req * req, struct iovec *iov,
int count, void *myframe)
{
gd1_mgmt_friend_rsp rsp = {{0},};
- glusterd_conf_t *conf = NULL;
int ret = -1;
glusterd_friend_sm_event_t *event = NULL;
glusterd_friend_sm_event_type_t event_type = GD_FRIEND_EVENT_NONE;
@@ -522,8 +518,6 @@ glusterd3_1_friend_add_cbk (struct rpc_req * req, struct iovec *iov,
glusterd_probe_ctx_t *ctx = NULL;
glusterd_friend_update_ctx_t *ev_ctx = NULL;
- conf = THIS->private;
-
if (-1 == req->rpc_status) {
rsp.op_ret = -1;
rsp.op_errno = EINVAL;
@@ -699,7 +693,6 @@ int32_t
glusterd3_1_friend_update_cbk (struct rpc_req *req, struct iovec *iov,
int count, void *myframe)
{
- gd1_mgmt_cluster_lock_rsp rsp = {{0},};
int ret = -1;
int32_t op_ret = 0;
char str[50] = {0,};
@@ -707,22 +700,9 @@ glusterd3_1_friend_update_cbk (struct rpc_req *req, struct iovec *iov,
GF_ASSERT (req);
if (-1 == req->rpc_status) {
- rsp.op_ret = -1;
- rsp.op_errno = EINVAL;
goto out;
}
-/* ret = xdr_to_generic (*iov, &rsp, (xdrproc_t)xdr_gd1_mgmt_friend_update_rsp);
- if (ret < 0) {
- gf_log ("", GF_LOG_ERROR, "error");
- rsp.op_ret = -1;
- rsp.op_errno = EINVAL;
- goto out;
- }
- uuid_unparse (rsp.uuid, str);
-
- op_ret = rsp.op_ret;
-*/
gf_log ("glusterd", GF_LOG_INFO,
"Received %s from uuid: %s",
(op_ret)?"RJT":"ACC", str);
@@ -1475,7 +1455,6 @@ glusterd3_1_friend_add (call_frame_t *frame, xlator_t *this,
glusterd_peerinfo_t *peerinfo = NULL;
glusterd_conf_t *priv = NULL;
glusterd_friend_sm_event_t *event = NULL;
- glusterd_friend_req_ctx_t *ctx = NULL;
dict_t *vols = NULL;
@@ -1489,8 +1468,6 @@ glusterd3_1_friend_add (call_frame_t *frame, xlator_t *this,
GF_ASSERT (priv);
- ctx = event->ctx;
-
peerinfo = event->peerinfo;
ret = glusterd_build_volume_dict (&vols);
diff --git a/xlators/mgmt/glusterd/src/glusterd-volume-ops.c b/xlators/mgmt/glusterd/src/glusterd-volume-ops.c
index d7b28ba1e84..90d3f16bc45 100644
--- a/xlators/mgmt/glusterd/src/glusterd-volume-ops.c
+++ b/xlators/mgmt/glusterd/src/glusterd-volume-ops.c
@@ -52,7 +52,6 @@ glusterd_handle_create_volume (rpcsvc_request_t *req)
void *cli_rsp = NULL;
char err_str[2048] = {0,};
gf1_cli_create_vol_rsp rsp = {0,};
- glusterd_conf_t *priv = NULL;
xlator_t *this = NULL;
char *free_ptr = NULL;
char *trans_type = NULL;
@@ -67,8 +66,6 @@ glusterd_handle_create_volume (rpcsvc_request_t *req)
this = THIS;
GF_ASSERT(this);
- priv = this->private;
-
ret = -1;
if (!xdr_to_generic (req->msg[0], &cli_req,
(xdrproc_t)xdr_gf1_cli_create_vol_req)) {
diff --git a/xlators/mgmt/glusterd/src/glusterd.h b/xlators/mgmt/glusterd/src/glusterd.h
index 5a39c30899d..699c03c4b12 100644
--- a/xlators/mgmt/glusterd/src/glusterd.h
+++ b/xlators/mgmt/glusterd/src/glusterd.h
@@ -297,10 +297,6 @@ typedef ssize_t (*gd_serialize_t) (struct iovec outmsg, void *args);
}
#define GLUSTERD_STACK_DESTROY(frame) do {\
- void *__local = NULL; \
- xlator_t *__xl = NULL; \
- __xl = frame->this; \
- __local = frame->local; \
frame->local = NULL; \
STACK_DESTROY (frame->root);\
} while (0)