summaryrefslogtreecommitdiffstats
path: root/fs/hpfs/super.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/hpfs/super.c')
-rw-r--r--fs/hpfs/super.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/fs/hpfs/super.c b/fs/hpfs/super.c
index 82067ca22f2b..1516fb4e28f4 100644
--- a/fs/hpfs/super.c
+++ b/fs/hpfs/super.c
@@ -21,7 +21,7 @@
21 21
22static void mark_dirty(struct super_block *s, int remount) 22static void mark_dirty(struct super_block *s, int remount)
23{ 23{
24 if (hpfs_sb(s)->sb_chkdsk && (remount || !(s->s_flags & MS_RDONLY))) { 24 if (hpfs_sb(s)->sb_chkdsk && (remount || !sb_rdonly(s))) {
25 struct buffer_head *bh; 25 struct buffer_head *bh;
26 struct hpfs_spare_block *sb; 26 struct hpfs_spare_block *sb;
27 if ((sb = hpfs_map_sector(s, 17, &bh, 0))) { 27 if ((sb = hpfs_map_sector(s, 17, &bh, 0))) {
@@ -41,7 +41,7 @@ static void unmark_dirty(struct super_block *s)
41{ 41{
42 struct buffer_head *bh; 42 struct buffer_head *bh;
43 struct hpfs_spare_block *sb; 43 struct hpfs_spare_block *sb;
44 if (s->s_flags & MS_RDONLY) return; 44 if (sb_rdonly(s)) return;
45 sync_blockdev(s->s_bdev); 45 sync_blockdev(s->s_bdev);
46 if ((sb = hpfs_map_sector(s, 17, &bh, 0))) { 46 if ((sb = hpfs_map_sector(s, 17, &bh, 0))) {
47 sb->dirty = hpfs_sb(s)->sb_chkdsk > 1 - hpfs_sb(s)->sb_was_error; 47 sb->dirty = hpfs_sb(s)->sb_chkdsk > 1 - hpfs_sb(s)->sb_was_error;
@@ -73,14 +73,14 @@ void hpfs_error(struct super_block *s, const char *fmt, ...)
73 mark_dirty(s, 0); 73 mark_dirty(s, 0);
74 panic("HPFS panic"); 74 panic("HPFS panic");
75 } else if (hpfs_sb(s)->sb_err == 1) { 75 } else if (hpfs_sb(s)->sb_err == 1) {
76 if (s->s_flags & MS_RDONLY) 76 if (sb_rdonly(s))
77 pr_cont("; already mounted read-only\n"); 77 pr_cont("; already mounted read-only\n");
78 else { 78 else {
79 pr_cont("; remounting read-only\n"); 79 pr_cont("; remounting read-only\n");
80 mark_dirty(s, 0); 80 mark_dirty(s, 0);
81 s->s_flags |= MS_RDONLY; 81 s->s_flags |= MS_RDONLY;
82 } 82 }
83 } else if (s->s_flags & MS_RDONLY) 83 } else if (sb_rdonly(s))
84 pr_cont("; going on - but anything won't be destroyed because it's read-only\n"); 84 pr_cont("; going on - but anything won't be destroyed because it's read-only\n");
85 else 85 else
86 pr_cont("; corrupted filesystem mounted read/write - your computer will explode within 20 seconds ... but you wanted it so!\n"); 86 pr_cont("; corrupted filesystem mounted read/write - your computer will explode within 20 seconds ... but you wanted it so!\n");
@@ -607,8 +607,7 @@ static int hpfs_fill_super(struct super_block *s, void *options, int silent)
607 } 607 }
608 608
609 /* Check version */ 609 /* Check version */
610 if (!(s->s_flags & MS_RDONLY) && 610 if (!sb_rdonly(s) && superblock->funcversion != 2 && superblock->funcversion != 3) {
611 superblock->funcversion != 2 && superblock->funcversion != 3) {
612 pr_err("Bad version %d,%d. Mount readonly to go around\n", 611 pr_err("Bad version %d,%d. Mount readonly to go around\n",
613 (int)superblock->version, (int)superblock->funcversion); 612 (int)superblock->version, (int)superblock->funcversion);
614 pr_err("please try recent version of HPFS driver at http://artax.karlin.mff.cuni.cz/~mikulas/vyplody/hpfs/index-e.cgi and if it still can't understand this format, contact author - mikulas@artax.karlin.mff.cuni.cz\n"); 613 pr_err("please try recent version of HPFS driver at http://artax.karlin.mff.cuni.cz/~mikulas/vyplody/hpfs/index-e.cgi and if it still can't understand this format, contact author - mikulas@artax.karlin.mff.cuni.cz\n");
@@ -666,7 +665,7 @@ static int hpfs_fill_super(struct super_block *s, void *options, int silent)
666 hpfs_error(s, "improperly stopped"); 665 hpfs_error(s, "improperly stopped");
667 } 666 }
668 667
669 if (!(s->s_flags & MS_RDONLY)) { 668 if (!sb_rdonly(s)) {
670 spareblock->dirty = 1; 669 spareblock->dirty = 1;
671 spareblock->old_wrote = 0; 670 spareblock->old_wrote = 0;
672 mark_buffer_dirty(bh2); 671 mark_buffer_dirty(bh2);