]> git.proxmox.com Git - ceph.git/blame - ceph/src/messages/MClientQuota.h
import quincy beta 17.1.0
[ceph.git] / ceph / src / messages / MClientQuota.h
CommitLineData
7c673cae
FG
1#ifndef CEPH_MCLIENTQUOTA_H
2#define CEPH_MCLIENTQUOTA_H
3
4#include "msg/Message.h"
5
f67539c2 6class MClientQuota final : public SafeMessage {
11fdf7f2 7public:
7c673cae
FG
8 inodeno_t ino;
9 nest_info_t rstat;
10 quota_info_t quota;
11
11fdf7f2 12protected:
7c673cae 13 MClientQuota() :
9f95a23c 14 SafeMessage{CEPH_MSG_CLIENT_QUOTA},
7c673cae 15 ino(0)
11fdf7f2 16 {}
f67539c2 17 ~MClientQuota() final {}
7c673cae
FG
18
19public:
11fdf7f2 20 std::string_view get_type_name() const override { return "client_quota"; }
f67539c2 21 void print(std::ostream& out) const override {
7c673cae
FG
22 out << "client_quota(";
23 out << " [" << ino << "] ";
11fdf7f2
TL
24 out << rstat << " ";
25 out << quota;
7c673cae
FG
26 out << ")";
27 }
28
29 void encode_payload(uint64_t features) override {
11fdf7f2
TL
30 using ceph::encode;
31 encode(ino, payload);
32 encode(rstat.rctime, payload);
33 encode(rstat.rbytes, payload);
34 encode(rstat.rfiles, payload);
35 encode(rstat.rsubdirs, payload);
36 encode(quota, payload);
7c673cae
FG
37 }
38 void decode_payload() override {
f67539c2 39 using ceph::decode;
11fdf7f2
TL
40 auto p = payload.cbegin();
41 decode(ino, p);
42 decode(rstat.rctime, p);
43 decode(rstat.rbytes, p);
44 decode(rstat.rfiles, p);
45 decode(rstat.rsubdirs, p);
46 decode(quota, p);
47 ceph_assert(p.end());
7c673cae 48 }
9f95a23c
TL
49private:
50 template<class T, typename... Args>
51 friend boost::intrusive_ptr<T> ceph::make_message(Args&&... args);
20effc67
TL
52 template<class T, typename... Args>
53 friend MURef<T> crimson::make_message(Args&&... args);
7c673cae
FG
54};
55
56#endif