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

vfs: Convert gadgetfs to use the new mount API

Convert the gadgetfs 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>
Acked-by: Felipe Balbi <felipe.balbi@linux.intel.com>
cc: linux-usb@vger.kernel.org
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

authored by

David Howells and committed by
Al Viro
e5d82a73 c6a2c720

+15 -6
+15 -6
drivers/usb/gadget/legacy/inode.c
··· 12 12 #include <linux/init.h> 13 13 #include <linux/module.h> 14 14 #include <linux/fs.h> 15 + #include <linux/fs_context.h> 15 16 #include <linux/pagemap.h> 16 17 #include <linux/uts.h> 17 18 #include <linux/wait.h> ··· 1991 1990 }; 1992 1991 1993 1992 static int 1994 - gadgetfs_fill_super (struct super_block *sb, void *opts, int silent) 1993 + gadgetfs_fill_super (struct super_block *sb, struct fs_context *fc) 1995 1994 { 1996 1995 struct inode *inode; 1997 1996 struct dev_data *dev; ··· 2045 2044 } 2046 2045 2047 2046 /* "mount -t gadgetfs path /dev/gadget" ends up here */ 2048 - static struct dentry * 2049 - gadgetfs_mount (struct file_system_type *t, int flags, 2050 - const char *path, void *opts) 2047 + static int gadgetfs_get_tree(struct fs_context *fc) 2051 2048 { 2052 - return mount_single (t, flags, opts, gadgetfs_fill_super); 2049 + return get_tree_single(fc, gadgetfs_fill_super); 2050 + } 2051 + 2052 + static const struct fs_context_operations gadgetfs_context_ops = { 2053 + .get_tree = gadgetfs_get_tree, 2054 + }; 2055 + 2056 + static int gadgetfs_init_fs_context(struct fs_context *fc) 2057 + { 2058 + fc->ops = &gadgetfs_context_ops; 2059 + return 0; 2053 2060 } 2054 2061 2055 2062 static void ··· 2077 2068 static struct file_system_type gadgetfs_type = { 2078 2069 .owner = THIS_MODULE, 2079 2070 .name = shortname, 2080 - .mount = gadgetfs_mount, 2071 + .init_fs_context = gadgetfs_init_fs_context, 2081 2072 .kill_sb = gadgetfs_kill_sb, 2082 2073 }; 2083 2074 MODULE_ALIAS_FS("gadgetfs");