[PATCH RFC v3 32/44] usb: gadget: gadgetfs: use fc_init_pseudo()
Christian Brauner
brauner at kernel.org
Mon Nov 16 03:05:05 PST 2026
Initialize gadgetfs as a pseudo filesystem. This raises SB_I_PSEUDO and
also SB_I_NOEXEC and SB_I_NODEV. gadgetfs never holds executables or
device nodes.
Reviewed-by: Chris Down <chris at chrisdown.name>
Signed-off-by: Christian Brauner (Amutable) <brauner at kernel.org>
---
drivers/usb/gadget/legacy/inode.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/usb/gadget/legacy/inode.c b/drivers/usb/gadget/legacy/inode.c
index 7f6d8460152f9..8490e5d0351e1 100644
--- a/drivers/usb/gadget/legacy/inode.c
+++ b/drivers/usb/gadget/legacy/inode.c
@@ -13,6 +13,7 @@
#include <linux/module.h>
#include <linux/fs.h>
#include <linux/fs_context.h>
+#include <linux/pseudo_fs.h>
#include <linux/pagemap.h>
#include <linux/uts.h>
#include <linux/wait.h>
@@ -2223,6 +2224,7 @@ static const struct fs_context_operations gadgetfs_context_ops = {
static int gadgetfs_init_fs_context(struct fs_context *fc)
{
+ fc_init_pseudo(fc);
fc->ops = &gadgetfs_context_ops;
return 0;
}
--
2.53.0
More information about the Linux-nvme
mailing list