diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2017-09-14 21:54:01 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-09-14 21:54:01 -0400 |
commit | 0f0d12728e56c94d3289c6831243b6faeae8a19d (patch) | |
tree | bd52fd4ed6fba2a0d8bb95e7fc33f51ac299001d /fs/hpfs/super.c | |
parent | 581bfce969cbfc7ce43ee92273be9cb7c3fdfa61 (diff) | |
parent | e462ec50cb5fad19f6003a3d8087f4a0945dd2b1 (diff) |
Merge branch 'work.mount' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull mount flag updates from Al Viro:
"Another chunk of fmount preparations from dhowells; only trivial
conflicts for that part. It separates MS_... bits (very grotty
mount(2) ABI) from the struct super_block ->s_flags (kernel-internal,
only a small subset of MS_... stuff).
This does *not* convert the filesystems to new constants; only the
infrastructure is done here. The next step in that series is where the
conflicts would be; that's the conversion of filesystems. It's purely
mechanical and it's better done after the merge, so if you could run
something like
list=$(for i in MS_RDONLY MS_NOSUID MS_NODEV MS_NOEXEC MS_SYNCHRONOUS MS_MANDLOCK MS_DIRSYNC MS_NOATIME MS_NODIRATIME MS_SILENT MS_POSIXACL MS_KERNMOUNT MS_I_VERSION MS_LAZYTIME; do git grep -l $i fs drivers/staging/lustre drivers/mtd ipc mm include/linux; done|sort|uniq|grep -v '^fs/namespace.c$')
sed -i -e 's/\<MS_RDONLY\>/SB_RDONLY/g' \
-e 's/\<MS_NOSUID\>/SB_NOSUID/g' \
-e 's/\<MS_NODEV\>/SB_NODEV/g' \
-e 's/\<MS_NOEXEC\>/SB_NOEXEC/g' \
-e 's/\<MS_SYNCHRONOUS\>/SB_SYNCHRONOUS/g' \
-e 's/\<MS_MANDLOCK\>/SB_MANDLOCK/g' \
-e 's/\<MS_DIRSYNC\>/SB_DIRSYNC/g' \
-e 's/\<MS_NOATIME\>/SB_NOATIME/g' \
-e 's/\<MS_NODIRATIME\>/SB_NODIRATIME/g' \
-e 's/\<MS_SILENT\>/SB_SILENT/g' \
-e 's/\<MS_POSIXACL\>/SB_POSIXACL/g' \
-e 's/\<MS_KERNMOUNT\>/SB_KERNMOUNT/g' \
-e 's/\<MS_I_VERSION\>/SB_I_VERSION/g' \
-e 's/\<MS_LAZYTIME\>/SB_LAZYTIME/g' \
$list
and commit it with something along the lines of 'convert filesystems
away from use of MS_... constants' as commit message, it would save a
quite a bit of headache next cycle"
* 'work.mount' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
VFS: Differentiate mount flags (MS_*) from internal superblock flags
VFS: Convert sb->s_flags & MS_RDONLY to sb_rdonly(sb)
vfs: Add sb_rdonly(sb) to query the MS_RDONLY flag on s_flags
Diffstat (limited to 'fs/hpfs/super.c')
-rw-r--r-- | fs/hpfs/super.c | 13 |
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 | ||
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); |