CDEBUG(D_INFO, "trans start %p\n", fsfilt->fs_start);
SMFS_TRANS_OP(inode, op);
-
+
/* There are some problem here. fs_start in fsfilt is used by lustre
* the journal blocks of write rec are not counted in FIXME later */
if (fsfilt->fs_start)
{
struct fsfilt_operations *fsfilt = S2SMI(inode->i_sb)->sm_fsfilt;
+ if (!handle)
+ return;
+
CDEBUG(D_INFO, "trans commit %p\n", fsfilt->fs_commit);
if (fsfilt->fs_commit)
- fsfilt->fs_commit(inode, handle, force_sync);
+ fsfilt->fs_commit(inode->i_sb, inode, handle, force_sync);
}
/*smfs_path is gotten from intermezzo*/
return rc;
}
-static int smfs_post_rec_create(struct inode *dir,
- struct dentry *dentry,
- void *data1,
- void *data2)
+int smfs_post_rec_create(struct inode *dir, struct dentry *dentry,
+ void *data1, void *data2)
{
struct smfs_super_info *sinfo;
char *buffer = NULL, *pbuf;
}
typedef int (*post_kml_rec)(struct inode *dir, struct dentry *dentry,
- void *data1, void *data2);
-
-static post_kml_rec smfs_kml_post[REINT_MAX + 1] = {
- [REINT_SETATTR] smfs_post_rec_setattr,
- [REINT_CREATE] smfs_post_rec_create,
- [REINT_LINK] smfs_post_rec_link,
- [REINT_UNLINK] smfs_post_rec_unlink,
- [REINT_RENAME] smfs_post_rec_rename,
- [REINT_WRITE] smfs_post_rec_write,
+ void *data1, void *data2);
+
+static post_kml_rec smfs_kml_post[HOOK_MAX + 1] = {
+ [HOOK_CREATE] smfs_post_rec_create,
+ [HOOK_LOOKUP] NULL,
+ [HOOK_LINK] smfs_post_rec_link,
+ [HOOK_UNLINK] smfs_post_rec_unlink,
+ [HOOK_SYMLINK] smfs_post_rec_create,
+ [HOOK_MKDIR] smfs_post_rec_create,
+ [HOOK_RMDIR] smfs_post_rec_unlink,
+ [HOOK_MKNOD] smfs_post_rec_create,
+ [HOOK_RENAME] smfs_post_rec_rename,
+ [HOOK_SETATTR] smfs_post_rec_setattr,
+ [HOOK_WRITE] smfs_post_rec_write,
};
int smfs_post_kml_rec(struct inode *dir, struct dentry *dst_dentry,
void *data1, void *data2, int op)
{
- return smfs_kml_post[op](dir, dst_dentry, data1, data2);
+ if (smfs_kml_post[op]) {
+ return smfs_kml_post[op](dir, dst_dentry, data1, data2);
+ }
+ return 0;
}