summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/dht/src/nufa.c
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/cluster/dht/src/nufa.c')
-rw-r--r--xlators/cluster/dht/src/nufa.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/xlators/cluster/dht/src/nufa.c b/xlators/cluster/dht/src/nufa.c
index 53c66aa45aa..a2a97ab3c76 100644
--- a/xlators/cluster/dht/src/nufa.c
+++ b/xlators/cluster/dht/src/nufa.c
@@ -502,7 +502,8 @@ init (xlator_t *this)
int ret = -1;
int i = 0;
char my_hostname[256];
- 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,
@@ -587,16 +588,16 @@ init (xlator_t *this)
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';
}
}