]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
client: prefer auth cap in caps_issued_mask()
authorSage Weil <sage@newdream.net>
Fri, 24 Jun 2011 17:46:32 +0000 (10:46 -0700)
committerSage Weil <sage@newdream.net>
Fri, 24 Jun 2011 23:49:29 +0000 (16:49 -0700)
If we have an auth cap, prefer to touch that one.  This helps consolidate
caps on a single mds and allows mds replicas to eventually recall their
state.

Signed-off-by: Sage Weil <sage@newdream.net>
src/client/Client.h

index cd5ba72e284711e0e67bde3f45e2ef498486842c..292bac5d0d4987906299a55a16c873e384e8cfa0 100644 (file)
@@ -601,6 +601,14 @@ class Inode {
     int c = exporting_issued | snap_caps;
     if ((c & mask) == mask)
       return true;
+    // prefer auth cap
+    if (auth_cap &&
+       cap_is_valid(auth_cap) &&
+       (auth_cap->issued & mask) == mask) {
+      touch_cap(auth_cap);
+      return true;
+    }
+    // try any cap
     for (map<int,InodeCap*>::iterator it = caps.begin();
          it != caps.end();
          it++) {