]>
git.proxmox.com Git - ceph.git/blob - ceph/src/messages/MOSDBackoff.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 Red Hat
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_MOSDBACKOFF_H
17 #define CEPH_MOSDBACKOFF_H
19 #include "MOSDFastDispatchOp.h"
20 #include "osd/osd_types.h"
22 class MOSDBackoff
: public MOSDFastDispatchOp
{
24 static constexpr int HEAD_VERSION
= 1;
25 static constexpr int COMPAT_VERSION
= 1;
28 epoch_t map_epoch
= 0;
29 uint8_t op
= 0; ///< CEPH_OSD_BACKOFF_OP_*
30 uint64_t id
= 0; ///< unique id within this session
31 hobject_t begin
, end
; ///< [) range to block, unless ==, block single obj
33 spg_t
get_spg() const override
{
36 epoch_t
get_map_epoch() const override
{
41 : MOSDFastDispatchOp
{CEPH_MSG_OSD_BACKOFF
, HEAD_VERSION
, COMPAT_VERSION
} {}
42 MOSDBackoff(spg_t pgid_
, epoch_t ep
, uint8_t op_
, uint64_t id_
,
43 hobject_t begin_
, hobject_t end_
)
44 : MOSDFastDispatchOp
{CEPH_MSG_OSD_BACKOFF
, HEAD_VERSION
, COMPAT_VERSION
},
52 void encode_payload(uint64_t features
) override
{
54 encode(pgid
, payload
);
55 encode(map_epoch
, payload
);
58 encode(begin
, payload
);
62 void decode_payload() override
{
64 auto p
= payload
.cbegin();
73 std::string_view
get_type_name() const override
{ return "osd_backoff"; }
75 void print(std::ostream
& out
) const override
{
76 out
<< "osd_backoff(" << pgid
<< " " << ceph_osd_backoff_op_name(op
)
78 << " [" << begin
<< "," << end
<< ")"
79 << " e" << map_epoch
<< ")";
82 template<class T
, typename
... Args
>
83 friend boost::intrusive_ptr
<T
> ceph::make_message(Args
&&... args
);