]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
fuse: split off fuse_args and related definitions into a separate header
authorMiklos Szeredi <mszeredi@redhat.com>
Thu, 26 Mar 2026 13:47:20 +0000 (14:47 +0100)
committerMiklos Szeredi <mszeredi@redhat.com>
Mon, 15 Jun 2026 12:06:17 +0000 (14:06 +0200)
This is going to be used by both layers (transport and filesystem)

Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
fs/fuse/args.h [new file with mode: 0644]
fs/fuse/fuse_i.h

diff --git a/fs/fuse/args.h b/fs/fuse/args.h
new file mode 100644 (file)
index 0000000..12c94ec
--- /dev/null
@@ -0,0 +1,65 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+
+#ifndef _FS_FUSE_ARGS_H
+#define _FS_FUSE_ARGS_H
+
+#include <linux/types.h>
+
+struct fuse_mount;
+
+/** One input argument of a request */
+struct fuse_in_arg {
+       unsigned size;
+       const void *value;
+};
+
+/** One output argument of a request */
+struct fuse_arg {
+       unsigned size;
+       void *value;
+};
+
+struct fuse_args {
+       u64 nodeid;
+       u32 opcode;
+       u32 uid;
+       u32 gid;
+       u32 pid;
+       u8 in_numargs;
+       u8 out_numargs;
+       u8 ext_idx;
+       bool force:1;
+       bool noreply:1;
+       bool nocreds:1;
+       bool in_pages:1;
+       bool out_pages:1;
+       bool user_pages:1;
+       bool out_argvar:1;
+       bool page_zeroing:1;
+       bool page_replace:1;
+       bool may_block:1;
+       bool is_ext:1;
+       bool is_pinned:1;
+       bool invalidate_vmap:1;
+       bool abort_on_kill:1;
+       struct fuse_in_arg in_args[4];
+       struct fuse_arg out_args[2];
+       void (*end)(struct fuse_mount *fm, struct fuse_args *args, int error);
+       /* Used for kvec iter backed by vmalloc address */
+       void *vmap_base;
+};
+
+/** FUSE folio descriptor */
+struct fuse_folio_desc {
+       unsigned int length;
+       unsigned int offset;
+};
+
+struct fuse_args_pages {
+       struct fuse_args args;
+       struct folio **folios;
+       struct fuse_folio_desc *descs;
+       unsigned int num_folios;
+};
+
+#endif /* _FS_FUSE_ARGS_H */
index b8655c3b48e25482866a3859aef604fee048adce..22a6d58678adc29c2fbe45d26c31a6809cb8f52a 100644 (file)
@@ -13,6 +13,7 @@
 # define pr_fmt(fmt) "fuse: " fmt
 #endif
 
+#include "args.h"
 #include <linux/fuse.h>
 #include <linux/fs.h>
 #include <linux/mount.h>
@@ -288,58 +289,6 @@ struct fuse_file {
        bool flock:1;
 };
 
-/** One input argument of a request */
-struct fuse_in_arg {
-       unsigned size;
-       const void *value;
-};
-
-/** One output argument of a request */
-struct fuse_arg {
-       unsigned size;
-       void *value;
-};
-
-/** FUSE folio descriptor */
-struct fuse_folio_desc {
-       unsigned int length;
-       unsigned int offset;
-};
-
-struct fuse_args {
-       uint64_t nodeid;
-       uint32_t opcode;
-       uint8_t in_numargs;
-       uint8_t out_numargs;
-       uint8_t ext_idx;
-       bool force:1;
-       bool noreply:1;
-       bool nocreds:1;
-       bool in_pages:1;
-       bool out_pages:1;
-       bool user_pages:1;
-       bool out_argvar:1;
-       bool page_zeroing:1;
-       bool page_replace:1;
-       bool may_block:1;
-       bool is_ext:1;
-       bool is_pinned:1;
-       bool invalidate_vmap:1;
-       bool abort_on_kill:1;
-       struct fuse_in_arg in_args[4];
-       struct fuse_arg out_args[2];
-       void (*end)(struct fuse_mount *fm, struct fuse_args *args, int error);
-       /* Used for kvec iter backed by vmalloc address */
-       void *vmap_base;
-};
-
-struct fuse_args_pages {
-       struct fuse_args args;
-       struct folio **folios;
-       struct fuse_folio_desc *descs;
-       unsigned int num_folios;
-};
-
 struct fuse_release_args {
        struct fuse_args args;
        struct fuse_release_in inarg;