]>
git.proxmox.com Git - ceph.git/blob - ceph/src/messages/MExportDirNotify.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_MEXPORTDIRNOTIFY_H
16 #define CEPH_MEXPORTDIRNOTIFY_H
18 #include "messages/MMDSOp.h"
20 class MExportDirNotify final
: public MMDSOp
{
22 static constexpr int HEAD_VERSION
= 1;
23 static constexpr int COMPAT_VERSION
= 1;
27 std::pair
<__s32
,__s32
> old_auth
, new_auth
;
28 std::list
<dirfrag_t
> bounds
; // bounds; these dirs are _not_ included (tho the dirfragdes are)
31 dirfrag_t
get_dirfrag() const { return base
; }
32 std::pair
<__s32
,__s32
> get_old_auth() const { return old_auth
; }
33 std::pair
<__s32
,__s32
> get_new_auth() const { return new_auth
; }
34 bool wants_ack() const { return ack
; }
35 const std::list
<dirfrag_t
>& get_bounds() const { return bounds
; }
36 std::list
<dirfrag_t
>& get_bounds() { return bounds
; }
40 MMDSOp
{MSG_MDS_EXPORTDIRNOTIFY
, HEAD_VERSION
, COMPAT_VERSION
} {}
41 MExportDirNotify(dirfrag_t i
, uint64_t tid
, bool a
, std::pair
<__s32
,__s32
> oa
,
42 std::pair
<__s32
,__s32
> na
) :
43 MMDSOp
{MSG_MDS_EXPORTDIRNOTIFY
, HEAD_VERSION
, COMPAT_VERSION
},
44 base(i
), ack(a
), old_auth(oa
), new_auth(na
) {
47 ~MExportDirNotify() final
{}
50 std::string_view
get_type_name() const override
{ return "ExNot"; }
51 void print(std::ostream
& o
) const override
{
52 o
<< "export_notify(" << base
;
53 o
<< " " << old_auth
<< " -> " << new_auth
;
60 void copy_bounds(std::list
<dirfrag_t
>& ex
) {
63 void copy_bounds(std::set
<dirfrag_t
>& ex
) {
64 for (auto i
= ex
.begin(); i
!= ex
.end(); ++i
)
68 void encode_payload(uint64_t features
) override
{
70 encode(base
, payload
);
72 encode(old_auth
, payload
);
73 encode(new_auth
, payload
);
74 encode(bounds
, payload
);
76 void decode_payload() override
{
78 auto p
= payload
.cbegin();
86 template<class T
, typename
... Args
>
87 friend boost::intrusive_ptr
<T
> ceph::make_message(Args
&&... args
);
88 template<class T
, typename
... Args
>
89 friend MURef
<T
> crimson::make_message(Args
&&... args
);