]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
OSD: do not hold obc lock in disconnect_session_watches
authorSamuel Just <samuel.just@dreamhost.com>
Mon, 19 Mar 2012 23:06:40 +0000 (16:06 -0700)
committerSamuel Just <samuel.just@dreamhost.com>
Mon, 19 Mar 2012 23:10:25 +0000 (16:10 -0700)
ObjectContext::lock is used only for implementing read_lock and
write_lock.  PG::lock is used to protect the ObjectContexts
belonging to a pg.

Signed-off-by: Samuel Just <samuel.just@dreamhost.com>
Reviewed-by: Josh Durgin <josh.durgin@dreamhost.com>
src/osd/OSD.cc
src/osd/ReplicatedPG.h

index 2126010f03c30e38e6cd1483bf1f189b12b62894..bf904eeffb56b62bec560444d4b0f80236e9f254 100644 (file)
@@ -2050,7 +2050,6 @@ void OSD::disconnect_session_watches(Session *session)
 
     ReplicatedPG *pg = static_cast<ReplicatedPG *>(lookup_lock_raw_pg(oiter->second));
     assert(pg);
-    obc->lock.Lock();
     watch_lock.Lock();
     /* NOTE! fix this one, should be able to just lookup entity name,
        however, we currently only keep EntityName on the session and not
@@ -2075,7 +2074,6 @@ void OSD::disconnect_session_watches(Session *session)
       ++witer;
     }
     watch_lock.Unlock();
-    obc->lock.Unlock();
     pg->put_object_context(obc);
     /* now drop a reference to that obc */
     pg->unlock();
index b8bc5e1b824be34f75fd54ed120a9498f4721d58..b8b09fcf4d84a9ecded171c0f018341da0c45151 100644 (file)
@@ -268,7 +268,9 @@ public:
 
     SnapSetContext *ssc;  // may be null
 
+  private:
     Mutex lock;
+  public:
     Cond cond;
     int unstable_writes, readers, writers_waiting, readers_waiting;