]>
git.proxmox.com Git - ceph.git/blob - ceph/src/messages/MPoolOpReply.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_MPOOLOPREPLY_H
16 #define CEPH_MPOOLOPREPLY_H
18 #include "common/errno.h"
20 class MPoolOpReply
: public PaxosServiceMessage
{
25 ceph::buffer::list response_data
;
27 MPoolOpReply() : PaxosServiceMessage
{CEPH_MSG_POOLOP_REPLY
, 0}
29 MPoolOpReply( uuid_d
& f
, ceph_tid_t t
, int rc
, int e
, version_t v
) :
30 PaxosServiceMessage
{CEPH_MSG_POOLOP_REPLY
, v
},
36 MPoolOpReply(uuid_d
& f
, ceph_tid_t t
, int rc
, int e
, version_t v
,
37 ceph::buffer::list
*blp
) :
38 PaxosServiceMessage
{CEPH_MSG_POOLOP_REPLY
, v
},
44 response_data
= std::move(*blp
);
47 std::string_view
get_type_name() const override
{ return "poolopreply"; }
49 void print(std::ostream
& out
) const override
{
50 out
<< "pool_op_reply(tid " << get_tid()
51 << " " << cpp_strerror(-replyCode
)
52 << " v" << version
<< ")";
55 void encode_payload(uint64_t features
) override
{
58 encode(fsid
, payload
);
59 encode(replyCode
, payload
);
60 encode(epoch
, payload
);
61 if (response_data
.length()) {
62 encode(true, payload
);
63 encode(response_data
, payload
);
65 encode(false, payload
);
67 void decode_payload() override
{
69 auto p
= payload
.cbegin();
74 bool has_response_data
;
75 decode(has_response_data
, p
);
76 if (has_response_data
) {
77 decode(response_data
, p
);
81 template<class T
, typename
... Args
>
82 friend boost::intrusive_ptr
<T
> ceph::make_message(Args
&&... args
);