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.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/xlators/cluster/dht/src/nufa.c b/xlators/cluster/dht/src/nufa.c
index 5fe233dfe6e..96cc5fe3e2e 100644
--- a/xlators/cluster/dht/src/nufa.c
+++ b/xlators/cluster/dht/src/nufa.c
@@ -560,12 +560,11 @@ init (xlator_t *this)
goto err;
}
- conf->search_unhashed = 0;
-
- if (dict_get_str (this->options, "lookup-unhashed",
- &temp_str) == 0) {
- gf_string2boolean (temp_str,
- &conf->search_unhashed);
+ conf->search_unhashed = GF_DHT_LOOKUP_UNHASHED_AUTO;
+ if (dict_get_str (this->options, "lookup-unhashed", &temp_str) == 0) {
+ /* If option is not "auto", other options _should_ be boolean */
+ if (strcasecmp (temp_str, "auto"))
+ gf_string2boolean (temp_str, &conf->search_unhashed);
}
ret = dht_init_subvolumes (this, conf);
@@ -734,12 +733,14 @@ struct xlator_cbks cbks = {
struct volume_options options[] = {
+ { .key = {"lookup-unhashed"},
+ .value = {"auto", "yes", "no", "enable", "disable", "1", "0",
+ "on", "off"},
+ .type = GF_OPTION_TYPE_STR
+ },
{ .key = {"local-volume-name"},
.type = GF_OPTION_TYPE_XLATOR
},
- { .key = {"lookup-unhashed"},
- .type = GF_OPTION_TYPE_BOOL
- },
{ .key = {"min-free-disk"},
.type = GF_OPTION_TYPE_PERCENT_OR_SIZET,
},