]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mds: add fscrypt_auth and fscrypt_file fields to MClientCaps
authorJeff Layton <jlayton@redhat.com>
Wed, 14 Apr 2021 15:04:15 +0000 (11:04 -0400)
committerXiubo Li <xiubli@redhat.com>
Thu, 13 Jan 2022 13:08:21 +0000 (21:08 +0800)
...and update those fields when the appropriate caps are
acquired/released/flushed.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
src/mds/Locker.cc
src/messages/MClientCaps.h

index bacc79a10381d63bdfc29cb1c0a357a18e4b05a1..078b93f4f0d4730bbdfcf850a269db4d7f1cd5db 100644 (file)
@@ -3717,6 +3717,8 @@ void Locker::_update_cap_fields(CInode *in, int dirty, const cref_t<MClientCaps>
              << " for " << *in << dendl;
       pi->time_warp_seq = m->get_time_warp_seq();
     }
+    if (m->fscrypt_file.size())
+      pi->fscrypt_file = m->fscrypt_file;
   }
   // auth
   if (dirty & CEPH_CAP_AUTH_EXCL) {
@@ -3744,6 +3746,8 @@ void Locker::_update_cap_fields(CInode *in, int dirty, const cref_t<MClientCaps>
              << " for " << *in << dendl;
       pi->btime = m->get_btime();
     }
+    if (m->fscrypt_auth.size())
+      pi->fscrypt_auth = m->fscrypt_auth;
   }
 }
 
index 500a6fc83b1ae5495f65ca2bccb5737ca4654b82..1489f97df0b5815aef300f94387211b7b6ae8748 100644 (file)
@@ -22,7 +22,7 @@
 class MClientCaps final : public SafeMessage {
 private:
 
-  static constexpr int HEAD_VERSION = 11;
+  static constexpr int HEAD_VERSION = 12;
   static constexpr int COMPAT_VERSION = 1;
 
  public:
@@ -59,6 +59,9 @@ private:
   /* advisory CLIENT_CAPS_* flags to send to mds */
   unsigned flags = 0;
 
+  std::vector<uint8_t> fscrypt_auth;
+  std::vector<uint8_t> fscrypt_file;
+
   int      get_caps() const { return head.caps; }
   int      get_wanted() const { return head.wanted; }
   int      get_dirty() const { return head.dirty; }
@@ -270,6 +273,10 @@ public:
       decode(nfiles, p);
       decode(nsubdirs, p);
     }
+    if (header.version >= 12) {
+      decode(fscrypt_auth, p);
+      decode(fscrypt_file, p);
+    }
   }
   void encode_payload(uint64_t features) override {
     using ceph::encode;
@@ -338,6 +345,8 @@ public:
     encode(flags, payload);
     encode(nfiles, payload);
     encode(nsubdirs, payload);
+    encode(fscrypt_auth, payload);
+    encode(fscrypt_file, payload);
   }
 private:
   template<class T, typename... Args>