@@ -1931,6 +1931,51 @@ xfs_fs_fill_super(
return error;
}
+STATIC int
+xfs_fill_super(
+ struct super_block *sb,
+ struct fs_context *fc)
+{
+ struct xfs_fs_context *ctx = fc->fs_private;
+ struct xfs_mount *mp = sb->s_fs_info;
+ int silent = fc->sb_flags & SB_SILENT;
+ int error = -ENOMEM;
+
+ mp->m_super = sb;
+
+ /*
+ * set up the mount name first so all the errors will refer to the
+ * correct device.
+ */
+ mp->m_fsname = kstrndup(sb->s_id, MAXNAMELEN, GFP_KERNEL);
+ if (!mp->m_fsname)
+ return -ENOMEM;
+ mp->m_fsname_len = strlen(mp->m_fsname) + 1;
+
+ error = xfs_validate_params(mp, ctx, false);
+ if (error)
+ goto out_free_fsname;
+
+ error = __xfs_fs_fill_super(mp, silent);
+ if (error)
+ goto out_free_fsname;
+
+ return 0;
+
+ out_free_fsname:
+ sb->s_fs_info = NULL;
+ xfs_free_fsname(mp);
+
+ return error;
+}
+
+STATIC int
+xfs_get_tree(
+ struct fs_context *fc)
+{
+ return vfs_get_block_super(fc, xfs_fill_super);
+}
+
STATIC void
xfs_fs_put_super(
struct super_block *sb)
Add the fs_context_operations method .get_tree that validates mount options and fills the super block as previously done by the file_system_type .mount method. Signed-off-by: Ian Kent <raven@themaw.net> --- fs/xfs/xfs_super.c | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+)