Whamcloud - gitweb
b=5881
[fs/lustre-release.git] / lustre / smfs / smfs_api.h
index 379af98..2f3aea3 100644 (file)
@@ -8,8 +8,10 @@
 #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;
@@ -36,32 +38,27 @@ struct smfs_plugin {
 #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;
@@ -69,43 +66,38 @@ struct hook_readdir_msg {
 };
 
 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)
@@ -123,7 +115,7 @@ do {                                                             \
                                                                  \
         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)
@@ -136,7 +128,3 @@ int smfs_init_kml(struct super_block *);
 int smfs_init_lru(struct super_block *);
 int smfs_init_cow(struct super_block *);
 
-
-
-
-