Fix vfs calls to yaffs_flush_file
[yaffs2.git] / yaffs_vfs_single.c
index 145517b69b165d4274037493075046c85c78ac58..2d6c991d46969bd06afaf1cc78ae9db279132d6c 100644 (file)
@@ -450,7 +450,7 @@ static int yaffs_sync_object(struct file *file,
 
        yaffs_trace(YAFFS_TRACE_OS | YAFFS_TRACE_SYNC, "yaffs_sync_object");
        yaffs_gross_lock(dev);
-       yaffs_flush_file(obj, 1, datasync);
+       yaffs_flush_file(obj, 1, datasync, 0);
        yaffs_gross_unlock(dev);
        return 0;
 }
@@ -890,7 +890,7 @@ static int yaffs_file_flush(struct file *file, fl_owner_t id)
 
        yaffs_gross_lock(dev);
 
-       yaffs_flush_file(obj, 1, 0);
+       yaffs_flush_file(obj, 1, 0, 0);
 
        yaffs_gross_unlock(dev);
 
@@ -1496,7 +1496,7 @@ static void yaffs_flush_inodes(struct super_block *sb)
                if (obj) {
                        yaffs_trace(YAFFS_TRACE_OS,
                                "flushing obj %d", obj->obj_id);
-                       yaffs_flush_file(obj, 1, 0);
+                       yaffs_flush_file(obj, 1, 0, 0);
                }
        }
 }
@@ -2033,7 +2033,7 @@ static struct super_block *yaffs_internal_read_super(int yaffs_version,
 
        /* Get the device */
        mtd = get_mtd_device(NULL, MINOR(sb->s_dev));
-       if (!mtd) {
+       if (IS_ERR(mtd)) {
                yaffs_trace(YAFFS_TRACE_ALWAYS,
                        "MTD device #%u doesn't appear to exist",
                        MINOR(sb->s_dev));
@@ -2127,9 +2127,7 @@ static struct super_block *yaffs_internal_read_super(int yaffs_version,
                kfree(context);
                dev = NULL;
                context = NULL;
-       }
 
-       if (!dev) {
                /* Deep shit could not allocate device structure */
                yaffs_trace(YAFFS_TRACE_ALWAYS,
                        "yaffs_read_super failed trying to allocate yaffs_dev");