VServer 1.9.2 (patch-2.6.8.1-vs1.9.2.diff)
[linux-2.6.git] / fs / affs / super.c
index ad83ec3..f4ebbd2 100644 (file)
@@ -51,10 +51,9 @@ affs_put_super(struct super_block *sb)
                mark_buffer_dirty(sbi->s_root_bh);
        }
 
-       affs_brelse(sbi->s_bmap_bh);
        if (sbi->s_prefix)
                kfree(sbi->s_prefix);
-       kfree(sbi->s_bitmap);
+       affs_free_bitmap(sb);
        affs_brelse(sbi->s_root_bh);
        kfree(sbi);
        sb->s_fs_info = NULL;
@@ -288,6 +287,7 @@ static int affs_fill_super(struct super_block *sb, void *data, int silent)
        gid_t                    gid;
        int                      reserved;
        unsigned long            mount_flags;
+       int                      tmp_flags;     /* fix remount prototype... */
 
        pr_debug("AFFS: read_super(%s)\n",data ? (const char *)data : "no options");
 
@@ -399,7 +399,6 @@ got_root:
                printk(KERN_NOTICE "AFFS: Dircache FS - mounting %s read only\n",
                        sb->s_id);
                sb->s_flags |= MS_RDONLY;
-               sbi->s_flags |= SF_READONLY;
        }
        switch (chksum) {
                case MUFS_FS:
@@ -455,8 +454,10 @@ got_root:
        sbi->s_root_bh = root_bh;
        /* N.B. after this point s_root_bh must be released */
 
-       if (affs_init_bitmap(sb))
+       tmp_flags = sb->s_flags;
+       if (affs_init_bitmap(sb, &tmp_flags))
                goto out_error;
+       sb->s_flags = tmp_flags;
 
        /* set up enough so that it can read an inode */
 
@@ -498,7 +499,7 @@ affs_remount(struct super_block *sb, int *flags, char *data)
        int                      reserved;
        int                      root_block;
        unsigned long            mount_flags;
-       unsigned long            read_only = sbi->s_flags & SF_READONLY;
+       int                      res = 0;
 
        pr_debug("AFFS: remount(flags=0x%x,opts=\"%s\")\n",*flags,data);
 
@@ -507,7 +508,7 @@ affs_remount(struct super_block *sb, int *flags, char *data)
        if (!parse_options(data,&uid,&gid,&mode,&reserved,&root_block,
            &blocksize,&sbi->s_prefix,sbi->s_volume,&mount_flags))
                return -EINVAL;
-       sbi->s_flags = mount_flags | read_only;
+       sbi->s_flags = mount_flags;
        sbi->s_mode  = mode;
        sbi->s_uid   = uid;
        sbi->s_gid   = gid;
@@ -518,14 +519,11 @@ affs_remount(struct super_block *sb, int *flags, char *data)
                sb->s_dirt = 1;
                while (sb->s_dirt)
                        affs_write_super(sb);
-               sb->s_flags |= MS_RDONLY;
-       } else if (!(sbi->s_flags & SF_READONLY)) {
-               sb->s_flags &= ~MS_RDONLY;
-       } else {
-               affs_warning(sb,"remount","Cannot remount fs read/write because of errors");
-               return -EINVAL;
-       }
-       return 0;
+               affs_free_bitmap(sb);
+       } else
+               res = affs_init_bitmap(sb, flags);
+
+       return res;
 }
 
 static int