From: Sage Weil Date: Wed, 23 Sep 2015 21:33:28 +0000 (-0400) Subject: osd: make [_]maybe_boot lockless variant X-Git-Tag: v10.0.1~26^2~45 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=605e188003699c7cb4923acf5634a4b45af2dd5a;p=ceph.git osd: make [_]maybe_boot lockless variant Signed-off-by: Sage Weil --- diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index d9caaaf87b51..eb484fb29af0 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 35877f41588e..636b9485af7a 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);