]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
* fixed lock waiters
authorsageweil <sageweil@29311d96-e01e-0410-9327-a35deaab8ce9>
Mon, 4 Jun 2007 21:07:38 +0000 (21:07 +0000)
committersageweil <sageweil@29311d96-e01e-0410-9327-a35deaab8ce9>
Mon, 4 Jun 2007 21:07:38 +0000 (21:07 +0000)
git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@1390 29311d96-e01e-0410-9327-a35deaab8ce9

trunk/ceph/mds/Locker.cc
trunk/ceph/mds/SimpleLock.h

index 48a2156e63f7a2be482d77b9f5058d0d25f4c170..741d89d43e28fa497eb2f53cd3a50897e10c983c 100644 (file)
@@ -425,7 +425,7 @@ bool Locker::issue_caps(CInode *in)
   for (map<int, Capability>::iterator it = in->client_caps.begin();
        it != in->client_caps.end();
        it++) {
-    if (it->second.issued() != (it->second.wanted() & allowed)) {
+    if (it->second.pending() != (it->second.wanted() & allowed)) {
       // issue
       nissued++;
 
@@ -941,7 +941,7 @@ void Locker::simple_sync(SimpleLock *lock)
   lock->set_state(LOCK_SYNC);
   
   // waiters?
-  lock->finish_waiters(SimpleLock::WAIT_STABLE);
+  lock->finish_waiters(SimpleLock::WAIT_RD|SimpleLock::WAIT_STABLE);
 }
 
 void Locker::simple_lock(SimpleLock *lock)
@@ -998,9 +998,6 @@ bool Locker::simple_rdlock_start(SimpleLock *lock, MDRequest *mdr)
     return true;
   }
   
-  // can't read, and replicated.
-  assert(!lock->get_parent()->is_auth());
-
   // wait!
   dout(7) << "simple_rdlock_start waiting on " << *lock << " on " << *lock->get_parent() << endl;
   lock->add_waiter(SimpleLock::WAIT_RD, new C_MDS_RetryRequest(mdcache, mdr));
index 9b5631cbae03e8a07f43d7012ed6fb5f97d421d4..7df38a0a6bd1b56fd66f470f6e9c418b34fecc5c 100644 (file)
@@ -45,7 +45,7 @@ inline const char *get_lock_type_name(int t) {
 //                                auth   rep
 #define LOCK_SYNC     1  // AR   R .    R .
 #define LOCK_LOCK     2  // AR   R W    . .
-#define LOCK_GLOCKR   3  // AR   R .    . .
+#define LOCK_GLOCKR  -3  // AR   R .    . .
 
 inline const char *get_simplelock_state_name(int n) {
   switch (n) {
@@ -109,13 +109,13 @@ public:
     parent->encode_lock_state(type, bl);
   }
   void finish_waiters(int mask, int r=0) {
-    parent->finish_waiting(mask < wait_offset, r);
+    parent->finish_waiting(mask << wait_offset, r);
   }
   void add_waiter(int mask, Context *c) {
-    parent->add_waiter(mask < wait_offset, c);
+    parent->add_waiter(mask << wait_offset, c);
   }
   bool is_waiter_for(int mask) {
-    return parent->is_waiter_for(mask < wait_offset);
+    return parent->is_waiter_for(mask << wait_offset);
   }