1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
4 #ifndef MOSDRECOVERYDELETEREPLY_H
5 #define MOSDRECOVERYDELETEREPLY_H
7 #include "MOSDFastDispatchOp.h"
8 #include "include/ceph_features.h"
10 struct MOSDPGRecoveryDeleteReply
: public MOSDFastDispatchOp
{
11 static const int HEAD_VERSION
= 2;
12 static const int COMPAT_VERSION
= 1;
16 epoch_t map_epoch
, min_epoch
;
17 list
<pair
<hobject_t
, eversion_t
> > objects
;
19 epoch_t
get_map_epoch() const override
{
22 epoch_t
get_min_epoch() const override
{
25 spg_t
get_spg() const override
{
29 MOSDPGRecoveryDeleteReply()
30 : MOSDFastDispatchOp(MSG_OSD_PG_RECOVERY_DELETE_REPLY
, HEAD_VERSION
, COMPAT_VERSION
),
31 map_epoch(0), min_epoch(0)
34 void decode_payload() override
{
35 bufferlist::iterator p
= payload
.begin();
36 ::decode(pgid
.pgid
, p
);
37 ::decode(map_epoch
, p
);
38 if (header
.version
== 1 &&
39 !HAVE_FEATURE(get_connection()->get_features(), SERVER_LUMINOUS
)) {
40 min_epoch
= map_epoch
;
42 ::decode(min_epoch
, p
);
45 ::decode(pgid
.shard
, p
);
49 void encode_payload(uint64_t features
) override
{
50 ::encode(pgid
.pgid
, payload
);
51 ::encode(map_epoch
, payload
);
52 if (HAVE_FEATURE(features
, SERVER_LUMINOUS
)) {
53 ::encode(min_epoch
, payload
);
55 ::encode(objects
, payload
);
56 ::encode(pgid
.shard
, payload
);
57 ::encode(from
, payload
);
60 void print(ostream
& out
) const override
{
61 out
<< "MOSDPGRecoveryDeleteReply(" << pgid
62 << " e" << map_epoch
<< "," << min_epoch
<< " " << objects
<< ")";
65 const char *get_type_name() const override
{ return "recovery_delete_reply"; }