]>
git.proxmox.com Git - ceph.git/blob - ceph/src/messages/MOSDPGTrim.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) 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.
15 #ifndef CEPH_MOSDPGTRIM_H
16 #define CEPH_MOSDPGTRIM_H
18 #include "msg/Message.h"
19 #include "messages/MOSDPeeringOp.h"
21 class MOSDPGTrim
: public MessageInstance
<MOSDPGTrim
, MOSDPeeringOp
> {
25 static constexpr int HEAD_VERSION
= 2;
26 static constexpr int COMPAT_VERSION
= 2;
33 epoch_t
get_epoch() const { return epoch
; }
34 spg_t
get_spg() const {
37 epoch_t
get_map_epoch() const {
40 epoch_t
get_min_epoch() const {
43 PGPeeringEvent
*get_event() override
{
44 return new PGPeeringEvent(
47 MTrim(epoch
, get_source().num(), pgid
.shard
, trim_to
));
50 MOSDPGTrim() : MessageInstance(MSG_OSD_PG_TRIM
, HEAD_VERSION
, COMPAT_VERSION
) {}
51 MOSDPGTrim(version_t mv
, spg_t p
, eversion_t tt
) :
52 MessageInstance(MSG_OSD_PG_TRIM
, HEAD_VERSION
, COMPAT_VERSION
),
53 epoch(mv
), pgid(p
), trim_to(tt
) { }
55 ~MOSDPGTrim() override
{}
58 std::string_view
get_type_name() const override
{ return "pg_trim"; }
59 void inner_print(ostream
& out
) const override
{
63 void encode_payload(uint64_t features
) override
{
65 encode(epoch
, payload
);
66 encode(pgid
.pgid
, payload
);
67 encode(trim_to
, payload
);
68 encode(pgid
.shard
, payload
);
70 void decode_payload() override
{
71 auto p
= payload
.cbegin();
75 decode(pgid
.shard
, p
);