.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * xenfs.c - a filesystem for passing info between the a domain and |
---|
3 | 4 | * the hypervisor. |
---|
.. | .. |
---|
13 | 14 | #include <linux/errno.h> |
---|
14 | 15 | #include <linux/module.h> |
---|
15 | 16 | #include <linux/fs.h> |
---|
| 17 | +#include <linux/fs_context.h> |
---|
16 | 18 | #include <linux/magic.h> |
---|
17 | 19 | |
---|
18 | 20 | #include <xen/xen.h> |
---|
.. | .. |
---|
42 | 44 | .llseek = default_llseek, |
---|
43 | 45 | }; |
---|
44 | 46 | |
---|
45 | | -static int xenfs_fill_super(struct super_block *sb, void *data, int silent) |
---|
| 47 | +static int xenfs_fill_super(struct super_block *sb, struct fs_context *fc) |
---|
46 | 48 | { |
---|
47 | 49 | static const struct tree_descr xenfs_files[] = { |
---|
48 | 50 | [2] = { "xenbus", &xen_xenbus_fops, S_IRUSR|S_IWUSR }, |
---|
.. | .. |
---|
67 | 69 | xen_initial_domain() ? xenfs_init_files : xenfs_files); |
---|
68 | 70 | } |
---|
69 | 71 | |
---|
70 | | -static struct dentry *xenfs_mount(struct file_system_type *fs_type, |
---|
71 | | - int flags, const char *dev_name, |
---|
72 | | - void *data) |
---|
| 72 | +static int xenfs_get_tree(struct fs_context *fc) |
---|
73 | 73 | { |
---|
74 | | - return mount_single(fs_type, flags, data, xenfs_fill_super); |
---|
| 74 | + return get_tree_single(fc, xenfs_fill_super); |
---|
| 75 | +} |
---|
| 76 | + |
---|
| 77 | +static const struct fs_context_operations xenfs_context_ops = { |
---|
| 78 | + .get_tree = xenfs_get_tree, |
---|
| 79 | +}; |
---|
| 80 | + |
---|
| 81 | +static int xenfs_init_fs_context(struct fs_context *fc) |
---|
| 82 | +{ |
---|
| 83 | + fc->ops = &xenfs_context_ops; |
---|
| 84 | + return 0; |
---|
75 | 85 | } |
---|
76 | 86 | |
---|
77 | 87 | static struct file_system_type xenfs_type = { |
---|
78 | 88 | .owner = THIS_MODULE, |
---|
79 | 89 | .name = "xenfs", |
---|
80 | | - .mount = xenfs_mount, |
---|
| 90 | + .init_fs_context = xenfs_init_fs_context, |
---|
81 | 91 | .kill_sb = kill_litter_super, |
---|
82 | 92 | }; |
---|
83 | 93 | MODULE_ALIAS_FS("xenfs"); |
---|