Add an image maker tool that generates image files for 2k page * 64 devices
[yaffs2.git] / yaffs_vfs_multi.c
index e4edb2cb357e328f8c906c7b01cf02ba9dd13a5a..19c891907e14fd521de7a974950a2d4023e3004d 100644 (file)
@@ -1832,10 +1832,8 @@ static int yaffs_iterate(struct file *f, struct dir_context *dc)
                goto out;
        }
 
-       if (!dir_emit_dots(f, dc)) {
-               yaffs_gross_unlock(dev);
-               return 0;
-       }
+       if (!dir_emit_dots(f, dc))
+               goto out;
 
        curoffs = 1;
 
@@ -2718,6 +2716,7 @@ static int yaffs_sync_fs(struct super_block *sb)
 static int yaffs_remount_fs(struct super_block *sb, int *flags, char *data)
 {
        int read_only = 0;
+       int was_read_only = 0;
        struct mtd_info *mtd;
        struct yaffs_dev *dev = 0;
 
@@ -2747,8 +2746,18 @@ static int yaffs_remount_fs(struct super_block *sb, int *flags, char *data)
        }
 
        dev = sb->s_fs_info;
+       was_read_only = dev->read_only;
        dev->read_only = read_only;
 
+       if (was_read_only && !read_only) {
+               yaffs_gross_lock(dev);
+               yaffs_guts_cleanup(dev);
+               yaffs_gross_unlock(dev);
+               yaffs_bg_start(dev);
+       } else if (!was_read_only && read_only) {
+               yaffs_bg_stop(dev);
+       }
+
        return 0;
 }