1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2 * vim:expandtab:shiftwidth=8:tabstop=8:
13 * it is important that things like inode, super and file operations
14 * for intermezzo are not defined statically. If methods are NULL
15 * the VFS takes special action based on that. Given that different
16 * cache types have NULL ops at different slots, we must install opeation
17 * talbes for InterMezzo with NULL's in the same spot
21 struct super_operations filter_sops;
23 struct inode_operations filter_dir_iops;
24 struct inode_operations filter_file_iops;
25 struct inode_operations filter_sym_iops;
27 struct file_operations filter_dir_fops;
28 struct file_operations filter_file_fops;
29 struct file_operations filter_sym_fops;
31 struct dentry_operations filter_dentry_ops;
35 /* operations on the file store */
36 struct super_operations *cache_sops;
38 struct inode_operations *cache_dir_iops;
39 struct inode_operations *cache_file_iops;
40 struct inode_operations *cache_sym_iops;
42 struct file_operations *cache_dir_fops;
43 struct file_operations *cache_file_fops;
44 struct file_operations *cache_sym_fops;
46 struct dentry_operations *cache_dentry_ops;
50 #define FILTER_DID_SUPER_OPS 0x1
51 #define FILTER_DID_INODE_OPS 0x2
52 #define FILTER_DID_FILE_OPS 0x4
53 #define FILTER_DID_DENTRY_OPS 0x8
54 #define FILTER_DID_DEV_OPS 0x10
55 #define FILTER_DID_SYMLINK_OPS 0x20
56 #define FILTER_DID_DIR_OPS 0x40
60 struct filter_ops o_fops;
61 struct cache_ops o_caops;
62 struct journal_ops *o_trops;
63 struct snapshot_ops *o_snops;
66 #define FILTER_FS_TYPES 6
67 #define FILTER_FS_EXT2 0
68 #define FILTER_FS_EXT3 1
69 #define FILTER_FS_REISERFS 2
70 #define FILTER_FS_XFS 3
71 #define FILTER_FS_OBDFS 4
72 #define FILTER_FS_TMPFS 5
73 extern struct filter_fs filter_oppar[FILTER_FS_TYPES];
75 struct filter_fs *filter_get_filter_fs(const char *cache_type);
76 void filter_setup_journal_ops(struct filter_fs *ops, char *cache_type);
77 struct super_operations *filter_c2usops(struct filter_fs *cache);
78 struct inode_operations *filter_c2ufiops(struct filter_fs *cache);
79 struct inode_operations *filter_c2udiops(struct filter_fs *cache);
80 struct inode_operations *filter_c2usiops(struct filter_fs *cache);
81 struct file_operations *filter_c2uffops(struct filter_fs *cache);
82 struct file_operations *filter_c2udfops(struct filter_fs *cache);
83 struct file_operations *filter_c2usfops(struct filter_fs *cache);
84 struct super_operations *filter_c2csops(struct filter_fs *cache);
85 struct inode_operations *filter_c2cfiops(struct filter_fs *cache);
86 struct inode_operations *filter_c2cdiops(struct filter_fs *cache);
87 struct inode_operations *filter_c2csiops(struct filter_fs *cache);
88 struct file_operations *filter_c2cffops(struct filter_fs *cache);
89 struct file_operations *filter_c2cdfops(struct filter_fs *cache);
90 struct file_operations *filter_c2csfops(struct filter_fs *cache);
91 struct dentry_operations *filter_c2cdops(struct filter_fs *cache);
92 struct dentry_operations *filter_c2udops(struct filter_fs *cache);
94 void filter_setup_super_ops(struct filter_fs *cache, struct super_operations *cache_ops, struct super_operations *filter_sops);
95 void filter_setup_dir_ops(struct filter_fs *cache, struct inode *cache_inode, struct inode_operations *filter_iops, struct file_operations *ffops);
96 void filter_setup_file_ops(struct filter_fs *cache, struct inode *cache_inode, struct inode_operations *filter_iops, struct file_operations *filter_op);
97 void filter_setup_symlink_ops(struct filter_fs *cache, struct inode *cache_inode, struct inode_operations *filter_iops, struct file_operations *filter_op);
98 void filter_setup_dentry_ops(struct filter_fs *cache, struct dentry_operations *cache_dop, struct dentry_operations *filter_dop);
103 /* debugging masks */
105 #define D_INODE 2 /* print entry and exit into procedure */
107 #define D_CACHE 8 /* cache debugging */
108 #define D_MALLOC 16 /* print malloc, de-alloc information */
110 #define D_UPCALL 64 /* up and downcall debugging */
113 #define D_SPECIAL 512
114 #define D_TIMING 1024
115 #define D_DOWNCALL 2048
117 #define FDEBUG(mask, format, a...) \
119 if (filter_debug & mask) { \
120 printk("(%s,l. %d): ", __FUNCTION__, __LINE__); \
121 printk(format, ##a); } \
125 if(filter_print_entry) \
126 printk("Process %d entered %s\n", current->pid, __FUNCTION__)
129 if(filter_print_entry) \
130 printk("Process %d leaving %s at %d\n", current->pid, \
131 __FUNCTION__,__LINE__)