sub_have[what].have = have;
sub_have[what].onetime = false;
}
- void _sub_want_onetime(nstring what, version_t have) {
+ bool _sub_want_onetime(nstring what, version_t have) {
if (sub_have.count(what) == 0) {
sub_have[what].have = have;
sub_have[what].onetime = true;
+ return true;
}
+ return false;
}
void _sub_got(nstring what, version_t have) {
if (sub_have.count(what)) {
Mutex::Locker l(monc_lock);
_sub_want(what, have);
}
- void sub_want_onetime(nstring what, version_t have) {
+ bool sub_want_onetime(nstring what, version_t have) {
Mutex::Locker l(monc_lock);
- _sub_want_onetime(what, have);
+ return _sub_want_onetime(what, have);
}
void sub_got(nstring what, version_t have) {
Mutex::Locker l(monc_lock);
void Objecter::maybe_request_map()
{
dout(10) << "maybe_request_map subscribing (onetime) to next osd map" << dendl;
- monc->sub_want_onetime("osdmap", osdmap->get_epoch());
- monc->renew_subs();
+ if (monc->sub_want_onetime("osdmap", osdmap->get_epoch()))
+ monc->renew_subs();
}