diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 18:24:20 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 18:24:20 +0000 |
commit | 483eb2f56657e8e7f419ab1a4fab8dce9ade8609 (patch) | |
tree | e5d88d25d870d5dedacb6bbdbe2a966086a0a5cf /src/messages/MClientQuota.h | |
parent | Initial commit. (diff) | |
download | ceph-483eb2f56657e8e7f419ab1a4fab8dce9ade8609.tar.xz ceph-483eb2f56657e8e7f419ab1a4fab8dce9ade8609.zip |
Adding upstream version 14.2.21.upstream/14.2.21upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/messages/MClientQuota.h')
-rw-r--r-- | src/messages/MClientQuota.h | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/src/messages/MClientQuota.h b/src/messages/MClientQuota.h new file mode 100644 index 00000000..b1aed00b --- /dev/null +++ b/src/messages/MClientQuota.h @@ -0,0 +1,52 @@ +#ifndef CEPH_MCLIENTQUOTA_H +#define CEPH_MCLIENTQUOTA_H + +#include "msg/Message.h" + +class MClientQuota : public MessageInstance<MClientQuota> { +public: + friend factory; + + inodeno_t ino; + nest_info_t rstat; + quota_info_t quota; + +protected: + MClientQuota() : + MessageInstance(CEPH_MSG_CLIENT_QUOTA), + ino(0) + {} + ~MClientQuota() override {} + +public: + std::string_view get_type_name() const override { return "client_quota"; } + void print(ostream& out) const override { + out << "client_quota("; + out << " [" << ino << "] "; + out << rstat << " "; + out << quota; + out << ")"; + } + + void encode_payload(uint64_t features) override { + using ceph::encode; + encode(ino, payload); + encode(rstat.rctime, payload); + encode(rstat.rbytes, payload); + encode(rstat.rfiles, payload); + encode(rstat.rsubdirs, payload); + encode(quota, payload); + } + void decode_payload() override { + auto p = payload.cbegin(); + decode(ino, p); + decode(rstat.rctime, p); + decode(rstat.rbytes, p); + decode(rstat.rfiles, p); + decode(rstat.rsubdirs, p); + decode(quota, p); + ceph_assert(p.end()); + } +}; + +#endif |