Skip to content

Commit 2345771

Browse files
dhowellsAl Viro
authored andcommitted
vfs: Convert xenfs to use the new mount API
Convert the xenfs 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> Reviewed-by: Juergen Gross <jgross@suse.com> cc: Boris Ostrovsky <boris.ostrovsky@oracle.com> cc: Stefano Stabellini <sstabellini@kernel.org> cc: xen-devel@lists.xenproject.org Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent e5d82a7 commit 2345771

1 file changed

Lines changed: 15 additions & 6 deletions

File tree

‎drivers/xen/xenfs/super.c‎

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include <linux/errno.h>
1414
#include <linux/module.h>
1515
#include <linux/fs.h>
16+
#include <linux/fs_context.h>
1617
#include <linux/magic.h>
1718

1819
#include <xen/xen.h>
@@ -42,7 +43,7 @@ static const struct file_operations capabilities_file_ops = {
4243
.llseek = default_llseek,
4344
};
4445

45-
static int xenfs_fill_super(struct super_block *sb, void *data, int silent)
46+
static int xenfs_fill_super(struct super_block *sb, struct fs_context *fc)
4647
{
4748
static const struct tree_descr xenfs_files[] = {
4849
[2] = { "xenbus", &xen_xenbus_fops, S_IRUSR|S_IWUSR },
@@ -67,17 +68,25 @@ static int xenfs_fill_super(struct super_block *sb, void *data, int silent)
6768
xen_initial_domain() ? xenfs_init_files : xenfs_files);
6869
}
6970

70-
static struct dentry *xenfs_mount(struct file_system_type *fs_type,
71-
int flags, const char *dev_name,
72-
void *data)
71+
static int xenfs_get_tree(struct fs_context *fc)
7372
{
74-
return mount_single(fs_type, flags, data, xenfs_fill_super);
73+
return get_tree_single(fc, xenfs_fill_super);
74+
}
75+
76+
static const struct fs_context_operations xenfs_context_ops = {
77+
.get_tree = xenfs_get_tree,
78+
};
79+
80+
static int xenfs_init_fs_context(struct fs_context *fc)
81+
{
82+
fc->ops = &xenfs_context_ops;
83+
return 0;
7584
}
7685

7786
static struct file_system_type xenfs_type = {
7887
.owner = THIS_MODULE,
7988
.name = "xenfs",
80-
.mount = xenfs_mount,
89+
.init_fs_context = xenfs_init_fs_context,
8190
.kill_sb = kill_litter_super,
8291
};
8392
MODULE_ALIAS_FS("xenfs");

0 commit comments

Comments
 (0)