]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: LAYZIO is not liked, but it is allowed
authorSage Weil <sage@newdream.net>
Wed, 26 May 2010 21:47:32 +0000 (14:47 -0700)
committerSage Weil <sage@newdream.net>
Wed, 26 May 2010 21:47:49 +0000 (14:47 -0700)
src/mds/CInode.h

index 3b59e47d11557fc2c936b7911b44f2a6afe51922..118fd02344484bf4ca1974282e0d6186c99745a0 100644 (file)
@@ -720,10 +720,15 @@ public:
     if (is_dir())
       return CEPH_CAP_PIN | CEPH_CAP_ANY_EXCL | CEPH_CAP_ANY_SHARED;  // but not, say, FILE_RD|WR|WRBUFFER
     else
-      return CEPH_CAP_ANY;
+      return CEPH_CAP_ANY & ~CEPH_CAP_FILE_LAZYIO;
   }
   int get_caps_allowed_ever() {
-    return get_caps_liked() & 
+    int allowed;
+    if (is_dir())
+      allowed = CEPH_CAP_PIN | CEPH_CAP_ANY_EXCL | CEPH_CAP_ANY_SHARED;
+    else
+      allowed = CEPH_CAP_ANY;
+    return allowed & 
       (CEPH_CAP_PIN |
        (filelock.gcaps_allowed_ever() << filelock.get_cap_shift()) |
        (authlock.gcaps_allowed_ever() << authlock.get_cap_shift()) |