]>
git.proxmox.com Git - ceph.git/blob - ceph/src/messages/MOSDRepScrubMap.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) 2017 Sage Weil <sage@redhat.com>
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_MOSDREPSCRUBMAP_H
16 #define CEPH_MOSDREPSCRUBMAP_H
18 #include "MOSDFastDispatchOp.h"
21 * pass a ScrubMap from a shard back to the primary
24 class MOSDRepScrubMap
: public MOSDFastDispatchOp
{
26 static constexpr int HEAD_VERSION
= 2;
27 static constexpr int COMPAT_VERSION
= 1;
29 spg_t pgid
; // primary spg_t
30 epoch_t map_epoch
= 0;
31 pg_shard_t from
; // whose scrubmap this is
32 bufferlist scrub_map_bl
;
33 bool preempted
= false;
35 epoch_t
get_map_epoch() const override
{
38 spg_t
get_spg() const override
{
43 : MOSDFastDispatchOp
{MSG_OSD_REP_SCRUBMAP
, HEAD_VERSION
, COMPAT_VERSION
} {}
45 MOSDRepScrubMap(spg_t pgid
, epoch_t map_epoch
, pg_shard_t from
)
46 : MOSDFastDispatchOp
{MSG_OSD_REP_SCRUBMAP
, HEAD_VERSION
, COMPAT_VERSION
},
55 std::string_view
get_type_name() const override
{ return "rep_scrubmap"; }
56 void print(ostream
& out
) const override
{
57 out
<< "rep_scrubmap(" << pgid
<< " e" << map_epoch
58 << " from shard " << from
59 << (preempted
? " PREEMPTED":"") << ")";
62 void encode_payload(uint64_t features
) override
{
64 encode(pgid
, payload
);
65 encode(map_epoch
, payload
);
66 encode(from
, payload
);
67 encode(preempted
, payload
);
69 void decode_payload() override
{
70 auto p
= payload
.cbegin();
74 if (header
.version
>= 2) {
79 template<class T
, typename
... Args
>
80 friend boost::intrusive_ptr
<T
> ceph::make_message(Args
&&... args
);