From ee20190a3a6e36b97c4914e0fa486017e72b0375 Mon Sep 17 00:00:00 2001 From: Shreyas Siravara Date: Tue, 5 Dec 2017 06:51:24 -0800 Subject: cluster/dht: Fix build error due to switch statement on a boolean Change-Id: Idf672b435e389baada732f609398404479306909 BUG: 1520974 --- xlators/cluster/dht/src/dht-common.c | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) (limited to 'xlators/cluster/dht') diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c index f5411f406d9..9d0e30ae461 100644 --- a/xlators/cluster/dht/src/dht-common.c +++ b/xlators/cluster/dht/src/dht-common.c @@ -6040,28 +6040,17 @@ dht_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; - - case _gf_false: + } + } else { 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) { -- cgit