Whamcloud - gitweb
Fix typo in patch.
[fs/lustre-release.git] / lustre / snapfs / snapfs_internal.h
index ce43dbf..d55698c 100644 (file)
@@ -1,7 +1,8 @@
 #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 */
@@ -23,7 +24,6 @@
 
 #define IOC_SNAP_MAX_NR                 51 
 
-
 struct snap {
        time_t          time;
        unsigned int    index;
@@ -32,14 +32,26 @@ struct snap {
        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
 */
@@ -47,6 +59,8 @@ struct snap_table_data {
 #define SNAP_PSDEV_MINOR 240
 #define SNAP_PSDEV_MAJOR 10
 
+#define SNAP_TABLE_OUTBUF_LEN  1020
+
 #ifdef __KERNEL__
 
 #if 0
@@ -67,7 +81,6 @@ typedef ino_t snap_id;
 //#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.
@@ -196,14 +209,6 @@ struct snap_obd_data {
        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 {
@@ -213,6 +218,15 @@ 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;
@@ -284,7 +298,10 @@ extern struct file_operations currentfs_sym_fops;
 
 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