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) 2004-2006 Sage Weil <sage@newdream.net>
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.
16 #ifndef CEPH_MOSDSCRUB_H
17 #define CEPH_MOSDSCRUB_H
19 #include "msg/Message.h"
22 * instruct an OSD to scrub some or all pg(s)
25 struct MOSDScrub : public Message {
27 static const int HEAD_VERSION = 2;
28 static const int COMPAT_VERSION = 2;
31 vector<pg_t> scrub_pgs;
35 MOSDScrub() : Message(MSG_OSD_SCRUB, HEAD_VERSION, COMPAT_VERSION) {}
36 MOSDScrub(const uuid_d& f, bool r, bool d) :
37 Message(MSG_OSD_SCRUB, HEAD_VERSION, COMPAT_VERSION),
38 fsid(f), repair(r), deep(d) {}
39 MOSDScrub(const uuid_d& f, vector<pg_t>& pgs, bool r, bool d) :
40 Message(MSG_OSD_SCRUB, HEAD_VERSION, COMPAT_VERSION),
41 fsid(f), scrub_pgs(pgs), repair(r), deep(d) {}
43 ~MOSDScrub() override {}
46 const char *get_type_name() const override { return "scrub"; }
47 void print(ostream& out) const override {
49 if (scrub_pgs.empty())
60 void encode_payload(uint64_t features) override {
61 ::encode(fsid, payload);
62 ::encode(scrub_pgs, payload);
63 ::encode(repair, payload);
64 ::encode(deep, payload);
66 void decode_payload() override {
67 bufferlist::iterator p = payload.begin();
69 ::decode(scrub_pgs, p);