Whamcloud - gitweb
Updated snapshot indexes in superblock to not depend on index "0" as being
[fs/lustre-release.git] / lustre / include / linux / obd_snap.h
1 #ifndef _OBD_SNAP
2 #define _OBD_SNAP
3
4 #define OBD_SNAP_MAGIC 0x47224722
5
6 #define SNAP_MAX  8 /* must fit in "u" area of struct inode */
7
8 /* if time is 0 this designates the "current" snapshot, i.e.
9    the head of the tree 
10 */
11
12 struct snap {
13         time_t time;
14         int index;
15 };
16
17 /* snap ioctl data for attach */
18 struct snap_obd_data {
19         int snap_dev;             /* which device contains the data */
20         unsigned int snap_no;     /* which snapshot are we accessing */
21         unsigned int snap_count;  /* how many snapshots exist */
22         struct snap snap_snaps[SNAP_MAX]; /* times must be incr or attach will fail */
23 };
24
25
26 /* this is the obd device descriptor */
27 struct snap_obd {
28         unsigned int snap_no;    /* which snapshot index are we accessing */
29         unsigned int snap_current;
30         unsigned int snap_count; /* how many snapshots exist */
31         time_t snap_times[SNAP_MAX];
32         int snap_index[SNAP_MAX];
33 };
34
35
36 /* stored as inline data in the objects */
37 struct snap_object_data {
38         int od_magic;
39         /* id of snaps of object; slot 0 has the current data */
40         unsigned long od_ids[SNAP_MAX + 1]; 
41 };
42
43
44
45 #endif