summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/mgmt/glusterd')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-snapshot.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-snapshot.c b/xlators/mgmt/glusterd/src/glusterd-snapshot.c
index c9c23bf1d..17c31d862 100644
--- a/xlators/mgmt/glusterd/src/glusterd-snapshot.c
+++ b/xlators/mgmt/glusterd/src/glusterd-snapshot.c
@@ -1386,8 +1386,6 @@ glusterd_snapshot_get_snapvol_detail (dict_t *dict,
goto out;
}
- if (!detail)
- goto out;
ret = glusterd_volinfo_find (snap_vol->parent_volname, &origin_vol);
if (ret) {
@@ -1422,6 +1420,16 @@ glusterd_snapshot_get_snapvol_detail (dict_t *dict,
goto out;
}
+ snprintf (key, sizeof (key), "%s.snapcount", keyprefix);
+ ret = dict_set_int32 (dict, key, origin_vol->snap_count);
+ if (ret) {
+ gf_log (this->name, GF_LOG_ERROR, "Could not save snapcount");
+ goto out;
+ }
+
+ if (!detail)
+ goto out;
+
/* Parent volume name */
value = gf_strdup (snap_vol->parent_volname);
if (!value)