// ---------
-struct C_IsLatestMap : public Context {
- Context *onfinish;
- version_t newest;
- version_t have;
- C_IsLatestMap(Context *f, version_t h) : onfinish(f), newest(0), have(h) {}
- void finish(int r) {
- onfinish->complete(r == 0 ? (have != newest) : r);
- }
-};
-
-void MonClient::is_latest_map(string map, version_t cur_ver, Context *onfinish)
-{
- ldout(cct, 10) << "is_latest_map " << map << " current " << cur_ver << dendl;;
- C_IsLatestMap *c = new C_IsLatestMap(onfinish, cur_ver);
- get_version(map, &c->newest, NULL, c);
-}
-
void MonClient::get_version(string map, version_t *newest, version_t *oldest, Context *onfinish)
{
ldout(cct, 10) << "get_version " << map << dendl;
// version requests
public:
- /**
- * check if we have the latest version of a map
- *
- * @param map name of map (e.g., 'osdmap')
- * @param cur_ver version we have
- * @param onfinish completion
- * @return (via context) 1 if cur_ver is the latest, 0 if it is not, -EAGAIN if we need to retry
- */
- void is_latest_map(string map, version_t cur_ver, Context *onfinish);
-
/**
* get latest known version(s) of cluster map
*