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_MDS_SNAP_H
16 #define CEPH_MDS_SNAP_H
19 #include "common/snap_types.h"
22 * generic snap descriptor.
30 string long_name
; ///< cached _$ino_$name
32 void encode(bufferlist
&bl
) const;
33 void decode(bufferlist::iterator
&bl
);
34 void dump(Formatter
*f
) const;
35 static void generate_test_instances(list
<SnapInfo
*>& ls
);
37 const string
& get_long_name();
39 WRITE_CLASS_ENCODER(SnapInfo
)
41 ostream
& operator<<(ostream
& out
, const SnapInfo
&sn
);
45 * SnapRealm - a subtree that shares the same set of snapshots.
53 #include "Capability.h"
59 void encode(bufferlist
&bl
) const;
60 void decode(bufferlist::iterator
&bl
);
61 void dump(Formatter
*f
) const;
62 static void generate_test_instances(list
<snaplink_t
*>& ls
);
64 WRITE_CLASS_ENCODER(snaplink_t
)
66 ostream
& operator<<(ostream
& out
, const snaplink_t
&l
);
69 // carry data about a specific version of a SnapRealm
71 snapid_t seq
; // basically, a version/seq # for changes to _this_ realm.
72 snapid_t created
; // when this realm was created.
73 snapid_t last_created
; // last snap created in _this_ realm.
74 snapid_t last_destroyed
; // seq for last removal
75 snapid_t current_parent_since
;
76 map
<snapid_t
, SnapInfo
> snaps
;
77 map
<snapid_t
, snaplink_t
> past_parents
; // key is "last" (or NOSNAP)
81 last_created(0), last_destroyed(0),
82 current_parent_since(1)
85 void encode(bufferlist
&bl
) const;
86 void decode(bufferlist::iterator
&bl
);
87 void dump(Formatter
*f
) const;
88 static void generate_test_instances(list
<sr_t
*>& ls
);
90 WRITE_CLASS_ENCODER(sr_t
)