4 #define OBD_SNAP_MAGIC 0x47224722
7 /* maximum number of snapshot tables we maintain in the kernel */
8 #define SNAP_MAX_TABLES 8
11 /* maximum number of snapshots per device
12 must fit in "u" area of struct inode */
16 /* ioctls for manipulating snapshots 40 - 50 */
17 #define OBD_SNAP_SETTABLE _IOWR('f', 40, long)
18 #define OBD_SNAP_PRINTTABLE _IOWR('f', 41, long)
22 /* if time is 0 this designates the "current" snapshot, i.e.
30 /* snap ioctl data for attach: current always in first slot of this array */
31 struct snap_obd_data {
32 int snap_dev; /* which device contains the data */
33 unsigned int snap_index;/* which snapshot is ours */
34 unsigned int snap_table;/* which table do we use */
38 /* snap ioctl data for table fiddling */
39 struct snap_table_data {
40 int tblcmd_no; /* which table */
41 unsigned int tblcmd_count; /* how many snaps */
42 struct snap tblcmd_snaps[SNAP_MAX]; /* sorted times! */
48 unsigned int tbl_count; /* how many snapshots exist in this table*/
49 int tbl_used; /* bitmap of snaps in use by a device */
50 time_t tbl_times[SNAP_MAX];
51 int tbl_index[SNAP_MAX];
55 /* this is the obd device descriptor:
56 - current snapshot ends up in first slot of this array
59 unsigned int snap_index; /* which snapshot index are we accessing */
64 /* stored as inline data in the objects */
65 struct snap_object_data {
67 /* id of snaps of object; slot 0 has the current data */
68 unsigned long od_ids[SNAP_MAX + 1];
71 #define this_snapidx(obd) (obd->u.snap.snap_index)
73 extern int snap_iocontrol(int cmd, int len, void *karg, void *uarg);
74 void snap_use(int table_no, int snap_index) ;
75 void snap_unuse(int table_no, int snap_index) ;
76 int snap_is_used(int table_no, int snap_index) ;
77 int snap_table_attach(int tableno, int snap_index);