mirror of
https://github.com/ceph/ceph
synced 2025-04-01 00:26:47 +00:00
osd: add get_mnow() interface to OSDService, PG, PeeringState
Single helper to provide a monotonic time offset from startup_time. Signed-off-by: Sage Weil <sage@redhat.com>
This commit is contained in:
parent
37a79dd209
commit
c5a7cb0a7d
@ -321,6 +321,10 @@ void OSDService::dump_live_pgids()
|
||||
#endif
|
||||
|
||||
|
||||
ceph::signedspan OSDService::get_mnow()
|
||||
{
|
||||
return ceph::mono_clock::now() - osd->startup_time;
|
||||
}
|
||||
|
||||
void OSDService::identify_splits_and_merges(
|
||||
OSDMapRef old_map,
|
||||
|
@ -138,6 +138,8 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
ceph::signedspan get_mnow();
|
||||
|
||||
private:
|
||||
// -- superblock --
|
||||
ceph::mutex publish_lock, pre_publish_lock; // pre-publish orders before publish
|
||||
|
@ -1800,6 +1800,11 @@ void PG::send_pg_created(pg_t pgid)
|
||||
osd->send_pg_created(pgid);
|
||||
}
|
||||
|
||||
ceph::signedspan PG::get_mnow()
|
||||
{
|
||||
return osd->get_mnow();
|
||||
}
|
||||
|
||||
void PG::rebuild_missing_set_with_deletes(PGLog &pglog)
|
||||
{
|
||||
pglog.rebuild_missing_set_with_deletes(
|
||||
|
@ -478,6 +478,8 @@ public:
|
||||
|
||||
void send_pg_created(pg_t pgid) override;
|
||||
|
||||
ceph::signedspan get_mnow() override;
|
||||
|
||||
void rebuild_missing_set_with_deletes(PGLog &pglog) override;
|
||||
|
||||
void queue_peering_event(PGPeeringEventRef evt);
|
||||
|
@ -124,6 +124,8 @@ public:
|
||||
/// Send pg_created to mon
|
||||
virtual void send_pg_created(pg_t pgid) = 0;
|
||||
|
||||
virtual ceph::signedspan get_mnow() = 0;
|
||||
|
||||
// ============ Flush state ==================
|
||||
/**
|
||||
* try_flush_or_schedule_async()
|
||||
|
Loading…
Reference in New Issue
Block a user