From 605e188003699c7cb4923acf5634a4b45af2dd5a Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Wed, 23 Sep 2015 17:33:28 -0400 Subject: [PATCH] osd: make [_]maybe_boot lockless variant Signed-off-by: Sage Weil --- src/osd/OSD.cc | 9 +++++++-- src/osd/OSD.h | 1 + 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index d9caaaf87b51b..eb484fb29af05 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -4491,7 +4491,7 @@ struct C_OSD_GetVersion : public Context { C_OSD_GetVersion(OSD *o) : osd(o), oldest(0), newest(0) {} void finish(int r) { if (r >= 0) - osd->_maybe_boot(oldest, newest); + osd->maybe_boot(oldest, newest); } }; @@ -4503,9 +4503,14 @@ void OSD::start_boot() monc->get_version("osdmap", &c->newest, &c->oldest, c); } -void OSD::_maybe_boot(epoch_t oldest, epoch_t newest) +void OSD::maybe_boot(epoch_t oldest, epoch_t newest) { Mutex::Locker l(osd_lock); + _maybe_boot(oldest, newest); +} + +void OSD::_maybe_boot(epoch_t oldest, epoch_t newest) +{ if (!is_booting()) return; dout(10) << "_maybe_boot mon has osdmaps " << oldest << ".." << newest << dendl; diff --git a/src/osd/OSD.h b/src/osd/OSD.h index 35877f41588e1..636b9485af7ad 100644 --- a/src/osd/OSD.h +++ b/src/osd/OSD.h @@ -1975,6 +1975,7 @@ protected: // -- boot -- void start_boot(); + void maybe_boot(epoch_t oldest, epoch_t newest); void _maybe_boot(epoch_t oldest, epoch_t newest); void _send_boot(); void _collect_metadata(map *pmeta); -- 2.39.5