]>
git.proxmox.com Git - ceph.git/blob - ceph/src/messages/MOSDMarkMeDown.h
1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
4 * Ceph - scalable distributed file system
6 * Copyright (C) 2013 Inktank Storage, Inc.
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.
15 #ifndef CEPH_MOSDMARKMEDOWN_H
16 #define CEPH_MOSDMARKMEDOWN_H
18 #include "messages/PaxosServiceMessage.h"
20 class MOSDMarkMeDown
: public PaxosServiceMessage
{
22 static const int HEAD_VERSION
= 2;
23 static const int COMPAT_VERSION
= 2;
27 entity_inst_t target_osd
;
29 bool request_ack
= false; // ack requested
32 : PaxosServiceMessage(MSG_OSD_MARK_ME_DOWN
, 0,
33 HEAD_VERSION
, COMPAT_VERSION
) { }
34 MOSDMarkMeDown(const uuid_d
&fs
, const entity_inst_t
& f
,
35 epoch_t e
, bool request_ack
)
36 : PaxosServiceMessage(MSG_OSD_MARK_ME_DOWN
, e
,
37 HEAD_VERSION
, COMPAT_VERSION
),
38 fsid(fs
), target_osd(f
), epoch(e
), request_ack(request_ack
) {}
40 ~MOSDMarkMeDown() override
{}
43 entity_inst_t
get_target() const { return target_osd
; }
44 epoch_t
get_epoch() const { return epoch
; }
46 void decode_payload() override
{
47 bufferlist::iterator p
= payload
.begin();
50 ::decode(target_osd
, p
);
52 ::decode(request_ack
, p
);
55 void encode_payload(uint64_t features
) override
{
57 ::encode(fsid
, payload
);
58 ::encode(target_osd
, payload
, features
);
59 ::encode(epoch
, payload
);
60 ::encode(request_ack
, payload
);
63 const char *get_type_name() const override
{ return "MOSDMarkMeDown"; }
64 void print(ostream
& out
) const override
{
65 out
<< "MOSDMarkMeDown("
66 << "request_ack=" << request_ack
67 << ", target_osd=" << target_osd