summaryrefslogtreecommitdiffstats
path: root/fs/super.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2018-12-23 18:55:56 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2019-01-30 17:44:27 -0500
commitf3a09c92018a91ad0981146a4ac59414f814d801 (patch)
treec500afabc514faf977ceacfbe57ce04910bcc3e0 /fs/super.c
parente1a91586d5da6f879b6dd385a2e7227bf1653570 (diff)
introduce fs_context methods
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/super.c')
-rw-r--r--fs/super.c36
1 files changed, 28 insertions, 8 deletions
diff --git a/fs/super.c b/fs/super.c
index 50553233dd15..76b3181c782d 100644
--- a/fs/super.c
+++ b/fs/super.c
@@ -894,13 +894,15 @@ int reconfigure_super(struct fs_context *fc)
894 } 894 }
895 } 895 }
896 896
897 retval = legacy_reconfigure(fc); 897 if (fc->ops->reconfigure) {
898 if (retval) { 898 retval = fc->ops->reconfigure(fc);
899 if (!force) 899 if (retval) {
900 goto cancel_readonly; 900 if (!force)
901 /* If forced remount, go ahead despite any errors */ 901 goto cancel_readonly;
902 WARN(1, "forced remount of a %s fs returned %i\n", 902 /* If forced remount, go ahead despite any errors */
903 sb->s_type->name, retval); 903 WARN(1, "forced remount of a %s fs returned %i\n",
904 sb->s_type->name, retval);
905 }
904 } 906 }
905 907
906 WRITE_ONCE(sb->s_flags, ((sb->s_flags & ~fc->sb_flags_mask) | 908 WRITE_ONCE(sb->s_flags, ((sb->s_flags & ~fc->sb_flags_mask) |
@@ -1294,10 +1296,28 @@ int vfs_get_tree(struct fs_context *fc)
1294 struct super_block *sb; 1296 struct super_block *sb;
1295 int error; 1297 int error;
1296 1298
1297 error = legacy_get_tree(fc); 1299 if (fc->fs_type->fs_flags & FS_REQUIRES_DEV && !fc->source)
1300 return -ENOENT;
1301
1302 if (fc->root)
1303 return -EBUSY;
1304
1305 /* Get the mountable root in fc->root, with a ref on the root and a ref
1306 * on the superblock.
1307 */
1308 error = fc->ops->get_tree(fc);
1298 if (error < 0) 1309 if (error < 0)
1299 return error; 1310 return error;
1300 1311
1312 if (!fc->root) {
1313 pr_err("Filesystem %s get_tree() didn't set fc->root\n",
1314 fc->fs_type->name);
1315 /* We don't know what the locking state of the superblock is -
1316 * if there is a superblock.
1317 */
1318 BUG();
1319 }
1320
1301 sb = fc->root->d_sb; 1321 sb = fc->root->d_sb;
1302 WARN_ON(!sb->s_bdi); 1322 WARN_ON(!sb->s_bdi);
1303 1323