cifs: rename cifs_strlcpy_to_host and make it use new functions
[pandora-kernel.git] / fs / ext3 / fsync.c
index dd1fd3c..d336341 100644 (file)
@@ -47,7 +47,7 @@ int ext3_sync_file(struct file * file, struct dentry *dentry, int datasync)
        struct inode *inode = dentry->d_inode;
        int ret = 0;
 
-       J_ASSERT(ext3_journal_current_handle() == 0);
+       J_ASSERT(ext3_journal_current_handle() == NULL);
 
        /*
         * data=writeback:
@@ -72,6 +72,9 @@ int ext3_sync_file(struct file * file, struct dentry *dentry, int datasync)
                goto out;
        }
 
+       if (datasync && !(inode->i_state & I_DIRTY_DATASYNC))
+               goto out;
+
        /*
         * The VFS has written the file data.  If the inode is unaltered
         * then we need not start a commit.