]> git.proxmox.com Git - ceph.git/blame - ceph/src/messages/MOSDScrub2.h
update source to Ceph Pacific 16.2.2
[ceph.git] / ceph / src / messages / MOSDScrub2.h
CommitLineData
11fdf7f2
TL
1// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2// vim: ts=8 sw=2 smarttab
3
4#pragma once
5
6#include "msg/Message.h"
7
8/*
9 * instruct an OSD to scrub some or all pg(s)
10 */
11
f67539c2 12class MOSDScrub2 final : public Message {
11fdf7f2 13public:
11fdf7f2
TL
14 static constexpr int HEAD_VERSION = 1;
15 static constexpr int COMPAT_VERSION = 1;
16
17 uuid_d fsid;
18 epoch_t epoch;
f67539c2 19 std::vector<spg_t> scrub_pgs;
11fdf7f2
TL
20 bool repair = false;
21 bool deep = false;
22
9f95a23c 23 MOSDScrub2() : Message{MSG_OSD_SCRUB2, HEAD_VERSION, COMPAT_VERSION} {}
f67539c2 24 MOSDScrub2(const uuid_d& f, epoch_t e, std::vector<spg_t>& pgs, bool r, bool d) :
9f95a23c 25 Message{MSG_OSD_SCRUB2, HEAD_VERSION, COMPAT_VERSION},
11fdf7f2
TL
26 fsid(f), epoch(e), scrub_pgs(pgs), repair(r), deep(d) {}
27private:
f67539c2 28 ~MOSDScrub2() final {}
11fdf7f2
TL
29
30public:
31 std::string_view get_type_name() const override { return "scrub2"; }
f67539c2 32 void print(std::ostream& out) const override {
11fdf7f2
TL
33 out << "scrub2(" << scrub_pgs;
34 if (repair)
35 out << " repair";
36 if (deep)
37 out << " deep";
38 out << ")";
39 }
40
41 void encode_payload(uint64_t features) override {
42 using ceph::encode;
43 encode(fsid, payload);
44 encode(epoch, payload);
45 encode(scrub_pgs, payload);
46 encode(repair, payload);
47 encode(deep, payload);
48 }
49 void decode_payload() override {
f67539c2 50 using ceph::decode;
11fdf7f2
TL
51 auto p = payload.cbegin();
52 decode(fsid, p);
53 decode(epoch, p);
54 decode(scrub_pgs, p);
55 decode(repair, p);
56 decode(deep, p);
57 }
9f95a23c
TL
58private:
59 template<class T, typename... Args>
60 friend boost::intrusive_ptr<T> ceph::make_message(Args&&... args);
11fdf7f2 61};