]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
OSD,PG: lock_with_map_lock_held() is the same as lock()
authorSamuel Just <sam.just@inktank.com>
Wed, 8 May 2013 22:46:41 +0000 (15:46 -0700)
committerSamuel Just <sam.just@inktank.com>
Wed, 8 May 2013 22:46:41 +0000 (15:46 -0700)
Signed-off-by: Samuel Just <sam.just@inktank.com>
src/osd/OSD.cc
src/osd/PG.cc
src/osd/PG.h

index d27a3b51a3c36328ba755b61402b68b8bd3ed90d..f9f2b46a2218d1923e8e58818f7aab661398ef01 100644 (file)
@@ -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<pg_t>& 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<pg_t,PG*> children;
index f4ad633ab13210c4117268110fddac06d458754b..6678b19e3e7e84ff0ab47adf16a5ed11adbd80a5 100644 (file)
@@ -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());
index 720fcb587727efe28cc383e8044b71bab8a17450..e611b1d046f1f030ed06e4c81ff98a65c74d8e37 100644 (file)
@@ -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();