]>
git.proxmox.com Git - ceph.git/blob - ceph/src/messages/MClientReclaim.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.
16 #ifndef CEPH_MCLIENTRECLAIM_H
17 #define CEPH_MCLIENTRECLAIM_H
19 #include "msg/Message.h"
21 class MClientReclaim final
: public SafeMessage
{
23 static constexpr int HEAD_VERSION
= 1;
24 static constexpr int COMPAT_VERSION
= 1;
25 static constexpr uint32_t FLAG_FINISH
= 1U << 31;
27 uint32_t get_flags() const { return flags
; }
28 std::string_view
get_uuid() const { return uuid
; }
30 std::string_view
get_type_name() const override
{ return "client_reclaim"; }
31 void print(std::ostream
& o
) const override
{
32 std::ios_base::fmtflags
f(o
.flags());
33 o
<< "client_reclaim(" << get_uuid() << " flags 0x" << std::hex
<< get_flags() << ")";
37 void encode_payload(uint64_t features
) override
{
39 encode(uuid
, payload
);
40 encode(flags
, payload
);
43 void decode_payload() override
{
45 auto p
= payload
.cbegin();
52 SafeMessage
{CEPH_MSG_CLIENT_RECLAIM
, HEAD_VERSION
, COMPAT_VERSION
} {}
53 MClientReclaim(std::string_view _uuid
, uint32_t _flags
) :
54 SafeMessage
{CEPH_MSG_CLIENT_RECLAIM
, HEAD_VERSION
, COMPAT_VERSION
},
55 uuid(_uuid
), flags(_flags
) {}
57 ~MClientReclaim() final
{}
62 template<class T
, typename
... Args
>
63 friend boost::intrusive_ptr
<T
> ceph::make_message(Args
&&... args
);
64 template<class T
, typename
... Args
>
65 friend MURef
<T
> crimson::make_message(Args
&&... args
);