From: Samuel Just Date: Wed, 8 May 2013 22:46:41 +0000 (-0700) Subject: OSD,PG: lock_with_map_lock_held() is the same as lock() X-Git-Tag: v0.62~5^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=17705d7295dfb0919960b69b34e68fff94a92ae7;p=ceph.git OSD,PG: lock_with_map_lock_held() is the same as lock() Signed-off-by: Samuel Just --- diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index d27a3b51a3c36..f9f2b46a2218d 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -1564,10 +1564,7 @@ PG *OSD::_open_lock_pg( pg_map[pgid] = pg; - if (hold_map_lock) - pg->lock_with_map_lock_held(no_lockdep_check); - else - pg->lock(no_lockdep_check); + pg->lock(no_lockdep_check); pg->get("PGMap"); // because it's in pg_map return pg; } @@ -1674,7 +1671,7 @@ PG *OSD::_lookup_lock_pg_with_map_lock_held(pg_t pgid) assert(osd_lock.is_locked()); assert(pg_map.count(pgid)); PG *pg = pg_map[pgid]; - pg->lock_with_map_lock_held(); + pg->lock(); return pg; } @@ -4989,7 +4986,7 @@ void OSD::do_split(PG *parent, set& childpgids, ObjectStore::Transaction& { dout(10) << "do_split to " << childpgids << " on " << *parent << dendl; - parent->lock_with_map_lock_held(); + parent->lock(); // create and lock children map children; diff --git a/src/osd/PG.cc b/src/osd/PG.cc index f4ad633ab1321..6678b19e3e7e8 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -194,17 +194,6 @@ void PG::lock(bool no_lockdep) dout(30) << "lock" << dendl; } -void PG::lock_with_map_lock_held(bool no_lockdep) -{ - _lock.Lock(no_lockdep); - // if we have unrecorded dirty state with the lock dropped, there is a bug - assert(!dirty_info); - assert(!dirty_big_info); - assert(!dirty_log); - - dout(30) << "lock_with_map_lock_held" << dendl; -} - void PG::reassert_lock_with_map_lock_held() { assert(_lock.is_locked()); diff --git a/src/osd/PG.h b/src/osd/PG.h index 720fcb587727e..e611b1d046f1f 100644 --- a/src/osd/PG.h +++ b/src/osd/PG.h @@ -420,10 +420,6 @@ public: _lock.Unlock(); } - /* During handle_osd_map, the osd holds a write lock to the osdmap. - * *_with_map_lock_held assume that the map_lock is already held */ - void lock_with_map_lock_held(bool no_lockdep = false); - // assert we still have lock held, and update our map ref void reassert_lock_with_map_lock_held();