diff options
Diffstat (limited to 'fs/nsfs.c')
-rw-r--r-- | fs/nsfs.c | 16 |
1 files changed, 11 insertions, 5 deletions
@@ -1,5 +1,6 @@ | |||
1 | // SPDX-License-Identifier: GPL-2.0 | 1 | // SPDX-License-Identifier: GPL-2.0 |
2 | #include <linux/mount.h> | 2 | #include <linux/mount.h> |
3 | #include <linux/pseudo_fs.h> | ||
3 | #include <linux/file.h> | 4 | #include <linux/file.h> |
4 | #include <linux/fs.h> | 5 | #include <linux/fs.h> |
5 | #include <linux/proc_ns.h> | 6 | #include <linux/proc_ns.h> |
@@ -258,15 +259,20 @@ static const struct super_operations nsfs_ops = { | |||
258 | .evict_inode = nsfs_evict, | 259 | .evict_inode = nsfs_evict, |
259 | .show_path = nsfs_show_path, | 260 | .show_path = nsfs_show_path, |
260 | }; | 261 | }; |
261 | static struct dentry *nsfs_mount(struct file_system_type *fs_type, | 262 | |
262 | int flags, const char *dev_name, void *data) | 263 | static int nsfs_init_fs_context(struct fs_context *fc) |
263 | { | 264 | { |
264 | return mount_pseudo(fs_type, "nsfs:", &nsfs_ops, | 265 | struct pseudo_fs_context *ctx = init_pseudo(fc, NSFS_MAGIC); |
265 | &ns_dentry_operations, NSFS_MAGIC); | 266 | if (!ctx) |
267 | return -ENOMEM; | ||
268 | ctx->ops = &nsfs_ops; | ||
269 | ctx->dops = &ns_dentry_operations; | ||
270 | return 0; | ||
266 | } | 271 | } |
272 | |||
267 | static struct file_system_type nsfs = { | 273 | static struct file_system_type nsfs = { |
268 | .name = "nsfs", | 274 | .name = "nsfs", |
269 | .mount = nsfs_mount, | 275 | .init_fs_context = nsfs_init_fs_context, |
270 | .kill_sb = kill_anon_super, | 276 | .kill_sb = kill_anon_super, |
271 | }; | 277 | }; |
272 | 278 | ||