diff options
Diffstat (limited to 'xlators/cluster/dht/src/dht.c')
-rw-r--r-- | xlators/cluster/dht/src/dht.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/xlators/cluster/dht/src/dht.c b/xlators/cluster/dht/src/dht.c index 14f3eb1d1ac..777086ab4bc 100644 --- a/xlators/cluster/dht/src/dht.c +++ b/xlators/cluster/dht/src/dht.c @@ -489,6 +489,7 @@ init (xlator_t *this) if (!conf) { goto err; } + memset (conf, 0, sizeof(*conf)); ret = dict_get_int32 (this->options, "rebalance-cmd", &cmd); @@ -602,6 +603,13 @@ init (xlator_t *this) goto err; } + GF_OPTION_INIT ("xattr-name", conf->xattr_name, str, err); + gf_asprintf (&conf->link_xattr_name, "%s.linkto", conf->xattr_name); + gf_asprintf (&conf->wild_xattr_name, "%s*", conf->xattr_name); + if (!conf->link_xattr_name || !conf->wild_xattr_name) { + goto err; + } + this->private = conf; return 0; @@ -623,6 +631,10 @@ err: GF_FREE (conf->defrag); + GF_FREE (conf->xattr_name); + GF_FREE (conf->link_xattr_name); + GF_FREE (conf->wild_xattr_name); + GF_FREE (conf); } @@ -781,6 +793,13 @@ struct volume_options options[] = { { .key = {"rebalance-filter"}, .type = GF_OPTION_TYPE_STR, }, + { .key = {"xattr-name"}, + .type = GF_OPTION_TYPE_STR, + .default_value = "trusted.glusterfs.dht", + .description = "Base for extended attributes used by this " + "translator instance, to avoid conflicts with others above or " + "below it." + }, { .key = {NULL} }, }; |