diff options
Diffstat (limited to 'fs/super.c')
-rw-r--r-- | fs/super.c | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/fs/super.c b/fs/super.c index b938b14f6041..c96434ea71e2 100644 --- a/fs/super.c +++ b/fs/super.c | |||
@@ -703,7 +703,8 @@ rescan: | |||
703 | } | 703 | } |
704 | 704 | ||
705 | /** | 705 | /** |
706 | * do_remount_sb - asks filesystem to change mount options. | 706 | * do_remount_sb2 - asks filesystem to change mount options. |
707 | * @mnt: mount we are looking at | ||
707 | * @sb: superblock in question | 708 | * @sb: superblock in question |
708 | * @flags: numeric part of options | 709 | * @flags: numeric part of options |
709 | * @data: the rest of options | 710 | * @data: the rest of options |
@@ -711,7 +712,7 @@ rescan: | |||
711 | * | 712 | * |
712 | * Alters the mount options of a mounted file system. | 713 | * Alters the mount options of a mounted file system. |
713 | */ | 714 | */ |
714 | int do_remount_sb(struct super_block *sb, int flags, void *data, int force) | 715 | int do_remount_sb2(struct vfsmount *mnt, struct super_block *sb, int flags, void *data, int force) |
715 | { | 716 | { |
716 | int retval; | 717 | int retval; |
717 | int remount_ro; | 718 | int remount_ro; |
@@ -753,7 +754,16 @@ int do_remount_sb(struct super_block *sb, int flags, void *data, int force) | |||
753 | } | 754 | } |
754 | } | 755 | } |
755 | 756 | ||
756 | if (sb->s_op->remount_fs) { | 757 | if (mnt && sb->s_op->remount_fs2) { |
758 | retval = sb->s_op->remount_fs2(mnt, sb, &flags, data); | ||
759 | if (retval) { | ||
760 | if (!force) | ||
761 | goto cancel_readonly; | ||
762 | /* If forced remount, go ahead despite any errors */ | ||
763 | WARN(1, "forced remount of a %s fs returned %i\n", | ||
764 | sb->s_type->name, retval); | ||
765 | } | ||
766 | } else if (sb->s_op->remount_fs) { | ||
757 | retval = sb->s_op->remount_fs(sb, &flags, data); | 767 | retval = sb->s_op->remount_fs(sb, &flags, data); |
758 | if (retval) { | 768 | if (retval) { |
759 | if (!force) | 769 | if (!force) |
@@ -785,6 +795,11 @@ cancel_readonly: | |||
785 | return retval; | 795 | return retval; |
786 | } | 796 | } |
787 | 797 | ||
798 | int do_remount_sb(struct super_block *sb, int flags, void *data, int force) | ||
799 | { | ||
800 | return do_remount_sb2(NULL, sb, flags, data, force); | ||
801 | } | ||
802 | |||
788 | static void do_emergency_remount(struct work_struct *work) | 803 | static void do_emergency_remount(struct work_struct *work) |
789 | { | 804 | { |
790 | struct super_block *sb, *p = NULL; | 805 | struct super_block *sb, *p = NULL; |
@@ -1104,7 +1119,7 @@ struct dentry *mount_single(struct file_system_type *fs_type, | |||
1104 | EXPORT_SYMBOL(mount_single); | 1119 | EXPORT_SYMBOL(mount_single); |
1105 | 1120 | ||
1106 | struct dentry * | 1121 | struct dentry * |
1107 | mount_fs(struct file_system_type *type, int flags, const char *name, void *data) | 1122 | mount_fs(struct file_system_type *type, int flags, const char *name, struct vfsmount *mnt, void *data) |
1108 | { | 1123 | { |
1109 | struct dentry *root; | 1124 | struct dentry *root; |
1110 | struct super_block *sb; | 1125 | struct super_block *sb; |
@@ -1121,7 +1136,10 @@ mount_fs(struct file_system_type *type, int flags, const char *name, void *data) | |||
1121 | goto out_free_secdata; | 1136 | goto out_free_secdata; |
1122 | } | 1137 | } |
1123 | 1138 | ||
1124 | root = type->mount(type, flags, name, data); | 1139 | if (type->mount2) |
1140 | root = type->mount2(mnt, type, flags, name, data); | ||
1141 | else | ||
1142 | root = type->mount(type, flags, name, data); | ||
1125 | if (IS_ERR(root)) { | 1143 | if (IS_ERR(root)) { |
1126 | error = PTR_ERR(root); | 1144 | error = PTR_ERR(root); |
1127 | goto out_free_secdata; | 1145 | goto out_free_secdata; |