Skip to content

Commit

Permalink
vfs: Convert xenfs to use the new mount API
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
David Howells authored and Al Viro committed Jul 5, 2019
1 parent e5d82a7 commit 2345771
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions drivers/xen/xenfs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include <linux/errno.h>
#include <linux/module.h>
#include <linux/fs.h>
#include <linux/fs_context.h>
#include <linux/magic.h>

#include <xen/xen.h>
Expand Down Expand Up @@ -42,7 +43,7 @@ static const struct file_operations capabilities_file_ops = {
.llseek = default_llseek,
};

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

static struct dentry *xenfs_mount(struct file_system_type *fs_type,
int flags, const char *dev_name,
void *data)
static int xenfs_get_tree(struct fs_context *fc)
{
return mount_single(fs_type, flags, data, xenfs_fill_super);
return get_tree_single(fc, xenfs_fill_super);
}

static const struct fs_context_operations xenfs_context_ops = {
.get_tree = xenfs_get_tree,
};

static int xenfs_init_fs_context(struct fs_context *fc)
{
fc->ops = &xenfs_context_ops;
return 0;
}

static struct file_system_type xenfs_type = {
.owner = THIS_MODULE,
.name = "xenfs",
.mount = xenfs_mount,
.init_fs_context = xenfs_init_fs_context,
.kill_sb = kill_litter_super,
};
MODULE_ALIAS_FS("xenfs");
Expand Down

0 comments on commit 2345771

Please sign in to comment.