]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: authpin non-auth items we may need to REQSCATTER or REQRDLOCK for any lock type
authorSage Weil <sage@newdream.net>
Tue, 7 Sep 2010 21:40:33 +0000 (14:40 -0700)
committerSage Weil <sage@newdream.net>
Tue, 7 Sep 2010 21:40:33 +0000 (14:40 -0700)
We were doing just filelock, but this is needed for any lock.

src/mds/Locker.cc

index 862a5d739e3030588f720a04bf4d2c9a0a4da3c7..52dcadb304b89bb59d9cd08d650573e658adebdc 100644 (file)
@@ -198,9 +198,10 @@ bool Locker::acquire_locks(MDRequest *mdr,
     sorted.insert(*p);
     if ((*p)->get_parent()->is_auth())
       mustpin.insert(*p);
-    else if ((*p)->get_type() == CEPH_LOCK_IFILE &&
-            !(*p)->get_parent()->is_auth() && !(*p)->can_wrlock(client)) { // we might have to request a scatter
-      dout(15) << " will also auth_pin " << *(*p)->get_parent() << " in case we need to request a scatter" << dendl;
+    else if (!(*p)->get_parent()->is_auth() &&
+            !(*p)->can_wrlock(client)) {       // we might have to request a scatter
+      dout(15) << " will also auth_pin " << *(*p)->get_parent()
+              << " in case we need to request a scatter" << dendl;
       mustpin.insert(*p);
     }
   }
@@ -213,9 +214,10 @@ bool Locker::acquire_locks(MDRequest *mdr,
     sorted.insert(*p);
     if ((*p)->get_parent()->is_auth())
       mustpin.insert(*p);
-    else if ((*p)->get_type() == CEPH_LOCK_IFILE &&
-            !(*p)->get_parent()->is_auth() && !(*p)->can_rdlock(client)) { // we might have to request an rdlock
-      dout(15) << " will also auth_pin " << *(*p)->get_parent() << " in case we need to request a rdlock" << dendl;
+    else if (!(*p)->get_parent()->is_auth() &&
+            !(*p)->can_rdlock(client)) {      // we might have to request an rdlock
+      dout(15) << " will also auth_pin " << *(*p)->get_parent()
+              << " in case we need to request a rdlock" << dendl;
       mustpin.insert(*p);
     }
   }