diff options
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-utils.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-utils.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c index cb9f040c5f7..561bbb4af5b 100644 --- a/xlators/mgmt/glusterd/src/glusterd-utils.c +++ b/xlators/mgmt/glusterd/src/glusterd-utils.c @@ -11940,7 +11940,8 @@ out: int glusterd_get_default_val_for_volopt (dict_t *ctx, gf_boolean_t all_opts, char *input_key, char *orig_key, - dict_t *vol_dict, char **op_errstr) + glusterd_volinfo_t *volinfo, + char **op_errstr) { struct volopt_map_entry *vme = NULL; int ret = -1; @@ -11951,6 +11952,7 @@ glusterd_get_default_val_for_volopt (dict_t *ctx, gf_boolean_t all_opts, char dict_key[50] = {0,}; gf_boolean_t key_found = _gf_false; glusterd_conf_t *priv = NULL; + dict_t *vol_dict = NULL; this = THIS; GF_ASSERT (this); @@ -11958,6 +11960,7 @@ glusterd_get_default_val_for_volopt (dict_t *ctx, gf_boolean_t all_opts, priv = this->private; GF_VALIDATE_OR_GOTO (this->name, priv, out); + vol_dict = volinfo->dict; GF_VALIDATE_OR_GOTO (this->name, vol_dict, out); /* Check whether key is passed for a single option */ @@ -11979,6 +11982,20 @@ glusterd_get_default_val_for_volopt (dict_t *ctx, gf_boolean_t all_opts, if (!def_val) { ret = dict_get_str (vol_dict, vme->key, &def_val); if (!def_val) { + /* For replicate volumes + * performance.client-io-threads will be set to + * off by default until explicitly turned on + */ + if (!strcmp (vme->key, + "performance.client-io-threads")) { + if (volinfo->type == + GF_CLUSTER_TYPE_REPLICATE || + volinfo->type == + GF_CLUSTER_TYPE_STRIPE_REPLICATE) { + def_val = "off"; + goto set_count; + } + } if (vme->value) { def_val = vme->value; } else { @@ -11991,6 +12008,7 @@ glusterd_get_default_val_for_volopt (dict_t *ctx, gf_boolean_t all_opts, } } } +set_count: count++; sprintf (dict_key, "key%d", count); ret = dict_set_str(ctx, dict_key, vme->key); |