* [31/38] vfs: Convert gadgetfs to fs_context
@ 2019-03-14 16:13 David Howells
0 siblings, 0 replies; 4+ messages in thread
From: David Howells @ 2019-03-14 16:13 UTC (permalink / raw)
To: viro; +Cc: Felipe Balbi, linux-usb, dhowells, linux-fsdevel, linux-kernel
Signed-off-by: David Howells <dhowells@redhat.com>
cc: Felipe Balbi <balbi@kernel.org>
cc: linux-usb@vger.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");
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [31/38] vfs: Convert gadgetfs to fs_context
@ 2019-03-20 6:57 Felipe Balbi
0 siblings, 0 replies; 4+ messages in thread
From: Felipe Balbi @ 2019-03-20 6:57 UTC (permalink / raw)
To: David Howells, viro; +Cc: linux-usb, linux-fsdevel, linux-kernel
David Howells <dhowells@redhat.com> writes:
> Signed-off-by: David Howells <dhowells@redhat.com>
> cc: Felipe Balbi <balbi@kernel.org>
> cc: linux-usb@vger.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
^ permalink raw reply [flat|nested] 4+ messages in thread
* [31/38] vfs: Convert gadgetfs to fs_context
@ 2019-03-20 7:42 David Howells
0 siblings, 0 replies; 4+ messages in thread
From: David Howells @ 2019-03-20 7:42 UTC (permalink / raw)
To: Felipe Balbi; +Cc: dhowells, viro, linux-usb, linux-fsdevel, linux-kernel
Felipe Balbi <balbi@kernel.org> wrote:
> looks like a mostly mechanical change. Do you want this to go through
> the USB tree or FS tree?
I'm going to try and get all of these to go through the Al's vfs tree since
there are dependent cleanup patches that remove code that's then obsolete.
> Also, do you mind doing the same for drivers/usb/gadget/function/f_fs.c?
Sure. The reason I hadn't already done it is that it doesn't look entirely
trivial.
David
^ permalink raw reply [flat|nested] 4+ messages in thread
* [31/38] vfs: Convert gadgetfs to fs_context
@ 2019-03-20 8:34 Felipe Balbi
0 siblings, 0 replies; 4+ messages in thread
From: Felipe Balbi @ 2019-03-20 8:34 UTC (permalink / raw)
To: David Howells; +Cc: viro, linux-usb, linux-fsdevel, linux-kernel
David Howells <dhowells@redhat.com> writes:
> Felipe Balbi <balbi@kernel.org> wrote:
>
>> looks like a mostly mechanical change. Do you want this to go through
>> the USB tree or FS tree?
>
> I'm going to try and get all of these to go through the Al's vfs tree since
> there are dependent cleanup patches that remove code that's then obsolete.
In that case, here's my ack:
Acked-by: Felipe Balbi <felipe.balbi@linux.intel.com>
>> Also, do you mind doing the same for drivers/usb/gadget/function/f_fs.c?
>
> Sure. The reason I hadn't already done it is that it doesn't look entirely
> trivial.
oh, no rush :-) Just thought I'd mention.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-03-20 8:34 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-03-20 6:57 [31/38] vfs: Convert gadgetfs to fs_context Felipe Balbi
-- strict thread matches above, loose matches on Subject: below --
2019-03-20 8:34 Felipe Balbi
2019-03-20 7:42 David Howells
2019-03-14 16:13 David Howells
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).