From 99f55abc56bf1ce6b6f0e7d9cae67e347ace16b2 Mon Sep 17 00:00:00 2001 From: "Bryn M. Reeves" Date: Fri, 7 Aug 2015 13:09:56 +0100 Subject: [PATCH] libdm: add dm_timestamp_copy() --- libdm/.exported_symbols.DM_1_02_104 | 1 + libdm/libdevmapper.h | 5 +++++ libdm/libdm-timestamp.c | 5 +++++ 3 files changed, 11 insertions(+) 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 @@ -2182,6 +2182,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. * 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);