Whamcloud - gitweb
74890c560d7bd66aadfd3b3040b6157d36303d7a
[fs/lustre-release.git] / lustre / include / linux / obd_snap.h
1 #ifndef _OBD_SNAP
2 #define _OBD_SNAP
3
4 #define OBD_SNAP_MAGIC 0xfffffff3   /* an unlikely block number */
5
6 #ifndef OBD_SNAP_DEVICENAME
7 #define OBD_SNAP_DEVICENAME "obdsnap"
8 #endif
9
10 /* ioctls for manipulating snapshots 40 - 60 */
11 #define OBD_SNAP_SETTABLE       _IOWR('f', 40, long)
12 #define OBD_SNAP_PRINTTABLE     _IOWR('f', 41, long)
13 #define OBD_SNAP_DELETE _IOWR('f', 42, long)
14 #define OBD_SNAP_RESTORE        _IOWR('f', 43, long)
15
16 /* this is the obd device descriptor: 
17  * - current snapshot ends up in first slot of this array
18  */
19 struct snap_obd {
20         unsigned int snap_index;  /* which snapshot index are we accessing */
21         int snap_tableno;
22 };
23
24 void snap_use(int table_no, int snap_index) ;
25 void snap_unuse(int table_no, int snap_index) ;
26 int snap_is_used(int table_no, int snap_index) ;
27 int snap_table_attach(int tableno, int snap_index);
28
29 #endif