1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

libdm: add dm_timestamp_copy()

This commit is contained in:
Bryn M. Reeves 2015-08-07 13:09:56 +01:00
parent c2d814e78d
commit 99f55abc56
3 changed files with 11 additions and 0 deletions

View File

@ -72,6 +72,7 @@ dm_task_get_ioctl_timestamp
dm_task_set_record_timestamp dm_task_set_record_timestamp
dm_timestamp_alloc dm_timestamp_alloc
dm_timestamp_compare dm_timestamp_compare
dm_timestamp_copy
dm_timestamp_delta dm_timestamp_delta
dm_timestamp_destroy dm_timestamp_destroy
dm_timestamp_get dm_timestamp_get

View File

@ -2182,6 +2182,11 @@ struct dm_timestamp *dm_timestamp_alloc(void);
*/ */
int dm_timestamp_get(struct dm_timestamp *ts); 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. * Compare two timestamps.
* *

View File

@ -168,6 +168,11 @@ uint64_t dm_timestamp_delta(struct dm_timestamp *ts1, struct dm_timestamp *ts2)
return t2 - t1; 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) void dm_timestamp_destroy(struct dm_timestamp *ts)
{ {
dm_free(ts); dm_free(ts);