]>
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 "msg/Message.h"
20 class MExportDirNotify
: public SafeMessage
{
22 static const int HEAD_VERSION
= 1;
23 static const int COMPAT_VERSION
= 1;
27 pair
<__s32
,__s32
> old_auth
, new_auth
;
28 list
<dirfrag_t
> bounds
; // bounds; these dirs are _not_ included (tho the dirfragdes are)
31 dirfrag_t
get_dirfrag() const { return base
; }
32 pair
<__s32
,__s32
> get_old_auth() const { return old_auth
; }
33 pair
<__s32
,__s32
> get_new_auth() const { return new_auth
; }
34 bool wants_ack() const { return ack
; }
35 const list
<dirfrag_t
>& get_bounds() const { return bounds
; }
36 list
<dirfrag_t
>& get_bounds() { return bounds
; }
40 SafeMessage
{MSG_MDS_EXPORTDIRNOTIFY
, HEAD_VERSION
, COMPAT_VERSION
} {}
41 MExportDirNotify(dirfrag_t i
, uint64_t tid
, bool a
, pair
<__s32
,__s32
> oa
, pair
<__s32
,__s32
> na
) :
42 SafeMessage
{MSG_MDS_EXPORTDIRNOTIFY
, HEAD_VERSION
, COMPAT_VERSION
},
43 base(i
), ack(a
), old_auth(oa
), new_auth(na
) {
46 ~MExportDirNotify() override
{}
49 std::string_view
get_type_name() const override
{ return "ExNot"; }
50 void print(ostream
& o
) const override
{
51 o
<< "export_notify(" << base
;
52 o
<< " " << old_auth
<< " -> " << new_auth
;
59 void copy_bounds(list
<dirfrag_t
>& ex
) {
62 void copy_bounds(set
<dirfrag_t
>& ex
) {
63 for (set
<dirfrag_t
>::iterator i
= ex
.begin();
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
{
77 auto p
= payload
.cbegin();
85 template<class T
, typename
... Args
>
86 friend boost::intrusive_ptr
<T
> ceph::make_message(Args
&&... args
);