#define SMFS_PSDEV_MINOR 250
#define SMFS_PSDEV_MAJOR 10
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,10))
+#define FC3_KERNEL
+#endif
+
struct option {
char *opt;
char *value;
#define INODE_OPS_CHECK 0x2
#define FILE_OPS_CHECK 0x4
#define DENTRY_OPS_CHECK 0x8
-#define DEV_OPS_CHECK 0x10
+#define SPECIAL_OPS_CHECK 0x10
#define SYMLINK_OPS_CHECK 0x20
#define DIR_OPS_CHECK 0x40
-#define KML_LOG_NAME "kml_rec"
-
#define MYPATHLEN(buffer, path) ((buffer) + PAGE_SIZE - (path))
-
#define PACK_KML_REC_INIT(buffer, op_code) \
do{ \
int opcode = op_code; \
buffer += sizeof(opcode); \
} while (0)
+#define SMFS_IOPEN_INO 1
+#define KEY_IS(str, key) (strcmp(str,key) == 0)
extern int init_smfs_proc_sys(void);
/*cache.c*/
-extern void sm_set_inode_ops(struct inode *cache_inode, struct inode *inode);
+extern void sm_set_inode_ops(struct inode *);
extern void sm_set_sb_ops(struct super_block *cache_sb, struct super_block *sb);
-extern void init_smfs_cache(void);
-extern void cleanup_smfs_cache(void);
-extern void sm_set_journal_ops(struct super_block *sb, char *cache_type);
+//extern void init_smfs_cache(void);
+//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 inode_operations *cache_diops(struct smfs_super_info *smb)
-{
- return &smb->sm_ops->sm_dir_iops;
-}
-static inline struct inode_operations *cache_fiops(struct smfs_super_info *smb)
-{
- return &smb->sm_ops->sm_file_iops;
-}
-static inline struct inode_operations *cache_siops(struct smfs_super_info *smb)
-{
- return &smb->sm_ops->sm_sym_iops;
-}
-static inline struct file_operations *cache_dfops(struct smfs_super_info *smb)
-{
- return &smb->sm_ops->sm_dir_fops;
-}
-static inline struct file_operations *cache_ffops(struct smfs_super_info *smb)
-{
- return &smb->sm_ops->sm_file_fops;
-}
-static inline struct file_operations *cache_sfops(struct smfs_super_info *smb)
-{
- return &smb->sm_ops->sm_sym_fops;
-}
-static inline struct dentry_operations *cache_dops(struct smfs_super_info *smb)
-{
- return &smb->sm_ops->sm_dentry_ops;
-}
-static inline struct journal_operations *journal_ops(struct smfs_super_info *smb)
-{
- return &smb->sm_ops->sm_journal_ops;
-}
-
-struct smfs_hook_ops *smfs_alloc_hook_ops(char *name,
- smfs_hook_func pre_hook,
- smfs_hook_func post_hook);
-
-void smfs_free_hook_ops(struct smfs_hook_ops *hops);
-int smfs_register_hook_ops(struct smfs_super_info *smb,
- struct smfs_hook_ops *smh_ops);
-
-struct smfs_hook_ops *smfs_unregister_hook_ops(struct smfs_super_info *smb,
- char *name);
/*smfs_lib.c*/
void smfs_put_super(struct super_block *sb);
int smfs_fill_super(struct super_block *sb, void *data, int silent);
-
-void smfs_cleanup_hooks(struct smfs_super_info *smb);
+int smfs_post_setup(struct obd_device *, struct vfsmount *, struct dentry *);
+void smfs_post_cleanup(struct super_block *);
+void * smfs_get_plg_priv(struct smfs_super_info *, int);
/*sysctl.c*/
extern int sm_debug_level;
extern int sm_inodes;
/*dir.c*/
extern struct inode_operations smfs_dir_iops;
extern struct file_operations smfs_dir_fops;
+extern struct inode_operations smfs_iopen_iops;
+extern struct file_operations smfs_iopen_fops;
+
/*file.c*/
extern struct inode_operations smfs_file_iops;
extern struct file_operations smfs_file_fops;
+extern struct inode_operations smfs_special_iops;
extern int smfs_ioctl(struct inode * inode, struct file * filp,
unsigned int cmd, unsigned long arg);
extern int smfs_fsync(struct file * file, struct dentry *dentry, int datasync);
size_t size);
extern ssize_t smfs_listxattr(struct dentry *dentry, char *buffer, size_t size);
extern int smfs_removexattr(struct dentry *dentry, const char *name);
+extern int smfs_permission(struct inode *inode, int mask, struct nameidata *nd);
extern int smfs_open(struct inode * inode, struct file * filp);
extern int smfs_release(struct inode * inode, struct file * filp);
/*inode.c*/
-struct inode *smfs_get_inode(struct super_block *sb, ino_t hash,
- struct inode *dir, int index);
+struct inode *smfs_get_inode(struct super_block *, struct inode*,
+ struct smfs_inode_info *, int);
extern struct super_operations smfs_super_ops;
struct smfs_iget_args {
- struct inode *s_inode;
- int s_index;
- int s_ino;
+ struct inode *s_inode;
+ struct smfs_inode_info *s_info;
+ int s_index;
};
+
/*symlink.c*/
extern struct inode_operations smfs_sym_iops;
extern struct file_operations smfs_sym_fops;
-/*journal.c */
+
void *smfs_trans_start(struct inode *inode, int op, void *desc_private);
void smfs_trans_commit(struct inode *inode, void *handle, int force_sync);
extern int smfs_process_rec(struct super_block *sb, int count,
char *dir, int flags);
-/*mds_kml.c*/
-int mds_rec_pack_init(struct smfs_super_info *smb);
-/*ost_kml.c*/
-int ost_rec_pack_init(struct smfs_super_info *smb);
+extern int mds_rec_pack(int, char *, struct dentry *, struct inode *,
+ void *, void *);
+extern int ost_rec_pack(int, char *, struct dentry *, struct inode *,
+ void *, void *);
/*smfs_llog.c*/
-extern int smfs_llog_setup(struct super_block *sb, struct vfsmount *mnt);
-extern int smfs_llog_cleanup(struct super_block *sb);
-extern int smfs_llog_add_rec(struct smfs_super_info * sinfo, void *data,
- int data_size);
+extern int smfs_llog_setup(struct dentry **, struct dentry **);
+extern int smfs_llog_cleanup(struct smfs_super_info *);
+extern int smfs_llog_add_rec(struct smfs_super_info *, void *, int);
/*ioctl.c*/
extern int init_smfs_psdev(void);
extern void smfs_cleanup_psdev(void);
/*smfs_cow.c */
+/* audit_transfer.c */
+int audit_notify(struct llog_handle *llh, void*);
+int audit_start_transferd(void);
+int audit_stop_transferd(void);
+
/* cache_space.c */
extern int do_cache_manage;
struct cache_purge_queue {
RETURN(rc);
}
+struct kml_buffer {
+ char *buf;
+ int buf_size;
+};
+
+#ifdef __KERNEL__
+static inline void
+smfs_inode2id(struct lustre_id *id, struct inode *inode)
+{
+ mdc_pack_id(id, inode->i_ino, inode->i_generation,
+ (inode->i_mode & S_IFMT), 0, 0);
+}
+
+static inline void
+smfs_prepare_mdc_data(struct mdc_op_data *data, struct inode *i1,
+ struct inode *i2, const char *name, int namelen,
+ int mode)
+{
+ LASSERT(i1);
+
+ smfs_inode2id(&data->id1, i1);
+ if (i2)
+ smfs_inode2id(&data->id2, i2);
+ else
+ memset(&data->id2, 0, sizeof(data->id2));
+
+ data->valid = 0;
+ data->name = name;
+ data->namelen = namelen;
+ data->create_mode = mode;
+ data->mod_time = LTIME_S(CURRENT_TIME);
+}
+#endif
+
#if CONFIG_SNAPFS
int smfs_cow_init(struct super_block *sb);
int smfs_cow_cleanup(struct smfs_super_info *smb);