[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87o966uj6z.fsf@linux.intel.com>
Date: Wed, 20 Mar 2019 08:57:24 +0200
From: Felipe Balbi <balbi@...nel.org>
To: David Howells <dhowells@...hat.com>, viro@...iv.linux.org.uk
Cc: linux-usb@...r.kernel.org, dhowells@...hat.com,
linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 31/38] vfs: Convert gadgetfs to fs_context
David Howells <dhowells@...hat.com> writes:
> Signed-off-by: David Howells <dhowells@...hat.com>
> cc: Felipe Balbi <balbi@...nel.org>
> cc: linux-usb@...r.kernel.org
> ---
>
> drivers/usb/gadget/legacy/inode.c | 21 +++++++++++++++------
> 1 file changed, 15 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/usb/gadget/legacy/inode.c b/drivers/usb/gadget/legacy/inode.c
> index 249277d0e53f..441da16ffc39 100644
> --- a/drivers/usb/gadget/legacy/inode.c
> +++ b/drivers/usb/gadget/legacy/inode.c
> @@ -12,6 +12,7 @@
> #include <linux/init.h>
> #include <linux/module.h>
> #include <linux/fs.h>
> +#include <linux/fs_context.h>
> #include <linux/pagemap.h>
> #include <linux/uts.h>
> #include <linux/wait.h>
> @@ -1990,7 +1991,7 @@ static const struct super_operations gadget_fs_operations = {
> };
>
> static int
> -gadgetfs_fill_super (struct super_block *sb, void *opts, int silent)
> +gadgetfs_fill_super (struct super_block *sb, struct fs_context *fc)
> {
> struct inode *inode;
> struct dev_data *dev;
> @@ -2044,11 +2045,19 @@ gadgetfs_fill_super (struct super_block *sb, void *opts, int silent)
> }
>
> /* "mount -t gadgetfs path /dev/gadget" ends up here */
> -static struct dentry *
> -gadgetfs_mount (struct file_system_type *t, int flags,
> - const char *path, void *opts)
> +static int gadgetfs_get_tree(struct fs_context *fc)
> {
> - return mount_single (t, flags, opts, gadgetfs_fill_super);
> + return vfs_get_super(fc, vfs_get_single_super, gadgetfs_fill_super);
> +}
> +
> +static const struct fs_context_operations gadgetfs_context_ops = {
> + .get_tree = gadgetfs_get_tree,
> +};
> +
> +static int gadgetfs_init_fs_context(struct fs_context *fc)
> +{
> + fc->ops = &gadgetfs_context_ops;
> + return 0;
> }
>
> static void
> @@ -2068,7 +2077,7 @@ gadgetfs_kill_sb (struct super_block *sb)
> static struct file_system_type gadgetfs_type = {
> .owner = THIS_MODULE,
> .name = shortname,
> - .mount = gadgetfs_mount,
> + .init_fs_context = gadgetfs_init_fs_context,
> .kill_sb = gadgetfs_kill_sb,
> };
> MODULE_ALIAS_FS("gadgetfs");
looks like a mostly mechanical change. Do you want this to go through
the USB tree or FS tree?
Also, do you mind doing the same for drivers/usb/gadget/function/f_fs.c?
cheers
--
balbi
Download attachment "signature.asc" of type "application/pgp-signature" (833 bytes)
Powered by blists - more mailing lists