From 5810846409de15dc5da86ac2e9d47f88cc738495 Mon Sep 17 00:00:00 2001 From: Ming-Hung Tsai Date: Fri, 29 May 2020 14:48:10 +0800 Subject: [PATCH] [thin] Add more constructors to device_details --- thin-provisioning/device_tree.cc | 7 +++++++ thin-provisioning/device_tree.h | 1 + 2 files changed, 8 insertions(+) diff --git a/thin-provisioning/device_tree.cc b/thin-provisioning/device_tree.cc index 4837cb7..4b4e0dd 100644 --- a/thin-provisioning/device_tree.cc +++ b/thin-provisioning/device_tree.cc @@ -54,6 +54,13 @@ namespace thin_provisioning { snapshotted_time_(0) { } + device_details::device_details(uint64_t tid, uint32_t time) + : mapped_blocks_(0), + transaction_id_(tid), + creation_time_(time), + snapshotted_time_(time) { + } + void device_details_traits::unpack(device_details_disk const &disk, device_details &value) { diff --git a/thin-provisioning/device_tree.h b/thin-provisioning/device_tree.h index d284ac5..d7178cd 100644 --- a/thin-provisioning/device_tree.h +++ b/thin-provisioning/device_tree.h @@ -17,6 +17,7 @@ namespace thin_provisioning { struct device_details { device_details(); + device_details(uint64_t tid, uint32_t time); uint64_t mapped_blocks_; uint64_t transaction_id_; /* when created */