datastore: gc: avoid unsafe call into libc, use epoch_i64 helper

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2020-10-01 12:38:38 +02:00
parent c6772c92b8
commit 823867f5b7

View File

@ -483,7 +483,7 @@ impl DataStore {
// writer" information and thus no safe atime cutoff
let _exclusive_lock = self.chunk_store.try_exclusive_lock()?;
let phase1_start_time = unsafe { libc::time(std::ptr::null_mut()) };
let phase1_start_time = proxmox::tools::time::epoch_i64();
let oldest_writer = self.chunk_store.oldest_writer().unwrap_or(phase1_start_time);
let mut gc_status = GarbageCollectionStatus::default();