From b565cf8bfc75e6f6c85a47bc8a06737cd6e79fae Mon Sep 17 00:00:00 2001 From: shishir gowda Date: Fri, 15 Apr 2011 02:49:51 +0000 Subject: DHT: Make assert-no-child-down a boolean option Signed-off-by: shishir gowda Signed-off-by: Anand Avati BUG: 2765 (geo-replication should have mercy on brick failure) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2765 --- xlators/cluster/dht/src/dht.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'xlators/cluster') diff --git a/xlators/cluster/dht/src/dht.c b/xlators/cluster/dht/src/dht.c index ad83d8d4f03..57c3072cd2a 100644 --- a/xlators/cluster/dht/src/dht.c +++ b/xlators/cluster/dht/src/dht.c @@ -421,16 +421,17 @@ init (xlator_t *this) conf->assert_no_child_down = 0; - if (!dict_get_str (this->options, "assert-no-child-down", &temp_str)) { - if (!strncmp (temp_str, "on", strlen (temp_str))) { - conf->assert_no_child_down = 1; - gf_log (this->name, GF_LOG_INFO, - "assert-no-child-down set to on"); - } else { - conf->assert_no_child_down = 0; - gf_log (this->name, GF_LOG_INFO, - "assert-no-child-down set to off"); + ret = dict_get_str_boolean (this->options, "assert-no-child-down", 0); + if (ret != -1) { + if (conf->assert_no_child_down != ret) { + gf_log (this->name, GF_LOG_DEBUG, + "Changing assert-no-child-down from %d to %d", + conf->assert_no_child_down, ret); } + conf->assert_no_child_down = ret; + } else { + gf_log (this->name, GF_LOG_ERROR, + "'assert-no-child-down' takes only boolean arguments"); } ret = dht_init_subvolumes (this, conf); @@ -557,8 +558,7 @@ struct volume_options options[] = { .type = GF_OPTION_TYPE_BOOL }, { .key = {"assert-no-child-down"}, - .value = {"on", "off"}, - .type = GF_OPTION_TYPE_STR + .type = GF_OPTION_TYPE_BOOL }, { .key = {NULL} }, }; -- cgit