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) 2013 Inktank Storage, Inc.
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_MOSDMARKMEDOWN_H
16   	#define CEPH_MOSDMARKMEDOWN_H
17   	
18   	#include "messages/PaxosServiceMessage.h"
19   	
20   	class MOSDMarkMeDown : public PaxosServiceMessage {
21   	private:
22   	  static constexpr int HEAD_VERSION = 3;
23   	  static constexpr int COMPAT_VERSION = 3;
24   	
25   	 public:
26   	  uuid_d fsid;
(1) Event member_decl: Class member declaration for "target_osd".
Also see events: [uninit_member]
27   	  int32_t target_osd;
28   	  entity_addrvec_t target_addrs;
29   	  epoch_t epoch = 0;
30   	  bool request_ack = false;          // ack requested
31   	
32   	  MOSDMarkMeDown()
33   	    : PaxosServiceMessage{MSG_OSD_MARK_ME_DOWN, 0,
(2) Event uninit_member: Non-static class member "target_osd" is not initialized in this constructor nor in any functions that it calls.
Also see events: [member_decl]
34   				  HEAD_VERSION, COMPAT_VERSION} { }
35   	  MOSDMarkMeDown(const uuid_d &fs, int osd, const entity_addrvec_t& av,
36   			 epoch_t e, bool request_ack)
37   	    : PaxosServiceMessage{MSG_OSD_MARK_ME_DOWN, e,
38   				  HEAD_VERSION, COMPAT_VERSION},
39   	      fsid(fs), target_osd(osd), target_addrs(av),
40   	      epoch(e), request_ack(request_ack) {}
41   	 private:
42   	  ~MOSDMarkMeDown() override {}
43   	
44   	public: 
45   	  epoch_t get_epoch() const { return epoch; }
46   	
47   	  void decode_payload() override {
48   	    auto p = payload.cbegin();
49   	    paxos_decode(p);
50   	    if (header.version <= 2) {
51   	      decode(fsid, p);
52   	      entity_inst_t i;
53   	      decode(i, p);
54   	      target_osd = i.name.num();
55   	      target_addrs = entity_addrvec_t(i.addr);
56   	      decode(epoch, p);
57   	      decode(request_ack, p);
58   	      return;
59   	    }
60   	    decode(fsid, p);
61   	    decode(target_osd, p);
62   	    decode(target_addrs, p);
63   	    decode(epoch, p);
64   	    decode(request_ack, p);
65   	  }
66   	
67   	  void encode_payload(uint64_t features) override {
68   	    using ceph::encode;
69   	    paxos_encode();
70   	    if (!HAVE_FEATURE(features, SERVER_NAUTILUS)) {
71   	      header.version = 2;
72   	      header.compat_version = 2;
73   	      encode(fsid, payload);
74   	      encode(entity_inst_t(entity_name_t::OSD(target_osd),
75   				   target_addrs.legacy_addr()),
76   		     payload, features);
77   	      encode(epoch, payload);
78   	      encode(request_ack, payload);
79   	      return;
80   	    }
81   	    header.version = HEAD_VERSION;
82   	    header.compat_version = COMPAT_VERSION;
83   	    encode(fsid, payload);
84   	    encode(target_osd, payload, features);
85   	    encode(target_addrs, payload, features);
86   	    encode(epoch, payload);
87   	    encode(request_ack, payload);
88   	  }
89   	
90   	  std::string_view get_type_name() const override { return "MOSDMarkMeDown"; }
91   	  void print(ostream& out) const override {
92   	    out << "MOSDMarkMeDown("
93   		<< "request_ack=" << request_ack
94   		<< ", osd." << target_osd
95   		<< ", " << target_addrs
96   		<< ", fsid=" << fsid
97   		<< ")";
98   	  }
99   	private:
100  	  template<class T, typename... Args>
101  	  friend boost::intrusive_ptr<T> ceph::make_message(Args&&... args);
102  	};
103  	
104  	#endif
105