diff options
author | Jeff Darcy <jdarcy@redhat.com> | 2011-09-07 20:03:24 -0400 |
---|---|---|
committer | Anand Avati <avati@gluster.com> | 2011-09-07 23:48:01 -0700 |
commit | 694ef54978f382507a5127ce66da7770929ba2c2 (patch) | |
tree | b98ee679c8d5f4b3556c0bf9af44e6b9729c2881 /xlators/cluster/afr/src/afr-lk-common.c | |
parent | 81530d227deb52af38c7df770aef2200b9de539f (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/cluster/afr/src/afr-lk-common.c')
-rw-r--r-- | xlators/cluster/afr/src/afr-lk-common.c | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/xlators/cluster/afr/src/afr-lk-common.c b/xlators/cluster/afr/src/afr-lk-common.c index 2168ee26f..483d7250e 100644 --- a/xlators/cluster/afr/src/afr-lk-common.c +++ b/xlators/cluster/afr/src/afr-lk-common.c @@ -652,11 +652,9 @@ afr_unlock_entrylk_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, int32_t op_errno) { afr_local_t *local = NULL; - afr_internal_lock_t *int_lock = NULL; int32_t child_index = (long)cookie; local = frame->local; - int_lock = &local->internal_lock; afr_trace_entrylk_out (frame, AFR_ENTRYLK_TRANSACTION, AFR_UNLOCK_OP, NULL, op_ret, @@ -732,13 +730,10 @@ afr_lock_cbk (call_frame_t *frame, void *cookie, xlator_t *this, { afr_internal_lock_t *int_lock = NULL; afr_local_t *local = NULL; - afr_private_t *priv = NULL; - int done = 0; int child_index = (long) cookie; local = frame->local; int_lock = &local->internal_lock; - priv = this->private; LOCK (&frame->lock); { @@ -750,7 +745,6 @@ afr_lock_cbk (call_frame_t *frame, void *cookie, xlator_t *this, "please load features/locks xlator on server"); local->op_ret = op_ret; int_lock->lock_op_ret = op_ret; - done = 1; } local->child_up[child_index] = 0; @@ -796,7 +790,6 @@ afr_lock_lower_cbk (call_frame_t *frame, void *cookie, xlator_t *this, afr_local_t *local = NULL; loc_t *lower = NULL; loc_t *higher = NULL; - const char *lower_name = NULL; const char *higher_name = NULL; int child_index = (long) cookie; @@ -838,10 +831,6 @@ afr_lock_lower_cbk (call_frame_t *frame, void *cookie, xlator_t *this, &local->transaction.new_parent_loc, local->transaction.new_basename); - lower_name = (lower == &local->transaction.parent_loc ? - local->transaction.basename : - local->transaction.new_basename); - higher = (lower == &local->transaction.parent_loc ? &local->transaction.new_parent_loc : &local->transaction.parent_loc); @@ -916,11 +905,8 @@ afr_lock_blocking (call_frame_t *frame, xlator_t *this, int child_index) afr_internal_lock_t *int_lock = NULL; afr_local_t *local = NULL; afr_private_t *priv = NULL; - afr_fd_ctx_t *fd_ctx = NULL; loc_t *lower = NULL; - loc_t *higher = NULL; const char *lower_name = NULL; - const char *higher_name = NULL; struct gf_flock flock = {0,}; uint64_t ctx = 0; int ret = 0; @@ -951,8 +937,6 @@ afr_lock_blocking (call_frame_t *frame, xlator_t *this, int child_index) return 0; } - fd_ctx = (afr_fd_ctx_t *)(long) ctx; - /* skip over children that or down or don't have the fd open */ @@ -1042,14 +1026,6 @@ afr_lock_blocking (call_frame_t *frame, xlator_t *this, int child_index) local->transaction.basename : local->transaction.new_basename); - higher = (lower == &local->transaction.parent_loc ? - &local->transaction.new_parent_loc : - &local->transaction.parent_loc); - - higher_name = (higher == &local->transaction.parent_loc ? - local->transaction.basename : - local->transaction.new_basename); - afr_trace_entrylk_in (frame, AFR_ENTRYLK_TRANSACTION, AFR_LOCK_OP, lower_name, child_index); @@ -1137,13 +1113,11 @@ afr_nonblocking_entrylk_cbk (call_frame_t *frame, void *cookie, xlator_t *this, { afr_internal_lock_t *int_lock = NULL; afr_local_t *local = NULL; - afr_private_t *priv = NULL; int call_count = 0; int child_index = (long) cookie; local = frame->local; int_lock = &local->internal_lock; - priv = this->private; afr_trace_entrylk_out (frame, AFR_ENTRYLK_TRANSACTION, AFR_LOCK_OP, NULL, op_ret, @@ -1312,13 +1286,11 @@ afr_nonblocking_inodelk_cbk (call_frame_t *frame, void *cookie, xlator_t *this, { afr_internal_lock_t *int_lock = NULL; afr_local_t *local = NULL; - afr_private_t *priv = NULL; int call_count = 0; int child_index = (long) cookie; local = frame->local; int_lock = &local->internal_lock; - priv = this->private; afr_trace_inodelk_out (frame, AFR_INODELK_NB_TRANSACTION, AFR_LOCK_OP, NULL, op_ret, @@ -1589,7 +1561,6 @@ afr_post_unlock_lower_cbk (call_frame_t *frame, xlator_t *this) afr_local_t *local = NULL; loc_t *lower = NULL; loc_t *higher = NULL; - const char *lower_name = NULL; const char *higher_name = NULL; local = frame->local; @@ -1600,10 +1571,6 @@ afr_post_unlock_lower_cbk (call_frame_t *frame, xlator_t *this) &local->transaction.new_parent_loc, local->transaction.new_basename); - lower_name = (lower == &local->transaction.parent_loc ? - local->transaction.basename : - local->transaction.new_basename); - higher = (lower == &local->transaction.parent_loc ? &local->transaction.new_parent_loc : &local->transaction.parent_loc); @@ -1632,9 +1599,7 @@ afr_rename_unlock (call_frame_t *frame, xlator_t *this) afr_internal_lock_t *int_lock = NULL; afr_local_t *local = NULL; loc_t *lower = NULL; - loc_t *higher = NULL; const char *lower_name = NULL; - const char *higher_name = NULL; local = frame->local; int_lock = &local->internal_lock; @@ -1648,15 +1613,6 @@ afr_rename_unlock (call_frame_t *frame, xlator_t *this) local->transaction.basename : local->transaction.new_basename); - higher = (lower == &local->transaction.parent_loc ? - &local->transaction.new_parent_loc : - &local->transaction.parent_loc); - - higher_name = (higher == &local->transaction.parent_loc ? - local->transaction.basename : - local->transaction.new_basename); - - if (__is_lower_locked (frame, this)) { gf_log (this->name, GF_LOG_DEBUG, "unlocking lower"); |