diff options
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-utils.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-utils.c | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c index 7c68947b8..6947facbd 100644 --- a/xlators/mgmt/glusterd/src/glusterd-utils.c +++ b/xlators/mgmt/glusterd/src/glusterd-utils.c @@ -463,10 +463,8 @@ glusterd_volinfo_new (glusterd_volinfo_t **volinfo) snprintf (new_volinfo->parent_volname, GLUSTERD_MAX_VOLUME_NAME, "N/A"); - if (conf) - new_volinfo->snap_max_limit = conf->snap_max_limit; - else - new_volinfo->snap_max_limit = GLUSTERD_SNAPS_MAX_LIMIT; + new_volinfo->snap_max_hard_limit = GLUSTERD_SNAPS_MAX_LIMIT; + new_volinfo->snap_max_soft_limit = GLUSTERD_SNAPS_MAX_LIMIT; new_volinfo->xl = THIS; @@ -7857,9 +7855,9 @@ out: int glusterd_snap_config_use_rsp_dict (dict_t *dst, dict_t *src) { - int ret = -1; - uint64_t limit = 0; - int config_command = 0; + int ret = -1; + uint64_t value = 0; + int config_command = 0; if (!dst || !src) { gf_log ("", GF_LOG_ERROR, "Source or Destination " @@ -7876,16 +7874,22 @@ glusterd_snap_config_use_rsp_dict (dict_t *dst, dict_t *src) switch (config_command) { case GF_SNAP_CONFIG_DISPLAY: - ret = dict_get_uint64 (src, "limit", &limit); - if (ret) { - gf_log ("", GF_LOG_ERROR, "Unable to fetch limit"); - goto out; + ret = dict_get_uint64 (src, "snap-max-hard-limit", &value); + if (!ret) { + ret = dict_set_uint64 (dst, "snap-max-hard-limit", value); + if (ret) { + gf_log ("", GF_LOG_ERROR, "Unable to set snap_max_hard_limit"); + goto out; + } } - ret = dict_set_uint64 (dst, "limit", limit); - if (ret) { - gf_log ("", GF_LOG_ERROR, "Unable to set limit"); - goto out; + ret = dict_get_uint64 (src, "snap-max-soft-limit", &value); + if (!ret) { + ret = dict_set_uint64 (dst, "snap-max-soft-limit", value); + if (ret) { + gf_log ("", GF_LOG_ERROR, "Unable to set snap_max_soft_limit"); + goto out; + } } break; |