summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-utils.c
diff options
context:
space:
mode:
authorVijaikumar M <vmallika@redhat.com>2014-03-21 11:43:10 +0530
committerRajesh Joseph <rjoseph@redhat.com>2014-03-25 02:43:37 -0700
commitcb9bb522972b6cff45c0b6646100151e30e6424c (patch)
treea06e771ace5e43378552e557c7c1410d18366115 /xlators/mgmt/glusterd/src/glusterd-utils.c
parent36ed5cfb45a63196b8350e32c1a0b81aedb3f51f (diff)
glusterd/snapshot: populate the snapshot volume list in the order when the glusterd is restarted
We are storing the snapshot objects in the order. We need to do the same for snapshot volumes Change-Id: Iea9594632e52d069f167cc8a840c78d0f7109947 Signed-off-by: Vijaikumar M <vmallika@redhat.com> Reviewed-on: http://review.gluster.org/7307 Reviewed-by: Sachin Pandit <spandit@redhat.com> Reviewed-by: Rajesh Joseph <rjoseph@redhat.com> Tested-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.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
index cd2fb806d..a398058d5 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
@@ -8613,3 +8613,21 @@ glusterd_compare_snap_time(struct list_head *list1, struct list_head *list2)
return ((int)diff_time);
}
+
+int
+glusterd_compare_snap_vol_time(struct list_head *list1, struct list_head *list2)
+{
+ glusterd_volinfo_t *snapvol1 = NULL;
+ glusterd_volinfo_t *snapvol2 = NULL;
+ double diff_time = 0;
+
+ GF_ASSERT (list1);
+ GF_ASSERT (list2);
+
+ snapvol1 = list_entry(list1, glusterd_volinfo_t, snapvol_list);
+ snapvol2 = list_entry(list2, glusterd_volinfo_t, snapvol_list);
+ diff_time = difftime(snapvol1->snapshot->time_stamp,
+ snapvol2->snapshot->time_stamp);
+
+ return ((int)diff_time);
+}