diff options
author | David Howells <dhowells@redhat.com> | 2019-03-25 19:38:23 +0300 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2019-05-26 01:00:06 +0300 |
commit | 059b20d9da69d3a9bfb7ab00d1e5a3114a31c822 (patch) | |
tree | bac9dee4b5525bb0b314be1e9b7affc8d5526d5d /fs/nsfs.c | |
parent | 9030d16eb8adcbf9e80d20b909856c6fdabfdec4 (diff) | |
download | linux-059b20d9da69d3a9bfb7ab00d1e5a3114a31c822.tar.xz |
vfs: Convert nsfs to use the new mount API
Convert the nsfs filesystem to the new internal mount API as the old
one will be obsoleted and removed. This allows greater flexibility in
communication of mount parameters between userspace, the VFS and the
filesystem.
See Documentation/filesystems/mount_api.txt for more information.
Signed-off-by: David Howells <dhowells@redhat.com>
cc: Eric W. Biederman <ebiederm@xmission.com>
cc: linux-fsdevel@vger.kernel.org
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/nsfs.c')
-rw-r--r-- | fs/nsfs.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/fs/nsfs.c b/fs/nsfs.c index b3c49ddc0f85..a0431642c6b5 100644 --- a/fs/nsfs.c +++ b/fs/nsfs.c @@ -1,5 +1,6 @@ // SPDX-License-Identifier: GPL-2.0 #include <linux/mount.h> +#include <linux/pseudo_fs.h> #include <linux/file.h> #include <linux/fs.h> #include <linux/proc_ns.h> @@ -258,15 +259,20 @@ static const struct super_operations nsfs_ops = { .evict_inode = nsfs_evict, .show_path = nsfs_show_path, }; -static struct dentry *nsfs_mount(struct file_system_type *fs_type, - int flags, const char *dev_name, void *data) + +static int nsfs_init_fs_context(struct fs_context *fc) { - return mount_pseudo(fs_type, &nsfs_ops, - &ns_dentry_operations, NSFS_MAGIC); + struct pseudo_fs_context *ctx = init_pseudo(fc, NSFS_MAGIC); + if (!ctx) + return -ENOMEM; + ctx->ops = &nsfs_ops; + ctx->dops = &ns_dentry_operations; + return 0; } + static struct file_system_type nsfs = { .name = "nsfs", - .mount = nsfs_mount, + .init_fs_context = nsfs_init_fs_context, .kill_sb = kill_anon_super, }; |