diff options
Diffstat (limited to 'fs/hpfs')
-rw-r--r-- | fs/hpfs/alloc.c | 4 | ||||
-rw-r--r-- | fs/hpfs/dir.c | 2 | ||||
-rw-r--r-- | fs/hpfs/super.c | 13 |
3 files changed, 9 insertions, 10 deletions
diff --git a/fs/hpfs/alloc.c b/fs/hpfs/alloc.c index d6a4b55d2ab0..098bf0f4f386 100644 --- a/fs/hpfs/alloc.c +++ b/fs/hpfs/alloc.c | |||
@@ -538,7 +538,7 @@ int hpfs_trim_fs(struct super_block *s, u64 start, u64 end, u64 minlen, unsigned | |||
538 | return 0; | 538 | return 0; |
539 | if (start < sbi->sb_dirband_start + sbi->sb_dirband_size && end > sbi->sb_dirband_start) { | 539 | if (start < sbi->sb_dirband_start + sbi->sb_dirband_size && end > sbi->sb_dirband_start) { |
540 | hpfs_lock(s); | 540 | hpfs_lock(s); |
541 | if (s->s_flags & MS_RDONLY) { | 541 | if (sb_rdonly(s)) { |
542 | err = -EROFS; | 542 | err = -EROFS; |
543 | goto unlock_1; | 543 | goto unlock_1; |
544 | } | 544 | } |
@@ -559,7 +559,7 @@ unlock_1: | |||
559 | end_bmp = (end + 0x3fff) >> 14; | 559 | end_bmp = (end + 0x3fff) >> 14; |
560 | while (start_bmp < end_bmp && !err) { | 560 | while (start_bmp < end_bmp && !err) { |
561 | hpfs_lock(s); | 561 | hpfs_lock(s); |
562 | if (s->s_flags & MS_RDONLY) { | 562 | if (sb_rdonly(s)) { |
563 | err = -EROFS; | 563 | err = -EROFS; |
564 | goto unlock_2; | 564 | goto unlock_2; |
565 | } | 565 | } |
diff --git a/fs/hpfs/dir.c b/fs/hpfs/dir.c index 7b9150c2e75c..fa6bbb4f509f 100644 --- a/fs/hpfs/dir.c +++ b/fs/hpfs/dir.c | |||
@@ -264,7 +264,7 @@ struct dentry *hpfs_lookup(struct inode *dir, struct dentry *dentry, unsigned in | |||
264 | hpfs_result = hpfs_i(result); | 264 | hpfs_result = hpfs_i(result); |
265 | if (!de->directory) hpfs_result->i_parent_dir = dir->i_ino; | 265 | if (!de->directory) hpfs_result->i_parent_dir = dir->i_ino; |
266 | 266 | ||
267 | if (de->has_acl || de->has_xtd_perm) if (!(dir->i_sb->s_flags & MS_RDONLY)) { | 267 | if (de->has_acl || de->has_xtd_perm) if (!sb_rdonly(dir->i_sb)) { |
268 | hpfs_error(result->i_sb, "ACLs or XPERM found. This is probably HPFS386. This driver doesn't support it now. Send me some info on these structures"); | 268 | hpfs_error(result->i_sb, "ACLs or XPERM found. This is probably HPFS386. This driver doesn't support it now. Send me some info on these structures"); |
269 | goto bail1; | 269 | goto bail1; |
270 | } | 270 | } |
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 | ||
22 | static void mark_dirty(struct super_block *s, int remount) | 22 | static 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); |