diff options
| author | Pranith Kumar K <pranithk@gluster.com> | 2012-09-27 00:49:54 +0530 |
|---|---|---|
| committer | Pranith Kumar K <pkarampu@redhat.com> | 2012-09-27 10:41:19 +0530 |
| commit | 13cfed388a19dd70984197fb14330d0277ba91e7 (patch) | |
| tree | 8e86f3cc4f441b3804741ee9dc6dbb9288269b12 /xlators/cluster/dht/src/switch.c | |
| parent | c8f9437b6ef507a4dc7fe03aa32a9fbf220d09f6 (diff) | |
mgmt/glusterd: Implementation of server-side quorum.
Feature-page:
http://www.gluster.org/community/documentation/index.php/Features/Server-quorum
Change-Id: Ifec0f1a697d390a29ba447a09750602fea1b3a4b
BUG: 840122
Signed-off-by: Pranith Kumar K <pranithk@gluster.com>
Diffstat (limited to 'xlators/cluster/dht/src/switch.c')
| -rw-r--r-- | xlators/cluster/dht/src/switch.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/xlators/cluster/dht/src/switch.c b/xlators/cluster/dht/src/switch.c index fe75914f247..bc1f5f1f499 100644 --- a/xlators/cluster/dht/src/switch.c +++ b/xlators/cluster/dht/src/switch.c @@ -832,7 +832,8 @@ init (xlator_t *this) char *temp_str = NULL; int ret = -1; int i = 0; - uint32_t temp_free_disk = 0; + double temp_free_disk = 0; + uint64_t size = 0; if (!this->children) { gf_log (this->name, GF_LOG_CRITICAL, @@ -865,24 +866,23 @@ init (xlator_t *this) gf_string2boolean (temp_str, &conf->unhashed_sticky_bit); } - conf->min_free_disk = 10; + conf->min_free_disk = 10.0; conf->disk_unit = 'p'; if (dict_get_str (this->options, "min-free-disk", &temp_str) == 0) { - if (gf_string2percent (temp_str, - &temp_free_disk) == 0) { + if (gf_string2percent (temp_str, &temp_free_disk) == 0) { if (temp_free_disk > 100) { - gf_string2bytesize (temp_str, - &conf->min_free_disk); + gf_string2bytesize (temp_str, &size); + conf->min_free_disk = size; conf->disk_unit = 'b'; } else { - conf->min_free_disk = (uint64_t)temp_free_disk; + conf->min_free_disk = temp_free_disk; conf->disk_unit = 'p'; } } else { - gf_string2bytesize (temp_str, - &conf->min_free_disk); + gf_string2bytesize (temp_str, &size); + conf->min_free_disk = size; conf->disk_unit = 'b'; } } |
