]>
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 Message
{
23 pair
<__s32
,__s32
> old_auth
, new_auth
;
24 list
<dirfrag_t
> bounds
; // bounds; these dirs are _not_ included (tho the dirfragdes are)
27 dirfrag_t
get_dirfrag() { return base
; }
28 pair
<__s32
,__s32
> get_old_auth() { return old_auth
; }
29 pair
<__s32
,__s32
> get_new_auth() { return new_auth
; }
30 bool wants_ack() { return ack
; }
31 list
<dirfrag_t
>& get_bounds() { return bounds
; }
34 MExportDirNotify(dirfrag_t i
, uint64_t tid
, bool a
, pair
<__s32
,__s32
> oa
, pair
<__s32
,__s32
> na
) :
35 Message(MSG_MDS_EXPORTDIRNOTIFY
),
36 base(i
), ack(a
), old_auth(oa
), new_auth(na
) {
40 ~MExportDirNotify() override
{}
43 const char *get_type_name() const override
{ return "ExNot"; }
44 void print(ostream
& o
) const override
{
45 o
<< "export_notify(" << base
;
46 o
<< " " << old_auth
<< " -> " << new_auth
;
53 void copy_bounds(list
<dirfrag_t
>& ex
) {
56 void copy_bounds(set
<dirfrag_t
>& ex
) {
57 for (set
<dirfrag_t
>::iterator i
= ex
.begin();
62 void encode_payload(uint64_t features
) override
{
63 ::encode(base
, payload
);
64 ::encode(ack
, payload
);
65 ::encode(old_auth
, payload
);
66 ::encode(new_auth
, payload
);
67 ::encode(bounds
, payload
);
69 void decode_payload() override
{
70 bufferlist::iterator p
= payload
.begin();
73 ::decode(old_auth
, p
);
74 ::decode(new_auth
, p
);