From 19fcec84d8d7d21e796c7624e521b60d28ee21ed Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 20:45:59 +0200 Subject: Adding upstream version 16.2.11+ds. Signed-off-by: Daniel Baumann --- src/messages/MOSDFull.h | 54 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 src/messages/MOSDFull.h (limited to 'src/messages/MOSDFull.h') diff --git a/src/messages/MOSDFull.h b/src/messages/MOSDFull.h new file mode 100644 index 000000000..89f5b8402 --- /dev/null +++ b/src/messages/MOSDFull.h @@ -0,0 +1,54 @@ +// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- +// vim: ts=8 sw=2 smarttab + +#ifndef CEPH_MOSDFULL_H +#define CEPH_MOSDFULL_H + +#include "messages/PaxosServiceMessage.h" +#include "osd/OSDMap.h" + +// tell the mon to update the full/nearfull bits. note that in the +// future this message could be generalized to other state bits, but +// for now name it for its sole application. + +class MOSDFull final : public PaxosServiceMessage { +public: + epoch_t map_epoch = 0; + uint32_t state = 0; + +private: + ~MOSDFull() final {} + +public: + MOSDFull(epoch_t e, unsigned s) + : PaxosServiceMessage{MSG_OSD_FULL, e}, map_epoch(e), state(s) { } + MOSDFull() + : PaxosServiceMessage{MSG_OSD_FULL, 0} {} + +public: + void encode_payload(uint64_t features) { + using ceph::encode; + paxos_encode(); + encode(map_epoch, payload); + encode(state, payload); + } + void decode_payload() { + using ceph::decode; + auto p = payload.cbegin(); + paxos_decode(p); + decode(map_epoch, p); + decode(state, p); + } + + std::string_view get_type_name() const { return "osd_full"; } + void print(std::ostream &out) const { + std::set states; + OSDMap::calc_state_set(state, states); + out << "osd_full(e" << map_epoch << " " << states << " v" << version << ")"; + } +private: + template + friend boost::intrusive_ptr ceph::make_message(Args&&... args); +}; + +#endif -- cgit v1.2.3