Whamcloud - gitweb
update snapfs 1)add mntget and mntput for snap_current when mount snap_clone 2)get...
[fs/lustre-release.git] / lustre / snapfs / snapfs_internal.h
index 93583f9..6ce3e3e 100644 (file)
@@ -47,7 +47,11 @@ struct ioc_snap_tbl_data {
        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
 */
@@ -249,6 +253,8 @@ extern int currentfs_is_under_dotsnap(struct dentry *de);
 /* cache.c */
 inline void snap_free_cache(struct snap_cache *cache);
 struct snap_cache *snap_find_cache(kdev_t dev);
+typedef int (*snap_cache_cb_t)(struct snap_cache*, void *in, unsigned long *out);
+int snap_cache_process(snap_cache_cb_t cb, void* in, unsigned long* out);
 
 /* snaptable.c */
 extern struct snap_table snap_tables[SNAP_MAX_TABLES];
@@ -272,13 +278,15 @@ int snap_migrate_data(struct inode *dst, struct inode *src);
 int snap_set_indirect(struct inode *pri, ino_t ind_ino, 
                        int index, ino_t parent_ino);
 
+/*super.c */
+void put_snap_current_mnt(struct super_block *sb);
+void get_snap_current_mnt(struct super_block *sb);
 /* inode.c */
 extern struct super_operations currentfs_super_ops;
 void cleanup_filter_info_cache(void);
 int init_filter_info_cache(void);
-void init_filter_data(struct inode *inode, struct snapshot_operations *snapops,
-                    int flag);
-
+extern void init_filter_data(struct inode *inode, int flag);
+extern void set_filter_ops(struct snap_cache *cache, struct inode *inode);
 /* dir.c */
 extern struct inode_operations currentfs_dir_iops;
 extern struct file_operations currentfs_dir_fops;
@@ -294,7 +302,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
@@ -319,7 +330,6 @@ struct filter_fs {
 #define FILTER_FS_EXT3 1
 #define FILTER_FS_REISER 2
 extern struct filter_fs filter_oppar[FILTER_FS_TYPES];
-
 struct filter_fs *filter_get_filter_fs(const char *cache_type);
 inline struct super_operations *filter_c2usops(struct filter_fs *cache);
 inline struct inode_operations *filter_c2ufiops(struct filter_fs *cache);
@@ -329,12 +339,16 @@ inline struct super_operations *filter_c2csops(struct filter_fs *cache);
 inline struct inode_operations *filter_c2cfiops(struct filter_fs *cache);
 inline struct inode_operations *filter_c2cdiops(struct filter_fs *cache);
 inline struct inode_operations *filter_c2csiops(struct filter_fs *cache);
+inline struct file_operations *filter_c2udfops(struct filter_fs *cache);
 inline struct file_operations *filter_c2cffops(struct filter_fs *cache);
 inline struct file_operations *filter_c2cdfops(struct filter_fs *cache);
 inline struct file_operations *filter_c2csfops(struct filter_fs *cache);
+inline struct file_operations *filter_c2uffops(struct filter_fs *cache);
+inline struct file_operations *filter_c2usfops(struct filter_fs *cache);
 inline struct dentry_operations *filter_c2cdops(struct filter_fs *cache);
 inline struct dentry_operations *filter_c2udops(struct filter_fs *cache);
 inline struct address_space_operations *filter_c2cfaops(struct filter_fs *cache);
+inline struct address_space_operations *filter_c2ufaops(struct filter_fs *cache);
 /* for snapfs */
 inline struct snapshot_operations *filter_c2csnapops(struct filter_fs *cache);
 
@@ -392,7 +406,7 @@ static inline void snapfs_cpy_attrs(struct inode *dst, struct inode *src)
        dst->i_gid = src->i_gid;
        dst->i_mode = src->i_mode;
 }
-#ifdef SNAP_DEBUG
+#if 0
 extern unsigned int snap_debug_failcode;
 #ifdef CONFIG_LOOP_DISCARD
 #define BLKDEV_FAIL(dev,fail) loop_discard_io(dev,fail)