summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBryn M. Reeves <bmr@redhat.com>2015-08-07 13:09:56 +0100
committerBryn M. Reeves <bmr@redhat.com>2015-08-12 15:09:57 +0100
commit99f55abc56bf1ce6b6f0e7d9cae67e347ace16b2 (patch)
tree5004ae8c575a94c345af5647503caa3b3d290a37
parentc2d814e78d17320a557c1c0fe40440cda896ea2d (diff)
downloadlvm2-99f55abc56bf1ce6b6f0e7d9cae67e347ace16b2.tar.gz
libdm: add dm_timestamp_copy()
-rw-r--r--libdm/.exported_symbols.DM_1_02_1041
-rw-r--r--libdm/libdevmapper.h5
-rw-r--r--libdm/libdm-timestamp.c5
3 files changed, 11 insertions, 0 deletions
diff --git a/libdm/.exported_symbols.DM_1_02_104 b/libdm/.exported_symbols.DM_1_02_104
index 712fcf2d5..411ab2a96 100644
--- a/libdm/.exported_symbols.DM_1_02_104
+++ b/libdm/.exported_symbols.DM_1_02_104
@@ -72,6 +72,7 @@ dm_task_get_ioctl_timestamp
dm_task_set_record_timestamp
dm_timestamp_alloc
dm_timestamp_compare
+dm_timestamp_copy
dm_timestamp_delta
dm_timestamp_destroy
dm_timestamp_get
diff --git a/libdm/libdevmapper.h b/libdm/libdevmapper.h
index 18df90a33..192fd0f87 100644
--- a/libdm/libdevmapper.h
+++ b/libdm/libdevmapper.h
@@ -2183,6 +2183,11 @@ struct dm_timestamp *dm_timestamp_alloc(void);
int dm_timestamp_get(struct dm_timestamp *ts);
/*
+ * Copy a timestamp from ts_old to ts_new.
+ */
+void dm_timestamp_copy(struct dm_timestamp *ts_new, struct dm_timestamp *ts_old);
+
+/*
* Compare two timestamps.
*
* Return: -1 if ts1 is less than ts2
diff --git a/libdm/libdm-timestamp.c b/libdm/libdm-timestamp.c
index fe006d58f..3e01442ef 100644
--- a/libdm/libdm-timestamp.c
+++ b/libdm/libdm-timestamp.c
@@ -168,6 +168,11 @@ uint64_t dm_timestamp_delta(struct dm_timestamp *ts1, struct dm_timestamp *ts2)
return t2 - t1;
}
+void dm_timestamp_copy(struct dm_timestamp *ts_new, struct dm_timestamp *ts_old)
+{
+ *ts_new = *ts_old;
+}
+
void dm_timestamp_destroy(struct dm_timestamp *ts)
{
dm_free(ts);