diff options
Diffstat (limited to 'xlators')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-op-sm.c | 9 | ||||
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-utils.c | 4 | ||||
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-volgen.c | 17 | ||||
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-volume-ops.c | 3 |
4 files changed, 14 insertions, 19 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c index acd851663..52c6c5e14 100644 --- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c +++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c @@ -1154,8 +1154,9 @@ glusterd_options_reset (glusterd_volinfo_t *volinfo, char *key, _delete_reconfig_opt (volinfo->dict, key, value, is_force); } - ret = glusterd_create_volfiles_and_notify_services (volinfo); + gd_update_volume_op_versions (volinfo); + ret = glusterd_create_volfiles_and_notify_services (volinfo); if (ret) { gf_log ("", GF_LOG_ERROR, "Unable to create volfile for" " 'volume set'"); @@ -1328,8 +1329,6 @@ glusterd_op_reset_volume (dict_t *dict, char **op_errstr) key); } - gd_update_volume_op_versions (volinfo); - out: GF_FREE (key_fixed); if (quorum_action) @@ -1633,6 +1632,7 @@ glusterd_op_set_volume (dict_t *dict) } if (!global_opt) { + gd_update_volume_op_versions (volinfo); ret = glusterd_create_volfiles_and_notify_services (volinfo); if (ret) { gf_log (this->name, GF_LOG_ERROR, @@ -1654,11 +1654,11 @@ glusterd_op_set_volume (dict_t *dict) goto out; } } - gd_update_volume_op_versions (volinfo); } else { list_for_each_entry (voliter, &priv->volumes, vol_list) { volinfo = voliter; + gd_update_volume_op_versions (volinfo); ret = glusterd_create_volfiles_and_notify_services (volinfo); if (ret) { gf_log (this->name, GF_LOG_ERROR, @@ -1681,7 +1681,6 @@ glusterd_op_set_volume (dict_t *dict) goto out; } } - gd_update_volume_op_versions (volinfo); } } diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c index 4c8c98900..27c9bdca2 100644 --- a/xlators/mgmt/glusterd/src/glusterd-utils.c +++ b/xlators/mgmt/glusterd/src/glusterd-utils.c @@ -3059,13 +3059,13 @@ glusterd_import_friend_volume (dict_t *vols, size_t count) (void) glusterd_start_bricks (new_volinfo); } + gd_update_volume_op_versions (new_volinfo); + ret = glusterd_store_volinfo (new_volinfo, GLUSTERD_VOLINFO_VER_AC_NONE); ret = glusterd_create_volfiles_and_notify_services (new_volinfo); if (ret) goto out; - gd_update_volume_op_versions (new_volinfo); - list_add_tail (&new_volinfo->vol_list, &priv->volumes); out: gf_log ("", GF_LOG_DEBUG, "Returning with ret: %d", ret); diff --git a/xlators/mgmt/glusterd/src/glusterd-volgen.c b/xlators/mgmt/glusterd/src/glusterd-volgen.c index c6a78ea15..49f037016 100644 --- a/xlators/mgmt/glusterd/src/glusterd-volgen.c +++ b/xlators/mgmt/glusterd/src/glusterd-volgen.c @@ -1675,16 +1675,11 @@ static int perfxl_option_handler (volgen_graph_t *graph, struct volopt_map_entry *vme, void *param) { - char *volname = NULL; gf_boolean_t enabled = _gf_false; - xlator_t *this = NULL; - glusterd_conf_t *conf = NULL; - - this = THIS; - GF_ASSERT (this); - conf = this->private; + glusterd_volinfo_t *volinfo = NULL; - volname = param; + GF_ASSERT (param); + volinfo = param; if (strcmp (vme->option, "!perf") != 0) return 0; @@ -1697,10 +1692,10 @@ perfxl_option_handler (volgen_graph_t *graph, struct volopt_map_entry *vme, /* Check op-version before adding the 'open-behind' xlator in the graph */ if (!strcmp (vme->key, "performance.open-behind") && - (vme->op_version > conf->op_version)) + (vme->op_version > volinfo->client_op_version)) return 0; - if (volgen_graph_add (graph, vme->voltype, volname)) + if (volgen_graph_add (graph, vme->voltype, volinfo->volname)) return 0; else return -1; @@ -2445,7 +2440,7 @@ client_graph_builder (volgen_graph_t *graph, glusterd_volinfo_t *volinfo, default for a volume */ tmp_data = dict_get (set_dict, "nfs-volume-file"); if (!tmp_data) - ret = volgen_graph_set_options_generic (graph, set_dict, volname, + ret = volgen_graph_set_options_generic (graph, set_dict, volinfo, &perfxl_option_handler); else ret = volgen_graph_set_options_generic (graph, set_dict, volname, diff --git a/xlators/mgmt/glusterd/src/glusterd-volume-ops.c b/xlators/mgmt/glusterd/src/glusterd-volume-ops.c index 5b93410b5..1cbe0c8ac 100644 --- a/xlators/mgmt/glusterd/src/glusterd-volume-ops.c +++ b/xlators/mgmt/glusterd/src/glusterd-volume-ops.c @@ -1634,6 +1634,8 @@ glusterd_op_create_volume (dict_t *dict, char **op_errstr) i++; } + gd_update_volume_op_versions (volinfo); + ret = glusterd_store_volinfo (volinfo, GLUSTERD_VOLINFO_VER_AC_INCREMENT); if (ret) { glusterd_store_delete_volume (volinfo); @@ -1651,7 +1653,6 @@ glusterd_op_create_volume (dict_t *dict, char **op_errstr) list_add_tail (&volinfo->vol_list, &priv->volumes); vol_added = _gf_true; - gd_update_volume_op_versions (volinfo); out: GF_FREE(free_ptr); if (!vol_added && volinfo) |