It was using get_num(), which now reports the number created.
This probably wouldn't have worked previously except that
~C_Gather::C_GatherSub was inappropriately calling rm_sub().
Signed-off-by: Greg Farnum <gregf@hq.newdream.net>
bool empty() { Mutex::Locker l(lock); return sub_existing_count == 0; }
int get_num() { Mutex::Locker l(lock); return sub_created_count; }
+ int get_num_remaining() { Mutex::Locker l(lock); return sub_existing_count;}
void finish(int r) {
assert(0); // nobody should ever call me.
send_snaps(splits);
- if (gather->get_num()) {
- dout(10) << "open_snap_parents - waiting for " << gather->get_num() << dendl;
+ if (gather->get_num_remaining()) {
+ dout(10) << "open_snap_parents - waiting for " << gather->get_num_remaining() << dendl;
gather->set_finisher(new C_MDC_OpenSnapParents(this));
} else {
assert(missing_snap_parents.empty());