1 /* SMFS plugin stuff */
2 #define SMFS_PLG_DUMMY 0
8 typedef int (*smfs_plg_hook)(int hook_code, void *arg, void * priv);
9 typedef int (*smfs_plg_func) (int help_code, void *arg, void * priv);
12 struct list_head plg_list;
15 smfs_plg_hook plg_pre_op;
16 smfs_plg_hook plg_post_op;
17 smfs_plg_func plg_helper;
25 #define HOOK_SYMLINK 5
30 #define HOOK_SETATTR 10
32 #define HOOK_READDIR 12
37 struct dentry * dentry;
41 struct hook_data_rename {
42 struct hook_data data;
43 struct inode * new_dir;
44 struct inode * new_dentry;
47 struct hook_data_readdir {
48 struct hook_data data;
54 struct hook_data_setattr {
55 struct hook_data data;
60 #define SMFS_PRE_HOOK (op, data) \
62 struct list_head *hlist = &smfs_plg_list; \
63 struct smfs_plugin *plugin; \
65 list_for_each_entry(plugin, hlist, plg_list) { \
66 if (plugin->plg_pre_op) \
67 plugin->plg_pre_op(op, data, \
72 #define SMFS_POST_HOOK (op, data, rc) \
74 struct list_head *hlist = &smfs_plg_list; \
75 struct smfs_plugin *plugin; \
77 list_for_each_entry(plugin, hlist, plg_list) { \
78 if (plugin->plg_post_op) \
79 plugin->plg_post_op(op, data, \
85 #define PLG_TRANS_SIZE 1
86 #define PLG_TEST_INODE 2
87 #define PLG_SET_INODE 3
88 #define PLG_HELPER_MAX 4
90 #define SMFS_PLG_HELP (op, data) \
92 struct list_head *hlist = &smfs_plg_list; \
93 struct smfs_plugin *plugin; \
95 list_for_each_entry(plugin, hlist, plg_list) { \
96 if (plugin->plg_helper) \
97 plugin->plg_helper(op, data, \
102 int smfs_register_plugin(struct smfs_plugin *);
103 void * smfs_deregister_plugin(int);