]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds/Locker: prioritize file recovery on rd/wr/x lock
authorSage Weil <sage@redhat.com>
Thu, 14 Aug 2014 22:06:47 +0000 (15:06 -0700)
committerSage Weil <sage@redhat.com>
Thu, 28 Aug 2014 20:09:25 +0000 (13:09 -0700)
If someone specifically touches the file lock, prioritize recovery for this
file.

Signed-off-by: Sage Weil <sage@redhat.com>
src/mds/Locker.cc

index eb4eccf5e5bc40fa5194bf7272c3ff88ee80af7a..c1d78d517140a34119d400ccaf995ea38fff004d 100644 (file)
@@ -1184,6 +1184,13 @@ bool Locker::_rdlock_kick(SimpleLock *lock, bool as_anon)
       return false;
     }
   }
+  if (lock->get_type() == CEPH_LOCK_IFILE) {
+    CInode *in = static_cast<CInode *>(lock->get_parent());
+    if (in->state_test(CInode::STATE_RECOVERING)) {
+      mds->mdcache->recovery_queue.prioritize(in);
+    }
+  }
+
   return false;
 }
 
@@ -1370,6 +1377,11 @@ bool Locker::wrlock_start(SimpleLock *lock, MDRequestRef& mut, bool nowait)
       return true;
     }
 
+    if (lock->get_type() == CEPH_LOCK_IFILE &&
+       in->state_test(CInode::STATE_RECOVERING)) {
+      mds->mdcache->recovery_queue.prioritize(in);
+    }
+
     if (!lock->is_stable())
       break;
 
@@ -1505,6 +1517,13 @@ bool Locker::xlock_start(SimpleLock *lock, MDRequestRef& mut)
        return true;
       }
       
+      if (lock->get_type() == CEPH_LOCK_IFILE) {
+       CInode *in = static_cast<CInode*>(lock->get_parent());
+       if (in->state_test(CInode::STATE_RECOVERING)) {
+         mds->mdcache->recovery_queue.prioritize(in);
+       }
+      }
+
       if (!lock->is_stable() && !(lock->get_state() == LOCK_XLOCKDONE &&
                                  lock->get_xlock_by_client() == client))
        break;