From 4385aa567de31d0ebe46e25eac802f329cf0851d Mon Sep 17 00:00:00 2001 From: Greg Farnum Date: Fri, 14 Jan 2011 16:22:11 -0800 Subject: [PATCH] MDS: Use new C_Gather::get_num_remaining() in MDCache. 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 --- src/include/Context.h | 1 + src/mds/MDCache.cc | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/include/Context.h b/src/include/Context.h index 80202b9223837..4609b5a41e5db 100644 --- a/src/include/Context.h +++ b/src/include/Context.h @@ -221,6 +221,7 @@ public: 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. diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc index 83968e18d227d..7a66928eafd5f 100644 --- a/src/mds/MDCache.cc +++ b/src/mds/MDCache.cc @@ -4405,8 +4405,8 @@ void MDCache::open_snap_parents() 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()); -- 2.39.5