diff options
| author | ShyamsundarR <srangana@redhat.com> | 2017-12-06 11:32:00 -0500 | 
|---|---|---|
| committer | Jeff Darcy <jeff@pl.atyp.us> | 2017-12-06 23:43:31 +0000 | 
| commit | c502ca166473f4f0e027f3475924d8dc4e486bd3 (patch) | |
| tree | 7abd0721535fd1ce9732f7382e78522cb6f6f10f | |
| parent | 820a91a219bbeb65f84d963db3fd79e261f194ad (diff) | |
dht/crypt/tier: Fix use of booleans as integers
BUG: 1520974
Change-Id: I19ea40c888e88a7a4ac271168ed1820c2075be93
Signed-off-by: ShyamsundarR <srangana@redhat.com>
| -rw-r--r-- | xlators/cluster/dht/src/dht-common.h | 2 | ||||
| -rw-r--r-- | xlators/cluster/dht/src/tier-common.c | 20 | ||||
| -rw-r--r-- | xlators/encryption/crypt/src/crypt.c | 2 | 
3 files changed, 7 insertions, 17 deletions
diff --git a/xlators/cluster/dht/src/dht-common.h b/xlators/cluster/dht/src/dht-common.h index d396c1d8173..3d6fbb1fd79 100644 --- a/xlators/cluster/dht/src/dht-common.h +++ b/xlators/cluster/dht/src/dht-common.h @@ -88,7 +88,7 @@ struct dht_layout {          int                gen;          int                type;          int                ref; /* use with dht_conf_t->layout_lock */ -        gf_boolean_t       search_unhashed; +        uint32_t           search_unhashed;          struct {                  int        err;   /* 0 = normal                                       -1 = dir exists and no xattr diff --git a/xlators/cluster/dht/src/tier-common.c b/xlators/cluster/dht/src/tier-common.c index 2f30ef67fe4..c6b54d21d8e 100644 --- a/xlators/cluster/dht/src/tier-common.c +++ b/xlators/cluster/dht/src/tier-common.c @@ -1089,28 +1089,18 @@ tier_statfs_cbk (call_frame_t *frame, void *cookie, xlator_t *this,                  }                  local->op_ret = 0; -                switch (local->quota_deem_statfs) { -                case _gf_true: -                        if (event == _gf_true) +                if (local->quota_deem_statfs) { +                        if (event == _gf_true) {                                  action = qdstatfs_action_COMPARE; -                        else +                        } else {                                  action = qdstatfs_action_NEGLECT; -                        break; +                        } +                } else { -                case _gf_false:                          if (event == _gf_true) {                                  action = qdstatfs_action_REPLACE;                                  local->quota_deem_statfs = _gf_true;                          } -                        break; - -                default: -                        gf_msg (this->name, GF_LOG_ERROR, 0, -                                DHT_MSG_INVALID_VALUE, -                                "Encountered third " -                                "value for boolean variable %d", -                                local->quota_deem_statfs); -                        break;                  }                  if (local->quota_deem_statfs) { diff --git a/xlators/encryption/crypt/src/crypt.c b/xlators/encryption/crypt/src/crypt.c index 0dd076bd897..9e5bcf79c30 100644 --- a/xlators/encryption/crypt/src/crypt.c +++ b/xlators/encryption/crypt/src/crypt.c @@ -3682,7 +3682,7 @@ static int32_t __crypt_ftruncate_done(call_frame_t *frame,  	STACK_UNWIND_STRICT(ftruncate,  			    frame, -			    local->op_ret < 0 ? -1 : 0, +			    ((local->op_ret < 0) ? -1 : 0),  			    local->op_errno,  			    &local->prebuf,  			    &local->postbuf,  | 
