]>
git.proxmox.com Git - ceph.git/blob - ceph/src/messages/MDentryLink.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_MDENTRYLINK_H
17 #define CEPH_MDENTRYLINK_H
19 #include <string_view>
21 #include "msg/Message.h"
23 class MDentryLink
: public SafeMessage
{
25 static const int HEAD_VERSION
= 1;
26 static const int COMPAT_VERSION
= 1;
31 bool is_primary
= false;
34 dirfrag_t
get_subtree() const { return subtree
; }
35 dirfrag_t
get_dirfrag() const { return dirfrag
; }
36 const string
& get_dn() const { return dn
; }
37 bool get_is_primary() const { return is_primary
; }
43 SafeMessage(MSG_MDS_DENTRYLINK
, HEAD_VERSION
, COMPAT_VERSION
) { }
44 MDentryLink(dirfrag_t r
, dirfrag_t df
, std::string_view n
, bool p
) :
45 SafeMessage(MSG_MDS_DENTRYLINK
, HEAD_VERSION
, COMPAT_VERSION
),
50 ~MDentryLink() override
{}
53 std::string_view
get_type_name() const override
{ return "dentry_link";}
54 void print(ostream
& o
) const override
{
55 o
<< "dentry_link(" << dirfrag
<< " " << dn
<< ")";
58 void decode_payload() override
{
59 auto p
= payload
.cbegin();
63 decode(is_primary
, p
);
66 void encode_payload(uint64_t features
) override
{
68 encode(subtree
, payload
);
69 encode(dirfrag
, payload
);
71 encode(is_primary
, payload
);
75 template<class T
, typename
... Args
>
76 friend boost::intrusive_ptr
<T
> ceph::make_message(Args
&&... args
);