#ifndef __LINUX_SNAPFS_H
#define __LINUX_SNAPFS_H
/* maximum number of snapshot tables we maintain in the kernel */
-#define SNAP_MAX_TABLES 32
+#define SNAP_MAX 32
+#define SNAP_MAX_TABLES 32
#define SNAP_MAX_NAMELEN 64
/* ioctls for manipulating snapshots 40 - 60 */
#define IOC_SNAP_MAX_NR 51
-
struct snap {
time_t time;
unsigned int index;
char name[SNAP_MAX_NAMELEN];
};
+
+/*FIXME, use ioc_data temporary, will use obd_ioc_data later*/
+struct ioc_data {
+ unsigned int ioc_inlen;
+ char *ioc_inbuf;
+ char ioc_bulk[0];
+};
+
/* snap ioctl data for table fiddling */
-struct snap_table_data {
- int tblcmd_no; /* which table */
+struct ioc_snap_tbl_data {
+ int no; /* which table */
unsigned long dev;
- unsigned int tblcmd_count; /* how many snaps */
- struct snap tblcmd_snaps[0]; /* sorted times! */
+ unsigned int count; /* how many snaps */
+ struct snap snaps[0]; /* sorted times! */
+};
+struct option {
+ char *opt;
+ char *value;
+ struct list_head list;
};
-
/* we have just a single snapshot control device
it contains a list of all the snap_current info's
*/
#define SNAP_PSDEV_MINOR 240
#define SNAP_PSDEV_MAJOR 10
+#define SNAP_TABLE_OUTBUF_LEN 1020
+
#ifdef __KERNEL__
#if 0
//#define OBD_OBDMDSZ 54
//#define SNAP_MAX ((OBD_OBDMDSZ - sizeof(uint32_t))/sizeof(snap_id))
-#define SNAP_MAX 50
/* if time is 0 this designates the "current" snapshot, i.e.
unsigned int snap_index;/* which snapshot is ours */
unsigned int snap_table;/* which table do we use */
};
-
-struct snap_table {
- struct semaphore tbl_sema;
- spinlock_t tbl_lock;
- unsigned int tbl_count; /* how many snapshots exist in this table*/
- unsigned int generation;
- struct snap snap_items[SNAP_MAX];
-};
#define DISK_SNAPTABLE_ATTR "Snaptable"
#define DISK_SNAP_TABLE_MAGIC 0x1976
struct snap_disk_table {
struct snap_disk snap_items[SNAP_MAX];
};
+/*Snap Table*/
+struct snap_table {
+ struct semaphore tbl_sema;
+ spinlock_t tbl_lock;
+ unsigned int tbl_count; /* how many snapshots exist in this table*/
+ unsigned int generation;
+ struct snap snap_items[SNAP_MAX];
+};
+
struct snap_iterdata {
kdev_t dev; /* snap current device number */
int index;
extern struct dentry_operations currentfs_dentry_ops;
-
+/* options.c */
+extern int init_option(char *data);
+extern void cleanup_option(void);
+extern int get_opt(struct option **opt, char **pos);
#define FILTER_DID_SUPER_OPS 0x1
#define FILTER_DID_INODE_OPS 0x2