diff options
author | Avra Sengupta <asengupt@redhat.com> | 2013-12-16 03:09:58 +0000 |
---|---|---|
committer | Rajesh Joseph <rjoseph@redhat.com> | 2014-01-06 15:59:43 +0530 |
commit | 5d57885a1b63ba89406c0dbd02bb254eacf531bd (patch) | |
tree | 81675d15f4d450ac80c2b67cf1e4b2e68a5405b2 /xlators/mgmt/glusterd/src/glusterd-utils.c | |
parent | 31ed53e48a2066ba344c257856384ad105803281 (diff) |
glusterd/snapshot: Introducing snap-max-hard-limit and snap-max-soft-limit
Note: Manually adding this patch again as this patch got missed in
git reset option done on remote development branch
Change-Id: I9e81c5ec003c1e1722d0fcb27dd87c365ee43ff4
Signed-off-by: Avra Sengupta <asengupt@redhat.com>
Signed-off-by: Rajesh Joseph <rjoseph@redhat.com>
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; |