Whamcloud - gitweb
update .snap on smfs
[fs/lustre-release.git] / lustre / smfs / smfs_lib.c
index f0a23b5..10a3bf9 100644 (file)
@@ -163,8 +163,7 @@ err_out:
 
 static int smfs_umount_cache(struct smfs_super_info *smb)
 {
-        iput(smb->smsi_sb->s_root->d_inode);
-        dput(smb->smsi_sb->s_root);
+        
         mntput(smb->smsi_mnt);
         smfs_cleanup_sm_ops(smb);
         smfs_cleanup_fsfilt_ops(smb);
@@ -216,7 +215,7 @@ static void smfs_cleanup_smb(struct super_block *sb)
         EXIT;
         return;
 }
-static void smfs_cleanup_hooks(struct smfs_super_info *smb)
+void smfs_cleanup_hooks(struct smfs_super_info *smb)
 {
         
         if (SMFS_CACHE_HOOK(smb))
@@ -227,6 +226,7 @@ static void smfs_cleanup_hooks(struct smfs_super_info *smb)
         if (SMFS_DO_COW(smb))
                 smfs_cow_cleanup(smb);
 #endif  
+        smfs_cleanup_hook_ops(smb);
 }
 
 void smfs_put_super(struct super_block *sb)
@@ -235,7 +235,6 @@ void smfs_put_super(struct super_block *sb)
 
         smfs_cleanup_hooks(smfs_info);
         
-        smfs_cleanup_hook_ops(smfs_info);
         if (sb)
                 smfs_umount_cache(smfs_info);
         smfs_cleanup_smb(sb); 
@@ -417,3 +416,31 @@ struct smfs_hook_ops *smfs_unregister_hook_ops(struct smfs_super_info *smb,
         RETURN(NULL);
 }
 
+void *smfs_trans_start(struct inode *inode, int op, void *desc_private)
+{
+        struct fsfilt_operations *fsfilt = S2SMI(inode->i_sb)->sm_fsfilt;
+
+        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)
+                return fsfilt->fs_start(inode, op, desc_private, 0);
+        return NULL;
+}
+
+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->i_sb, inode, handle, force_sync);
+}
+