4 #define OBD_SNAP_MAGIC 0xfffffff3 /* an unlikely block number */
6 /* maximum number of snapshot tables we maintain in the kernel */
7 #define SNAP_MAX_TABLES 8
10 /* maximum number of snapshots per device
11 must fit in "u" area of struct inode */
12 #define SNAP_MAX (EXT2_N_BLOCKS-1)
15 /* ioctls for manipulating snapshots 40 - 60 */
16 #define OBD_SNAP_SETTABLE _IOWR('f', 40, long)
17 #define OBD_SNAP_PRINTTABLE _IOWR('f', 41, long)
18 #define OBD_SNAP_DELETE _IOWR('f', 42, long)
19 #define OBD_SNAP_RESTORE _IOWR('f', 43, long)
23 /* if time is 0 this designates the "current" snapshot, i.e.
31 /* snap ioctl data for attach: current always in first slot of this array */
32 struct snap_obd_data {
33 int snap_dev; /* which device contains the data */
34 unsigned int snap_index;/* which snapshot is ours */
35 unsigned int snap_table;/* which table do we use */
39 /* snap ioctl data for table fiddling */
40 struct snap_table_data {
41 int tblcmd_no; /* which table */
42 unsigned int tblcmd_count; /* how many snaps */
43 struct snap tblcmd_snaps[SNAP_MAX]; /* sorted times! */
49 unsigned int tbl_count; /* how many snapshots exist in this table*/
50 int tbl_used; /* bitmap of snaps in use by a device */
51 time_t tbl_times[SNAP_MAX];
52 int tbl_index[SNAP_MAX];
56 /* this is the obd device descriptor:
57 - current snapshot ends up in first slot of this array
60 unsigned int snap_index; /* which snapshot index are we accessing */
65 /* stored as inline data in the objects */
66 struct snap_object_data {
68 /* id of snaps of object; slot 0 has the current data */
69 unsigned long od_ids[SNAP_MAX];
72 void snap_use(int table_no, int snap_index) ;
73 void snap_unuse(int table_no, int snap_index) ;
74 int snap_is_used(int table_no, int snap_index) ;
75 int snap_table_attach(int tableno, int snap_index);