Whamcloud - gitweb
- more checks and verbosity in test_16 of conf-sanity.sh to see what happens when...
[fs/lustre-release.git] / lustre / smfs / journal.c
index 8a43df7..ab62e7a 100644 (file)
@@ -60,7 +60,7 @@ void *smfs_trans_start(struct inode *inode, int op, void *desc_private)
         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)
@@ -72,10 +72,13 @@ void smfs_trans_commit(struct inode *inode, void *handle, int force_sync)
 {
         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*/
@@ -159,10 +162,8 @@ static int smfs_pack_rec (char *buffer, struct dentry *dentry,
         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;
@@ -517,19 +518,27 @@ exit:
 }
 
 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;
 }