Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

David Howells and committed by
Al Viro
2345771f e5d82a73

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