]>
git.proxmox.com Git - ceph.git/blob - ceph/src/mds/events/EExport.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_EEXPORT_H
16 #define CEPH_EEXPORT_H
18 #include "common/config.h"
19 #include "include/types.h"
21 #include "../MDSRank.h"
23 #include "EMetaBlob.h"
24 #include "../LogEvent.h"
26 class EExport
: public LogEvent
{
28 EMetaBlob metablob
; // exported dir
31 set
<dirfrag_t
> bounds
;
36 LogEvent(EVENT_EXPORT
), target(MDS_RANK_NONE
) { }
37 EExport(MDLog
*mdlog
, CDir
*dir
, mds_rank_t t
) :
38 LogEvent(EVENT_EXPORT
),
39 base(dir
->dirfrag()), target(t
) { }
41 set
<dirfrag_t
> &get_bounds() { return bounds
; }
43 void print(ostream
& out
) const override
{
44 out
<< "EExport " << base
<< " to mds." << target
<< " " << metablob
;
47 EMetaBlob
*get_metablob() override
{ return &metablob
; }
49 void encode(bufferlist
& bl
, uint64_t features
) const override
;
50 void decode(bufferlist::const_iterator
&bl
) override
;
51 void dump(Formatter
*f
) const override
;
52 static void generate_test_instances(std::list
<EExport
*>& ls
);
53 void replay(MDSRank
*mds
) override
;
56 WRITE_CLASS_ENCODER_FEATURES(EExport
)