]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/ext4/fsync.c
ext4: move headers out of include/linux
[linux-2.6-omap-h63xx.git] / fs / ext4 / fsync.c
index 2a167d7131fa38feec17d647bbbdefbb98b6b601..1c8ba48d4f8d6014e5708b44706640e3e29a11e9 100644 (file)
@@ -27,8 +27,8 @@
 #include <linux/sched.h>
 #include <linux/writeback.h>
 #include <linux/jbd2.h>
-#include <linux/ext4_fs.h>
-#include <linux/ext4_jbd2.h>
+#include "ext4.h"
+#include "ext4_jbd2.h"
 
 /*
  * akpm: A new design for ext4_sync_file().
@@ -47,7 +47,7 @@ int ext4_sync_file(struct file * file, struct dentry *dentry, int datasync)
        struct inode *inode = dentry->d_inode;
        int ret = 0;
 
-       J_ASSERT(ext4_journal_current_handle() == 0);
+       J_ASSERT(ext4_journal_current_handle() == NULL);
 
        /*
         * data=writeback:
@@ -72,6 +72,9 @@ int ext4_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.