~mathiaz/+junk/ceph-new-pkg-review

2 by Mathias Gug
Import ceph_0.21-0ubuntu1 from https://launchpad.net/~clint-fewbar/+archive/ceph/+packages.
1
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- 
2
// vim: ts=8 sw=2 smarttab
3
/*
4
 * Ceph - scalable distributed file system
5
 *
6
 * Copyright (C) 2004-2006 Sage Weil <sage@newdream.net>
7
 *
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.
12
 * 
13
 */
14
15
#ifndef CEPH_EEXPORT_H
16
#define CEPH_EEXPORT_H
17
18
#include "config.h"
19
#include "include/types.h"
20
21
#include "../MDS.h"
22
23
#include "EMetaBlob.h"
24
25
class EExport : public LogEvent {
26
public:
27
  EMetaBlob metablob; // exported dir
28
protected:
29
  dirfrag_t      base;
30
  set<dirfrag_t> bounds;
31
  
32
public:
33
  EExport() : LogEvent(EVENT_EXPORT) { }
34
  EExport(MDLog *mdlog, CDir *dir) : 
35
    LogEvent(EVENT_EXPORT), metablob(mdlog),
36
    base(dir->dirfrag()) { }
37
  
38
  set<dirfrag_t> &get_bounds() { return bounds; }
39
  
40
  void print(ostream& out) {
41
    out << "EExport " << base << " " << metablob;
42
  }
43
44
  void encode(bufferlist& bl) const {
45
    __u8 struct_v = 1;
46
    ::encode(struct_v, bl);
47
    ::encode(metablob, bl);
48
    ::encode(base, bl);
49
    ::encode(bounds, bl);
50
  }
51
  void decode(bufferlist::iterator &bl) {
52
    __u8 struct_v;
53
    ::decode(struct_v, bl);
54
    ::decode(metablob, bl);
55
    ::decode(base, bl);
56
    ::decode(bounds, bl);
57
  }
58
  
59
  void replay(MDS *mds);
60
61
};
62
63
#endif