Whamcloud - gitweb
b=5881
[fs/lustre-release.git] / lustre / smfs / smfs_internal.h
index ebca06e..f54d822 100644 (file)
@@ -24,7 +24,7 @@
 #ifndef __LINUX_SMFS_H
 #define __LINUX_SMFS_H
 
-//#include <linux/lustre_fsfilt.h>
+#include "smfs_api.h"
 #define SMFSDEV_NAME "/dev/smfsconf"
 #define SMFS_PSDEV_MINOR 250
 #define SMFS_PSDEV_MAJOR 10
@@ -69,10 +69,6 @@ do{                                                 \
 
 
 extern int init_smfs_proc_sys(void);
-/*options.c*/
-extern int get_opt(struct option **option, char **pos);
-extern void cleanup_option(void);
-extern int init_option(char *data);
 /*cache.c*/
 extern void sm_set_inode_ops(struct inode *cache_inode, struct inode *inode);
 extern void sm_set_sb_ops(struct super_block *cache_sb, struct super_block *sb);
@@ -81,10 +77,7 @@ extern void cleanup_smfs_cache(void);
 extern void sm_set_journal_ops(struct super_block *sb, char *cache_type);
 extern int smfs_init_sm_ops(struct smfs_super_info *smb);
 extern void smfs_cleanup_sm_ops(struct smfs_super_info *smb);
-static inline struct super_operations *cache_sops(struct smfs_super_info *smb)
-{
-        return &smb->sm_ops->sm_sb_ops;
-}
+
 static inline struct inode_operations *cache_diops(struct smfs_super_info *smb)
 {
         return &smb->sm_ops->sm_dir_iops;
@@ -278,57 +271,6 @@ static inline int get_active_entry(struct inode *dir, __u64 *active_entry)
                 rc = 0;
         RETURN(rc);
 }
-#define HOOK_CREATE       1
-#define HOOK_LOOKUP       2
-#define HOOK_LINK         3
-#define HOOK_UNLINK       4
-#define HOOK_SYMLINK      5
-#define HOOK_MKDIR        6
-#define HOOK_RMDIR        7
-#define HOOK_MKNOD        8
-#define HOOK_RENAME       9
-#define HOOK_SETATTR      10
-#define HOOK_WRITE        11 
-#define HOOK_READDIR      12
-#define HOOK_MAX          12 
-
-#define PRE_HOOK 0
-#define POST_HOOK 1
-#define SMFS_HOOK(inode, dentry, data1, data2, op, handle, flag, rc, label)    \
-do {                                                                           \
-        LASSERT(inode->i_sb);                                                  \
-        if (!rc) {                                                             \
-                struct smfs_super_info *smb = S2SMI(inode->i_sb);              \
-                struct list_head *hlist = &smb->smsi_hook_list;                \
-                struct list_head *p;                                           \
-                                                                               \
-                list_for_each(p, hlist) {                                      \
-                       struct smfs_hook_ops *hops;                            \
-                                                                               \
-                        hops = list_entry(p, typeof(*hops), smh_list);         \
-                        if (flag == PRE_HOOK && hops->smh_pre_op)              \
-                                rc = hops->smh_pre_op(inode, dentry, data1,    \
-                                                      data2, op, handle);      \
-                        else if (flag == POST_HOOK && hops->smh_post_op)       \
-                                rc = hops->smh_post_op(inode, dentry, data1,   \
-                                                       data2, op, handle);     \
-                        if (rc)                                                \
-                                break;                                         \
-                }                                                              \
-        }                                                                      \
-        if (rc)                                                                \
-                GOTO(label, rc);                                               \
-} while(0)                                                                     \
-
-#define SMFS_GET_INODE(sb, cache_inode, dir, inode, rc, label)          \
-do {                                                                    \
-        LASSERT(cache_inode);                                           \
-        inode = smfs_get_inode(sb, cache_inode->i_ino, dir, 0);         \
-        iput(cache_inode);                                              \
-        if (!inode)                                                     \
-                GOTO(label, rc = -ENOENT);                              \
-} while(0)        
-
 
 #if CONFIG_SNAPFS
 int smfs_cow_init(struct super_block *sb);