From 694ef54978f382507a5127ce66da7770929ba2c2 Mon Sep 17 00:00:00 2001 From: Jeff Darcy Date: Wed, 7 Sep 2011 20:03:24 -0400 Subject: 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 Reviewed-by: Anand Avati --- xlators/features/locks/src/entrylk.c | 2 -- xlators/features/marker/src/marker-quota.c | 56 ----------------------------- xlators/features/quiesce/src/quiesce.c | 57 ------------------------------ xlators/features/quota/src/quota.c | 10 ------ 4 files changed, 125 deletions(-) (limited to 'xlators/features') diff --git a/xlators/features/locks/src/entrylk.c b/xlators/features/locks/src/entrylk.c index f22ae0d748d..c3f40829b57 100644 --- a/xlators/features/locks/src/entrylk.c +++ b/xlators/features/locks/src/entrylk.c @@ -603,7 +603,6 @@ pl_common_entrylk (call_frame_t *frame, xlator_t *this, int32_t op_errno = 0; void * transport = NULL; - pid_t pid = -1; pl_inode_t * pinode = NULL; int ret = -1; @@ -626,7 +625,6 @@ pl_common_entrylk (call_frame_t *frame, xlator_t *this, entrylk_trace_in (this, frame, volume, fd, loc, basename, cmd, type); - pid = frame->root->pid; owner = frame->root->lk_owner; transport = frame->root->trans; diff --git a/xlators/features/marker/src/marker-quota.c b/xlators/features/marker/src/marker-quota.c index fc1f3a71b92..ebe205fc604 100644 --- a/xlators/features/marker/src/marker-quota.c +++ b/xlators/features/marker/src/marker-quota.c @@ -281,15 +281,12 @@ mark_inode_undirty (call_frame_t *frame, void *cookie, xlator_t *this, int64_t *size = NULL; dict_t *newdict = NULL; quota_local_t *local = NULL; - marker_conf_t *priv = NULL; local = (quota_local_t *) frame->local; if (op_ret == -1) goto err; - priv = (marker_conf_t *) this->private; - if (!dict) goto wind; @@ -341,15 +338,12 @@ update_size_xattr (call_frame_t *frame, void *cookie, xlator_t *this, int64_t *size = NULL; int64_t *delta = NULL; quota_local_t *local = NULL; - marker_conf_t *priv = NULL; local = frame->local; if (op_ret == -1) goto err; - priv = this->private; - if (dict == NULL) { gf_log (this->name, GF_LOG_WARNING, "Dict is null while updating the size xattr %s", @@ -429,12 +423,9 @@ get_dirty_inode_size (call_frame_t *frame, xlator_t *this) int32_t ret = -1; dict_t *dict = NULL; quota_local_t *local = NULL; - marker_conf_t *priv = NULL; local = (quota_local_t *) frame->local; - priv = (marker_conf_t *) this->private; - dict = dict_new (); if (!dict) { ret = -1; @@ -730,7 +721,6 @@ check_if_still_dirty (call_frame_t *frame, int32_t ret = -1; fd_t *fd = NULL; quota_local_t *local = NULL; - marker_conf_t *priv = NULL; local = frame->local; @@ -740,8 +730,6 @@ check_if_still_dirty (call_frame_t *frame, goto err; } - priv = this->private; - if (!dict) { ret = -1; goto err; @@ -790,15 +778,12 @@ get_dirty_xattr (call_frame_t *frame, void *cookie, int32_t ret = -1; dict_t *xattr_req = NULL; quota_local_t *local = NULL; - marker_conf_t *priv = NULL; if (op_ret == -1) { dirty_inode_updation_done (frame, NULL, this, 0, 0); return 0; } - priv = (marker_conf_t *) this->private; - local = frame->local; xattr_req = dict_new (); @@ -947,7 +932,6 @@ create_dirty_xattr (call_frame_t *frame, void *cookie, xlator_t *this, int32_t ret = -1; dict_t *newdict = NULL; quota_local_t *local = NULL; - marker_conf_t *priv = NULL; if (op_ret < 0) { goto err; @@ -955,8 +939,6 @@ create_dirty_xattr (call_frame_t *frame, void *cookie, xlator_t *this, local = frame->local; - priv = (marker_conf_t *) this->private; - if (local->loc.inode->ia_type == IA_IFDIR) { newdict = dict_new (); if (!newdict) { @@ -999,7 +981,6 @@ quota_create_xattr (xlator_t *this, call_frame_t *frame) dict_t *dict = NULL; char key[512] = {0, }; quota_local_t *local = NULL; - marker_conf_t *priv = NULL; quota_inode_ctx_t *ctx = NULL; inode_contribution_t *contri = NULL; @@ -1008,8 +989,6 @@ quota_create_xattr (xlator_t *this, call_frame_t *frame) local = frame->local; - priv = (marker_conf_t *) this->private; - ret = quota_inode_ctx_get (local->loc.inode, this, &ctx); if (ret < 0) { ctx = quota_inode_ctx_new (local->loc.inode, this); @@ -1081,7 +1060,6 @@ quota_check_n_set_inode_xattr (call_frame_t *frame, void *cookie, quota_local_t *local = NULL; int64_t *size = NULL, *contri = NULL; int8_t dirty = 0; - marker_conf_t *priv = NULL; int32_t ret = 0; char contri_key[512] = {0, }; @@ -1090,7 +1068,6 @@ quota_check_n_set_inode_xattr (call_frame_t *frame, void *cookie, } local = frame->local; - priv = this->private; ret = dict_get_bin (dict, QUOTA_SIZE_KEY, (void **) &size); if (ret < 0) @@ -1400,7 +1377,6 @@ quota_mark_undirty (call_frame_t *frame, dict_t *newdict = NULL; quota_local_t *local = NULL; quota_inode_ctx_t *ctx = NULL; - marker_conf_t *priv = NULL; local = frame->local; @@ -1412,8 +1388,6 @@ quota_mark_undirty (call_frame_t *frame, goto err; } - priv = this->private; - //update the size of the parent inode if (dict != NULL) { ret = quota_inode_ctx_get (local->parent_loc.inode, this, &ctx); @@ -1482,7 +1456,6 @@ quota_update_parent_size (call_frame_t *frame, int64_t *size = NULL; int32_t ret = -1; dict_t *newdict = NULL; - marker_conf_t *priv = NULL; quota_local_t *local = NULL; quota_inode_ctx_t *ctx = NULL; @@ -1506,8 +1479,6 @@ quota_update_parent_size (call_frame_t *frame, local->loc.path, local->ctx->size, local->contri->contribution); - priv = this->private; - if (dict == NULL) { op_errno = EINVAL; goto err; @@ -1571,7 +1542,6 @@ quota_update_inode_contribution (call_frame_t *frame, void *cookie, dict_t *newdict = NULL; quota_local_t *local = NULL; quota_inode_ctx_t *ctx = NULL; - marker_conf_t *priv = NULL; inode_contribution_t *contribution = NULL; local = frame->local; @@ -1584,8 +1554,6 @@ quota_update_inode_contribution (call_frame_t *frame, void *cookie, goto err; } - priv = this->private; - ctx = local->ctx; contribution = local->contri; @@ -1691,7 +1659,6 @@ quota_fetch_child_size_and_contri (call_frame_t *frame, void *cookie, char contri_key [512] = {0, }; dict_t *newdict = NULL; quota_local_t *local = NULL; - marker_conf_t *priv = NULL; quota_inode_ctx_t *ctx = NULL; local = frame->local; @@ -1709,8 +1676,6 @@ quota_fetch_child_size_and_contri (call_frame_t *frame, void *cookie, gf_log (this->name, GF_LOG_DEBUG, "%s marked dirty", local->parent_loc.path); - priv = this->private; - //update parent ctx ret = quota_inode_ctx_get (local->parent_loc.inode, this, &ctx); if (ret == -1) { @@ -1781,7 +1746,6 @@ quota_markdirty (call_frame_t *frame, void *cookie, int32_t ret = -1; dict_t *dict = NULL; quota_local_t *local = NULL; - marker_conf_t *priv = NULL; local = frame->local; @@ -1802,8 +1766,6 @@ quota_markdirty (call_frame_t *frame, void *cookie, gf_log (this->name, GF_LOG_TRACE, "inodelk succeeded on %s", local->parent_loc.path); - priv = this->private; - dict = dict_new (); if (!dict) { ret = -1; @@ -1989,13 +1951,10 @@ inspect_directory_xattr (xlator_t *this, int64_t *size = NULL, size_int = 0; int64_t *contri = NULL, contri_int = 0; char contri_key [512] = {0, }; - marker_conf_t *priv = NULL; gf_boolean_t not_root = _gf_false; quota_inode_ctx_t *ctx = NULL; inode_contribution_t *contribution = NULL; - priv = this->private; - ret = quota_inode_ctx_get (loc->inode, this, &ctx); if (ret < 0) { ctx = quota_inode_ctx_new (loc->inode, this); @@ -2079,12 +2038,9 @@ inspect_file_xattr (xlator_t *this, uint64_t contri_int = 0, size = 0; int64_t *contri_ptr = NULL; char contri_key [512] = {0, }; - marker_conf_t *priv = NULL; quota_inode_ctx_t *ctx = NULL; inode_contribution_t *contribution = NULL; - priv = this->private; - ret = quota_inode_ctx_get (loc->inode, this, &ctx); if (ret < 0) { ctx = quota_inode_ctx_new (loc->inode, this); @@ -2159,14 +2115,11 @@ quota_req_xattr (xlator_t *this, dict_t *dict) { int32_t ret = -1; - marker_conf_t *priv = NULL; GF_VALIDATE_OR_GOTO ("marker", this, out); GF_VALIDATE_OR_GOTO ("marker", loc, out); GF_VALIDATE_OR_GOTO ("marker", dict, out); - priv = this->private; - //if not "/" then request contribution if (strcmp (loc->path, "/") == 0) goto set_size; @@ -2305,9 +2258,7 @@ mq_reduce_parent_size_xattr (call_frame_t *frame, void *cookie, int32_t ret = -1; int64_t *size = NULL; dict_t *dict = NULL; - marker_conf_t *priv = NULL; quota_local_t *local = NULL; - inode_contribution_t *contribution = NULL; local = frame->local; if (op_ret == -1) { @@ -2319,10 +2270,6 @@ mq_reduce_parent_size_xattr (call_frame_t *frame, void *cookie, VALIDATE_OR_GOTO (local->contri, err); - priv = this->private; - - contribution = local->contri; - dict = dict_new (); if (dict == NULL) { ret = -1; @@ -2358,7 +2305,6 @@ reduce_parent_size (xlator_t *this, loc_t *loc, int64_t contri) int32_t ret = -1; struct gf_flock lock = {0,}; call_frame_t *frame = NULL; - marker_conf_t *priv = NULL; quota_local_t *local = NULL; quota_inode_ctx_t *ctx = NULL; inode_contribution_t *contribution = NULL; @@ -2366,8 +2312,6 @@ reduce_parent_size (xlator_t *this, loc_t *loc, int64_t contri) GF_VALIDATE_OR_GOTO ("marker", this, out); GF_VALIDATE_OR_GOTO ("marker", loc, out); - priv = this->private; - ret = quota_inode_ctx_get (loc->inode, this, &ctx); if (ret < 0) goto out; diff --git a/xlators/features/quiesce/src/quiesce.c b/xlators/features/quiesce/src/quiesce.c index 7fd16ceb961..84df12a31ff 100644 --- a/xlators/features/quiesce/src/quiesce.c +++ b/xlators/features/quiesce/src/quiesce.c @@ -34,13 +34,9 @@ void gf_quiesce_local_wipe (xlator_t *this, quiesce_local_t *local) { - quiesce_priv_t *priv = NULL; - if (!local || !this || !this->private) return; - priv = this->private; - if (local->loc.inode) loc_wipe (&local->loc); if (local->fd) @@ -108,7 +104,6 @@ gf_quiesce_timeout (void *data) { xlator_t *this = NULL; quiesce_priv_t *priv = NULL; - int need_dequeue = 0; this = data; priv = this->private; @@ -117,7 +112,6 @@ gf_quiesce_timeout (void *data) LOCK (&priv->lock); { priv->pass_through = _gf_true; - need_dequeue = (priv->queue_size)? 1:0; } UNLOCK (&priv->lock); @@ -168,12 +162,9 @@ quiesce_lookup_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, int32_t op_errno, inode_t *inode, struct iatt *buf, dict_t *dict, struct iatt *postparent) { - quiesce_priv_t *priv = NULL; call_stub_t *stub = NULL; quiesce_local_t *local = NULL; - priv = this->private; - local = frame->local; frame->local = NULL; if ((op_ret == -1) && (op_errno == ENOTCONN)) { @@ -202,12 +193,9 @@ int32_t quiesce_stat_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, int32_t op_errno, struct iatt *buf) { - quiesce_priv_t *priv = NULL; call_stub_t *stub = NULL; quiesce_local_t *local = NULL; - priv = this->private; - local = frame->local; frame->local = NULL; if ((op_ret == -1) && (op_errno == ENOTCONN)) { @@ -235,12 +223,9 @@ int32_t quiesce_access_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, int32_t op_errno) { - quiesce_priv_t *priv = NULL; call_stub_t *stub = NULL; quiesce_local_t *local = NULL; - priv = this->private; - local = frame->local; frame->local = NULL; if ((op_ret == -1) && (op_errno == ENOTCONN)) { @@ -268,12 +253,9 @@ quiesce_readlink_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, int32_t op_errno, const char *path, struct iatt *buf) { - quiesce_priv_t *priv = NULL; call_stub_t *stub = NULL; quiesce_local_t *local = NULL; - priv = this->private; - local = frame->local; frame->local = NULL; if ((op_ret == -1) && (op_errno == ENOTCONN)) { @@ -301,12 +283,9 @@ int32_t quiesce_open_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, int32_t op_errno, fd_t *fd) { - quiesce_priv_t *priv = NULL; call_stub_t *stub = NULL; quiesce_local_t *local = NULL; - priv = this->private; - local = frame->local; frame->local = NULL; if ((op_ret == -1) && (op_errno == ENOTCONN)) { @@ -336,12 +315,9 @@ quiesce_readv_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, int32_t op_errno, struct iovec *vector, int32_t count, struct iatt *stbuf, struct iobref *iobref) { - quiesce_priv_t *priv = NULL; call_stub_t *stub = NULL; quiesce_local_t *local = NULL; - priv = this->private; - local = frame->local; frame->local = NULL; if ((op_ret == -1) && (op_errno == ENOTCONN)) { @@ -370,12 +346,9 @@ int32_t quiesce_flush_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, int32_t op_errno) { - quiesce_priv_t *priv = NULL; call_stub_t *stub = NULL; quiesce_local_t *local = NULL; - priv = this->private; - local = frame->local; frame->local = NULL; if ((op_ret == -1) && (op_errno == ENOTCONN)) { @@ -405,12 +378,9 @@ quiesce_fsync_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf) { - quiesce_priv_t *priv = NULL; call_stub_t *stub = NULL; quiesce_local_t *local = NULL; - priv = this->private; - local = frame->local; frame->local = NULL; if ((op_ret == -1) && (op_errno == ENOTCONN)) { @@ -438,12 +408,9 @@ int32_t quiesce_fstat_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, int32_t op_errno, struct iatt *buf) { - quiesce_priv_t *priv = NULL; call_stub_t *stub = NULL; quiesce_local_t *local = NULL; - priv = this->private; - local = frame->local; frame->local = NULL; if ((op_ret == -1) && (op_errno == ENOTCONN)) { @@ -471,12 +438,9 @@ int32_t quiesce_opendir_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, int32_t op_errno, fd_t *fd) { - quiesce_priv_t *priv = NULL; call_stub_t *stub = NULL; quiesce_local_t *local = NULL; - priv = this->private; - local = frame->local; frame->local = NULL; if ((op_ret == -1) && (op_errno == ENOTCONN)) { @@ -504,12 +468,9 @@ int32_t quiesce_fsyncdir_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, int32_t op_errno) { - quiesce_priv_t *priv = NULL; call_stub_t *stub = NULL; quiesce_local_t *local = NULL; - priv = this->private; - local = frame->local; frame->local = NULL; if ((op_ret == -1) && (op_errno == ENOTCONN)) { @@ -536,12 +497,9 @@ int32_t quiesce_statfs_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, int32_t op_errno, struct statvfs *buf) { - quiesce_priv_t *priv = NULL; call_stub_t *stub = NULL; quiesce_local_t *local = NULL; - priv = this->private; - local = frame->local; frame->local = NULL; if ((op_ret == -1) && (op_errno == ENOTCONN)) { @@ -569,12 +527,9 @@ int32_t quiesce_fgetxattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, int32_t op_errno, dict_t *dict) { - quiesce_priv_t *priv = NULL; call_stub_t *stub = NULL; quiesce_local_t *local = NULL; - priv = this->private; - local = frame->local; frame->local = NULL; if ((op_ret == -1) && (op_errno == ENOTCONN)) { @@ -603,12 +558,9 @@ int32_t quiesce_getxattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, int32_t op_errno, dict_t *dict) { - quiesce_priv_t *priv = NULL; call_stub_t *stub = NULL; quiesce_local_t *local = NULL; - priv = this->private; - local = frame->local; frame->local = NULL; if ((op_ret == -1) && (op_errno == ENOTCONN)) { @@ -638,12 +590,9 @@ quiesce_rchecksum_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, int32_t op_errno, uint32_t weak_checksum, uint8_t *strong_checksum) { - quiesce_priv_t *priv = NULL; call_stub_t *stub = NULL; quiesce_local_t *local = NULL; - priv = this->private; - local = frame->local; frame->local = NULL; if ((op_ret == -1) && (op_errno == ENOTCONN)) { @@ -673,12 +622,9 @@ int32_t quiesce_readdir_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, int32_t op_errno, gf_dirent_t *entries) { - quiesce_priv_t *priv = NULL; call_stub_t *stub = NULL; quiesce_local_t *local = NULL; - priv = this->private; - local = frame->local; frame->local = NULL; if ((op_ret == -1) && (op_errno == ENOTCONN)) { @@ -707,12 +653,9 @@ int32_t quiesce_readdirp_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, int32_t op_errno, gf_dirent_t *entries) { - quiesce_priv_t *priv = NULL; call_stub_t *stub = NULL; quiesce_local_t *local = NULL; - priv = this->private; - local = frame->local; frame->local = NULL; if ((op_ret == -1) && (op_errno == ENOTCONN)) { diff --git a/xlators/features/quota/src/quota.c b/xlators/features/quota/src/quota.c index 392717c55ce..28107033e37 100644 --- a/xlators/features/quota/src/quota.c +++ b/xlators/features/quota/src/quota.c @@ -201,7 +201,6 @@ quota_validate_cbk (call_frame_t *frame, void *cookie, xlator_t *this, uint32_t validate_count = 0, link_count = 0; int32_t ret = 0; quota_inode_ctx_t *ctx = NULL; - quota_priv_t *priv = NULL; int64_t *size = 0; uint64_t value = 0; call_stub_t *stub = NULL; @@ -213,9 +212,6 @@ quota_validate_cbk (call_frame_t *frame, void *cookie, xlator_t *this, } GF_ASSERT (local); - - priv = this->private; - GF_ASSERT (frame); GF_VALIDATE_OR_GOTO_WITH_ERROR ("quota", this, unwind, op_errno, EINVAL); @@ -511,14 +507,11 @@ __quota_init_inode_ctx (inode_t *inode, int64_t limit, xlator_t *this, int32_t ret = -1; int64_t *size = 0; quota_inode_ctx_t *ctx = NULL; - quota_priv_t *priv = NULL; if (inode == NULL) { goto out; } - priv = this->private; - QUOTA_ALLOC_OR_GOTO (ctx, quota_inode_ctx_t, out); ctx->limit = limit; @@ -587,7 +580,6 @@ quota_lookup_cbk (call_frame_t *frame, void *cookie, xlator_t *this, quota_local_t *local = NULL; quota_inode_ctx_t *ctx = NULL; quota_dentry_t *dentry = NULL; - quota_priv_t *priv = NULL; int64_t *size = 0; uint64_t value = 0; @@ -603,8 +595,6 @@ quota_lookup_cbk (call_frame_t *frame, void *cookie, xlator_t *this, goto unwind; } - priv = this->private; - ret = quota_inode_ctx_get (local->loc.inode, local->limit, this, dict, buf, &ctx, 1); if ((ret == -1) || (ctx == NULL)) { -- cgit