#define SMFS_IS_PLG(flags, mask) (flags & mask)
#define SMFS_CLEAR_PLG(flags, mask) (flags &= ~mask)
-typedef int (*smfs_plg_hook)(int hook_code, void *arg, int, void * priv);
-typedef int (*smfs_plg_func)(int help_code, void *arg, void * priv);
+typedef int (*smfs_plg_hook)(int hook_code, struct inode *,
+ void *arg, int rc, void * priv);
+typedef int (*smfs_plg_func)(int help_code, struct super_block *,
+ void *arg, void * priv);
struct smfs_plugin {
struct list_head plg_list;
#define HOOK_MAX 13
struct hook_msg {
- struct inode * dir;
struct dentry * dentry;
};
struct hook_unlink_msg {
- struct inode * dir;
struct dentry * dentry;
int mode;
};
struct hook_symlink_msg {
- struct inode * dir;
struct dentry * dentry;
int tgt_len;
char * symname;
};
struct hook_rename_msg {
- struct inode * dir;
struct dentry * dentry;
struct inode * new_dir;
struct dentry * new_dentry;
};
struct hook_readdir_msg {
- struct inode * dir;
struct dentry * dentry;
struct file * filp;
void * dirent;
};
struct hook_write_msg {
- struct inode * inode;
struct dentry * dentry;
size_t count;
loff_t pos;
};
struct hook_setattr_msg {
- struct inode * inode;
struct dentry * dentry;
struct iattr *attr;
};
-#define SMFS_HOOK(sb, op, msg, a,b,c,d,e,f) \
-do { \
-} while(0)
-#define SMFS_PRE_HOOK(sb, op, msg) \
+#define SMFS_PRE_HOOK(inode, op, msg) \
do { \
- struct smfs_super_info *smb = S2SMI(sb); \
+ struct smfs_super_info *smb = S2SMI(inode->i_sb); \
struct list_head *hlist = &smb->smsi_plg_list; \
struct smfs_plugin *plg; \
\
list_for_each_entry(plg, hlist, plg_list) { \
if (plg->plg_pre_op) \
- plg->plg_pre_op(op, msg, 0, \
+ plg->plg_pre_op(op, inode, msg, 0, \
plg->plg_private); \
} \
} while(0)
-#define SMFS_POST_HOOK(sb, op, msg, rc) \
+#define SMFS_POST_HOOK(inode, op, msg, rc) \
do { \
- struct smfs_super_info *smb = S2SMI(sb); \
+ struct smfs_super_info *smb = S2SMI(inode->i_sb); \
struct list_head *hlist = &smb->smsi_plg_list; \
struct smfs_plugin *plg; \
\
list_for_each_entry(plg, hlist, plg_list) { \
if (plg->plg_post_op) \
- plg->plg_post_op(op, msg, rc, \
+ plg->plg_post_op(op, inode, msg, rc, \
plg->plg_private); \
} \
} while(0)
\
list_for_each_entry_safe(plugin, tmp, hlist, plg_list) { \
if (plugin->plg_helper) \
- plugin->plg_helper(op, data, \
+ plugin->plg_helper(op, sb, data, \
plugin->plg_private); \
} \
} while(0)
int smfs_init_lru(struct super_block *);
int smfs_init_cow(struct super_block *);
-
-
-
-