From: Jeff Layton Date: Wed, 14 Apr 2021 15:04:15 +0000 (-0400) Subject: mds: add fscrypt_auth and fscrypt_file fields to MClientCaps X-Git-Tag: v18.0.0~1381^2~13 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ec892d38cd184582ac39313472ba7df6b11afb7e;p=ceph.git mds: add fscrypt_auth and fscrypt_file fields to MClientCaps ...and update those fields when the appropriate caps are acquired/released/flushed. Signed-off-by: Jeff Layton --- diff --git a/src/mds/Locker.cc b/src/mds/Locker.cc index bacc79a10381..078b93f4f0d4 100644 --- a/src/mds/Locker.cc +++ b/src/mds/Locker.cc @@ -3717,6 +3717,8 @@ void Locker::_update_cap_fields(CInode *in, int dirty, const cref_t << " 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 << " for " << *in << dendl; pi->btime = m->get_btime(); } + if (m->fscrypt_auth.size()) + pi->fscrypt_auth = m->fscrypt_auth; } } diff --git a/src/messages/MClientCaps.h b/src/messages/MClientCaps.h index 500a6fc83b1a..1489f97df0b5 100644 --- a/src/messages/MClientCaps.h +++ b/src/messages/MClientCaps.h @@ -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 fscrypt_auth; + std::vector 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