unsigned n = 0;
for (map<__u64,mds_info_t>::const_iterator p = mds_info.begin();
p != mds_info.end();
- p++)
+ ++p)
if (p->second.state == state) ++n;
return n;
}
void get_up_mds_set(set<int>& s) {
for (map<int32_t,__u64>::const_iterator p = up.begin();
p != up.end();
- p++)
+ ++p)
s.insert(p->first);
}
void get_active_mds_set(set<int>& s) {
s = failed;
}
int get_failed() {
- if (failed.size()) return *failed.begin();
+ if (!failed.empty()) return *failed.begin();
return -1;
}
void get_stopped_mds_set(set<int>& s) {
s = failed;
for (map<__u64,mds_info_t>::const_iterator p = mds_info.begin();
p != mds_info.end();
- p++)
+ ++p)
if (p->second.state >= STATE_REPLAY && p->second.state <= STATE_STOPPING)
s.insert(p->second.rank);
}
void get_mds_set(set<int>& s, int state) {
for (map<__u64,mds_info_t>::const_iterator p = mds_info.begin();
p != mds_info.end();
- p++)
+ ++p)
if (p->second.state == state)
s.insert(p->second.rank);
}
__u64 find_standby_for(int mds, string& name) {
for (map<__u64,mds_info_t>::const_iterator p = mds_info.begin();
p != mds_info.end();
- p++) {
+ ++p) {
if (p->second.rank == -1 &&
(p->second.standby_for_rank == mds ||
p->second.standby_for_name == name) &&
}
for (map<__u64,mds_info_t>::const_iterator p = mds_info.begin();
p != mds_info.end();
- p++) {
+ ++p) {
if (p->second.rank == -1 &&
p->second.standby_for_rank < 0 &&
p->second.standby_for_name.length() == 0 &&
__u64 max = 0;
for (map<client_t,byte_range_t>::const_iterator p = client_ranges.begin();
p != client_ranges.end();
- p++)
+ ++p)
if (p->second.last > max)
max = p->second.last;
return max;
} else {
for (map<client_t,byte_range_t>::iterator p = client_ranges.begin();
p != client_ranges.end();
- p++)
+ ++p)
p->second.last = new_max;
}
}
}
for (multimap<__u64,Context*>::iterator p = waiting.lower_bound(min);
p != waiting.end();
- p++) {
+ ++p) {
if (p->first & mask) return true;
if (p->first > mask) return false;
}