mirror of
https://github.com/ceph/ceph
synced 2025-01-20 10:01:45 +00:00
monc: new fsub_want_increment( function to make handling subscriptions easier
Provide a subscription-modifying function which will not decrement the start version. Signed-off-by: Greg Farnum <greg@inktank.com>
This commit is contained in:
parent
af5d0fcd90
commit
5b9c187caf
@ -246,6 +246,22 @@ public:
|
||||
Mutex::Locker l(monc_lock);
|
||||
_sub_unwant(what);
|
||||
}
|
||||
/**
|
||||
* Increase the requested subscription start point. If you do increase
|
||||
* the value, apply the passed-in flags as well; otherwise do nothing.
|
||||
*/
|
||||
bool sub_want_increment(string what, version_t start, unsigned flags) {
|
||||
Mutex::Locker l(monc_lock);
|
||||
map<string,ceph_mon_subscribe_item>::iterator i =
|
||||
sub_have.find(what);
|
||||
if (i == sub_have.end() || i->second.start < start) {
|
||||
ceph_mon_subscribe_item& item = sub_have[what];
|
||||
item.start = start;
|
||||
item.flags = flags;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
KeyRing *keyring;
|
||||
RotatingKeyRing *rotating_secrets;
|
||||
|
Loading…
Reference in New Issue
Block a user