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_MEXPORTDIRDISCOVER_H
16 #define CEPH_MEXPORTDIRDISCOVER_H
18 #include "msg/Message.h"
19 #include "include/types.h"
21 class MExportDirDiscover
: public SafeMessage
{
23 static const int HEAD_VERSION
= 1;
24 static const int COMPAT_VERSION
= 1;
30 mds_rank_t
get_source_mds() const { return from
; }
31 inodeno_t
get_ino() const { return dirfrag
.ino
; }
32 dirfrag_t
get_dirfrag() const { return dirfrag
; }
33 const filepath
& get_path() const { return path
; }
38 MExportDirDiscover() :
39 SafeMessage
{MSG_MDS_EXPORTDIRDISCOVER
, HEAD_VERSION
, COMPAT_VERSION
},
41 MExportDirDiscover(dirfrag_t df
, filepath
& p
, mds_rank_t f
, uint64_t tid
) :
42 SafeMessage
{MSG_MDS_EXPORTDIRDISCOVER
, HEAD_VERSION
, COMPAT_VERSION
},
43 from(f
), dirfrag(df
), path(p
), started(false) {
46 ~MExportDirDiscover() override
{}
49 std::string_view
get_type_name() const override
{ return "ExDis"; }
50 void print(ostream
& o
) const override
{
51 o
<< "export_discover(" << dirfrag
<< " " << path
<< ")";
54 void decode_payload() override
{
55 auto p
= payload
.cbegin();
61 void encode_payload(uint64_t features
) override
{
63 encode(from
, payload
);
64 encode(dirfrag
, payload
);
65 encode(path
, payload
);
68 template<class T
, typename
... Args
>
69 friend boost::intrusive_ptr
<T
> ceph::make_message(Args
&&... args
);