]> git.proxmox.com Git - ceph.git/blob - ceph/src/messages/MFSMapUser.h
bump version to 18.2.2-pve1
[ceph.git] / ceph / src / messages / MFSMapUser.h
1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
3 /*
4 * Ceph - scalable distributed file system
5 *
6 * Copyright (C) 2004-2006 Sage Weil <sage@newdream.net>
7 *
8 * This is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License version 2.1, as published by the Free Software
11 * Foundation. See file COPYING.
12 */
13
14
15 #ifndef CEPH_MFSMAPCOMPACT_H
16 #define CEPH_MFSMAPCOMPACT_H
17
18 #include "msg/Message.h"
19 #include "mds/FSMapUser.h"
20 #include "include/ceph_features.h"
21
22 class MFSMapUser final : public Message {
23 public:
24 epoch_t epoch;
25
26 version_t get_epoch() const { return epoch; }
27 const FSMapUser& get_fsmap() const { return fsmap; }
28
29 MFSMapUser() :
30 Message{CEPH_MSG_FS_MAP_USER}, epoch(0) {}
31 MFSMapUser(const uuid_d &f, const FSMapUser &fsmap_) :
32 Message{CEPH_MSG_FS_MAP_USER},
33 epoch(fsmap_.epoch),
34 fsmap{fsmap_}
35 {}
36 private:
37 FSMapUser fsmap;
38
39 ~MFSMapUser() final {}
40
41 public:
42 std::string_view get_type_name() const override { return "fsmap.user"; }
43 void print(std::ostream& out) const override {
44 out << "fsmap.user(e " << epoch << ")";
45 }
46
47 // marshalling
48 void decode_payload() override {
49 using ceph::decode;
50 auto p = payload.cbegin();
51 decode(epoch, p);
52 decode(fsmap, p);
53 }
54 void encode_payload(uint64_t features) override {
55 using ceph::encode;
56 encode(epoch, payload);
57 encode(fsmap, payload, features);
58 }
59 private:
60 template<class T, typename... Args>
61 friend boost::intrusive_ptr<T> ceph::make_message(Args&&... args);
62 };
63
64 #endif