]>
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 MessageInstance
<MOSDBackoff
, MOSDFastDispatchOp
> {
26 static constexpr int HEAD_VERSION
= 1;
27 static constexpr int COMPAT_VERSION
= 1;
30 epoch_t map_epoch
= 0;
31 uint8_t op
= 0; ///< CEPH_OSD_BACKOFF_OP_*
32 uint64_t id
= 0; ///< unique id within this session
33 hobject_t begin
, end
; ///< [) range to block, unless ==, block single obj
35 spg_t
get_spg() const override
{
38 epoch_t
get_map_epoch() const override
{
43 : MessageInstance(CEPH_MSG_OSD_BACKOFF
, HEAD_VERSION
, COMPAT_VERSION
) {}
44 MOSDBackoff(spg_t pgid_
, epoch_t ep
, uint8_t op_
, uint64_t id_
,
45 hobject_t begin_
, hobject_t end_
)
46 : MessageInstance(CEPH_MSG_OSD_BACKOFF
, HEAD_VERSION
, COMPAT_VERSION
),
54 void encode_payload(uint64_t features
) override
{
56 encode(pgid
, payload
);
57 encode(map_epoch
, payload
);
60 encode(begin
, payload
);
64 void decode_payload() override
{
65 auto p
= payload
.cbegin();
74 std::string_view
get_type_name() const override
{ return "osd_backoff"; }
76 void print(ostream
& out
) const override
{
77 out
<< "osd_backoff(" << pgid
<< " " << ceph_osd_backoff_op_name(op
)
79 << " [" << begin
<< "," << end
<< ")"
80 << " e" << map_epoch
<< ")";