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_MEXPORTDIRDISCOVERACK_H
16 #define CEPH_MEXPORTDIRDISCOVERACK_H
18 #include "msg/Message.h"
19 #include "include/types.h"
21 class MExportDirDiscoverAck
: public SafeMessage
{
23 static const int HEAD_VERSION
= 1;
24 static const int COMPAT_VERSION
= 1;
30 inodeno_t
get_ino() const { return dirfrag
.ino
; }
31 dirfrag_t
get_dirfrag() const { return dirfrag
; }
32 bool is_success() const { return success
; }
35 MExportDirDiscoverAck() : SafeMessage
{MSG_MDS_EXPORTDIRDISCOVERACK
, HEAD_VERSION
, COMPAT_VERSION
} {}
36 MExportDirDiscoverAck(dirfrag_t df
, uint64_t tid
, bool s
=true) :
37 SafeMessage
{MSG_MDS_EXPORTDIRDISCOVERACK
, HEAD_VERSION
, COMPAT_VERSION
},
38 dirfrag(df
), success(s
) {
41 ~MExportDirDiscoverAck() override
{}
44 std::string_view
get_type_name() const override
{ return "ExDisA"; }
45 void print(ostream
& o
) const override
{
46 o
<< "export_discover_ack(" << dirfrag
;
53 void decode_payload() override
{
54 auto p
= payload
.cbegin();
58 void encode_payload(uint64_t features
) override
{
60 encode(dirfrag
, payload
);
61 encode(success
, payload
);
64 template<class T
, typename
... Args
>
65 friend boost::intrusive_ptr
<T
> ceph::make_message(Args
&&... args
);