blob: dd733e3be9420456c852993dfb65029d1fbe43f0 [file] [log] [blame]
Elliott Hughes180edef2023-11-02 00:08:05 +00001/*
2 * This file is auto-generated. Modifications will be lost.
3 *
4 * See https://android.googlesource.com/platform/bionic/+/master/libc/kernel/
5 * for more information.
6 */
Ben Cheng655a7c02013-10-16 16:09:24 -07007#ifndef _LINUX_FUSE_H
8#define _LINUX_FUSE_H
9#include <stdint.h>
10#define FUSE_KERNEL_VERSION 7
Christopher Ferris67d1e5e2023-10-31 13:36:37 -070011#define FUSE_KERNEL_MINOR_VERSION 39
Ben Cheng655a7c02013-10-16 16:09:24 -070012#define FUSE_ROOT_ID 1
13struct fuse_attr {
Tao Baod7db5942015-01-28 10:07:51 -080014 uint64_t ino;
Tao Baod7db5942015-01-28 10:07:51 -080015 uint64_t size;
16 uint64_t blocks;
17 uint64_t atime;
18 uint64_t mtime;
Tao Baod7db5942015-01-28 10:07:51 -080019 uint64_t ctime;
20 uint32_t atimensec;
21 uint32_t mtimensec;
22 uint32_t ctimensec;
Tao Baod7db5942015-01-28 10:07:51 -080023 uint32_t mode;
24 uint32_t nlink;
25 uint32_t uid;
26 uint32_t gid;
Tao Baod7db5942015-01-28 10:07:51 -080027 uint32_t rdev;
28 uint32_t blksize;
Christopher Ferris32ff3f82020-12-14 13:10:04 -080029 uint32_t flags;
Ben Cheng655a7c02013-10-16 16:09:24 -070030};
Christopher Ferris67d1e5e2023-10-31 13:36:37 -070031struct fuse_sx_time {
32 int64_t tv_sec;
33 uint32_t tv_nsec;
34 int32_t __reserved;
35};
36struct fuse_statx {
37 uint32_t mask;
38 uint32_t blksize;
39 uint64_t attributes;
40 uint32_t nlink;
41 uint32_t uid;
42 uint32_t gid;
43 uint16_t mode;
44 uint16_t __spare0[1];
45 uint64_t ino;
46 uint64_t size;
47 uint64_t blocks;
48 uint64_t attributes_mask;
49 struct fuse_sx_time atime;
50 struct fuse_sx_time btime;
51 struct fuse_sx_time ctime;
52 struct fuse_sx_time mtime;
53 uint32_t rdev_major;
54 uint32_t rdev_minor;
55 uint32_t dev_major;
56 uint32_t dev_minor;
57 uint64_t __spare2[14];
58};
Ben Cheng655a7c02013-10-16 16:09:24 -070059struct fuse_kstatfs {
Tao Baod7db5942015-01-28 10:07:51 -080060 uint64_t blocks;
61 uint64_t bfree;
62 uint64_t bavail;
Tao Baod7db5942015-01-28 10:07:51 -080063 uint64_t files;
64 uint64_t ffree;
65 uint32_t bsize;
66 uint32_t namelen;
Tao Baod7db5942015-01-28 10:07:51 -080067 uint32_t frsize;
68 uint32_t padding;
69 uint32_t spare[6];
Ben Cheng655a7c02013-10-16 16:09:24 -070070};
Ben Cheng655a7c02013-10-16 16:09:24 -070071struct fuse_file_lock {
Tao Baod7db5942015-01-28 10:07:51 -080072 uint64_t start;
73 uint64_t end;
74 uint32_t type;
Tao Baod7db5942015-01-28 10:07:51 -080075 uint32_t pid;
Ben Cheng655a7c02013-10-16 16:09:24 -070076};
77#define FATTR_MODE (1 << 0)
78#define FATTR_UID (1 << 1)
Ben Cheng655a7c02013-10-16 16:09:24 -070079#define FATTR_GID (1 << 2)
80#define FATTR_SIZE (1 << 3)
81#define FATTR_ATIME (1 << 4)
82#define FATTR_MTIME (1 << 5)
Ben Cheng655a7c02013-10-16 16:09:24 -070083#define FATTR_FH (1 << 6)
84#define FATTR_ATIME_NOW (1 << 7)
85#define FATTR_MTIME_NOW (1 << 8)
86#define FATTR_LOCKOWNER (1 << 9)
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070087#define FATTR_CTIME (1 << 10)
Christopher Ferris05667cd2021-02-16 16:01:34 -080088#define FATTR_KILL_SUIDGID (1 << 11)
Ben Cheng655a7c02013-10-16 16:09:24 -070089#define FOPEN_DIRECT_IO (1 << 0)
90#define FOPEN_KEEP_CACHE (1 << 1)
91#define FOPEN_NONSEEKABLE (1 << 2)
Christopher Ferris86a48372019-01-10 14:14:59 -080092#define FOPEN_CACHE_DIR (1 << 3)
Christopher Ferrisaeddbcf2019-07-08 12:45:46 -070093#define FOPEN_STREAM (1 << 4)
Christopher Ferrisa4792612022-01-10 13:51:15 -080094#define FOPEN_NOFLUSH (1 << 5)
Christopher Ferris8b7fdc92023-02-21 13:36:32 -080095#define FOPEN_PARALLEL_DIRECT_WRITES (1 << 6)
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070096#define FUSE_ASYNC_READ (1 << 0)
Ben Cheng655a7c02013-10-16 16:09:24 -070097#define FUSE_POSIX_LOCKS (1 << 1)
98#define FUSE_FILE_OPS (1 << 2)
99#define FUSE_ATOMIC_O_TRUNC (1 << 3)
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700100#define FUSE_EXPORT_SUPPORT (1 << 4)
Ben Cheng655a7c02013-10-16 16:09:24 -0700101#define FUSE_BIG_WRITES (1 << 5)
102#define FUSE_DONT_MASK (1 << 6)
103#define FUSE_SPLICE_WRITE (1 << 7)
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700104#define FUSE_SPLICE_MOVE (1 << 8)
Ben Cheng655a7c02013-10-16 16:09:24 -0700105#define FUSE_SPLICE_READ (1 << 9)
106#define FUSE_FLOCK_LOCKS (1 << 10)
107#define FUSE_HAS_IOCTL_DIR (1 << 11)
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700108#define FUSE_AUTO_INVAL_DATA (1 << 12)
Ben Cheng655a7c02013-10-16 16:09:24 -0700109#define FUSE_DO_READDIRPLUS (1 << 13)
110#define FUSE_READDIRPLUS_AUTO (1 << 14)
111#define FUSE_ASYNC_DIO (1 << 15)
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700112#define FUSE_WRITEBACK_CACHE (1 << 16)
113#define FUSE_NO_OPEN_SUPPORT (1 << 17)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700114#define FUSE_PARALLEL_DIROPS (1 << 18)
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800115#define FUSE_HANDLE_KILLPRIV (1 << 19)
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800116#define FUSE_POSIX_ACL (1 << 20)
Christopher Ferris9ce28842018-10-25 12:11:39 -0700117#define FUSE_ABORT_ERROR (1 << 21)
Christopher Ferris86a48372019-01-10 14:14:59 -0800118#define FUSE_MAX_PAGES (1 << 22)
119#define FUSE_CACHE_SYMLINKS (1 << 23)
Christopher Ferris24f97eb2019-05-20 12:58:13 -0700120#define FUSE_NO_OPENDIR_SUPPORT (1 << 24)
Christopher Ferrisaeddbcf2019-07-08 12:45:46 -0700121#define FUSE_EXPLICIT_INVAL_DATA (1 << 25)
Christopher Ferris9584fa42019-12-09 15:36:13 -0800122#define FUSE_MAP_ALIGNMENT (1 << 26)
Christopher Ferris32ff3f82020-12-14 13:10:04 -0800123#define FUSE_SUBMOUNTS (1 << 27)
Christopher Ferris05667cd2021-02-16 16:01:34 -0800124#define FUSE_HANDLE_KILLPRIV_V2 (1 << 28)
Christopher Ferrisfcc3b4f2021-07-01 01:30:21 +0000125#define FUSE_SETXATTR_EXT (1 << 29)
Christopher Ferris1ed55342022-03-22 16:06:25 -0700126#define FUSE_INIT_EXT (1 << 30)
127#define FUSE_INIT_RESERVED (1 << 31)
128#define FUSE_SECURITY_CTX (1ULL << 32)
129#define FUSE_HAS_INODE_DAX (1ULL << 33)
Christopher Ferrisb7cef6d2023-05-09 19:04:15 +0000130#define FUSE_CREATE_SUPP_GROUP (1ULL << 34)
Christopher Ferris8666d042023-09-06 14:55:31 -0700131#define FUSE_HAS_EXPIRE_ONLY (1ULL << 35)
Christopher Ferris67d1e5e2023-10-31 13:36:37 -0700132#define FUSE_DIRECT_IO_RELAX (1ULL << 36)
Christopher Ferris1ed55342022-03-22 16:06:25 -0700133#if FUSE_KERNEL_VERSION > 7 || FUSE_KERNEL_VERSION == 7 && FUSE_KERNEL_MINOR_VERSION >= 36
134#define FUSE_PASSTHROUGH (1ULL << 63)
135#else
Christopher Ferris32ff3f82020-12-14 13:10:04 -0800136#define FUSE_PASSTHROUGH (1 << 31)
Christopher Ferris1ed55342022-03-22 16:06:25 -0700137#endif
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800138#define CUSE_UNRESTRICTED_IOCTL (1 << 0)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700139#define FUSE_RELEASE_FLUSH (1 << 0)
Ben Cheng655a7c02013-10-16 16:09:24 -0700140#define FUSE_RELEASE_FLOCK_UNLOCK (1 << 1)
141#define FUSE_GETATTR_FH (1 << 0)
142#define FUSE_LK_FLOCK (1 << 0)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700143#define FUSE_WRITE_CACHE (1 << 0)
Ben Cheng655a7c02013-10-16 16:09:24 -0700144#define FUSE_WRITE_LOCKOWNER (1 << 1)
Christopher Ferris05667cd2021-02-16 16:01:34 -0800145#define FUSE_WRITE_KILL_SUIDGID (1 << 2)
146#define FUSE_WRITE_KILL_PRIV FUSE_WRITE_KILL_SUIDGID
Ben Cheng655a7c02013-10-16 16:09:24 -0700147#define FUSE_READ_LOCKOWNER (1 << 1)
148#define FUSE_IOCTL_COMPAT (1 << 0)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700149#define FUSE_IOCTL_UNRESTRICTED (1 << 1)
Ben Cheng655a7c02013-10-16 16:09:24 -0700150#define FUSE_IOCTL_RETRY (1 << 2)
151#define FUSE_IOCTL_32BIT (1 << 3)
152#define FUSE_IOCTL_DIR (1 << 4)
Christopher Ferrisaeddbcf2019-07-08 12:45:46 -0700153#define FUSE_IOCTL_COMPAT_X32 (1 << 5)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700154#define FUSE_IOCTL_MAX_IOV 256
Ben Cheng655a7c02013-10-16 16:09:24 -0700155#define FUSE_POLL_SCHEDULE_NOTIFY (1 << 0)
Christopher Ferrisaeddbcf2019-07-08 12:45:46 -0700156#define FUSE_FSYNC_FDATASYNC (1 << 0)
Christopher Ferris32ff3f82020-12-14 13:10:04 -0800157#define FUSE_ATTR_SUBMOUNT (1 << 0)
Christopher Ferris1ed55342022-03-22 16:06:25 -0700158#define FUSE_ATTR_DAX (1 << 1)
Christopher Ferris05667cd2021-02-16 16:01:34 -0800159#define FUSE_OPEN_KILL_SUIDGID (1 << 0)
Christopher Ferrisfcc3b4f2021-07-01 01:30:21 +0000160#define FUSE_SETXATTR_ACL_KILL_SGID (1 << 0)
Christopher Ferris8b7fdc92023-02-21 13:36:32 -0800161#define FUSE_EXPIRE_ONLY (1 << 0)
Christopher Ferrisb7cef6d2023-05-09 19:04:15 +0000162enum fuse_ext_type {
163 FUSE_MAX_NR_SECCTX = 31,
164 FUSE_EXT_GROUPS = 32,
165};
Ben Cheng655a7c02013-10-16 16:09:24 -0700166enum fuse_opcode {
Tao Baod7db5942015-01-28 10:07:51 -0800167 FUSE_LOOKUP = 1,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700168 FUSE_FORGET = 2,
Tao Baod7db5942015-01-28 10:07:51 -0800169 FUSE_GETATTR = 3,
170 FUSE_SETATTR = 4,
171 FUSE_READLINK = 5,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700172 FUSE_SYMLINK = 6,
Tao Baod7db5942015-01-28 10:07:51 -0800173 FUSE_MKNOD = 8,
174 FUSE_MKDIR = 9,
175 FUSE_UNLINK = 10,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700176 FUSE_RMDIR = 11,
Tao Baod7db5942015-01-28 10:07:51 -0800177 FUSE_RENAME = 12,
178 FUSE_LINK = 13,
179 FUSE_OPEN = 14,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700180 FUSE_READ = 15,
Tao Baod7db5942015-01-28 10:07:51 -0800181 FUSE_WRITE = 16,
182 FUSE_STATFS = 17,
183 FUSE_RELEASE = 18,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700184 FUSE_FSYNC = 20,
Tao Baod7db5942015-01-28 10:07:51 -0800185 FUSE_SETXATTR = 21,
186 FUSE_GETXATTR = 22,
187 FUSE_LISTXATTR = 23,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700188 FUSE_REMOVEXATTR = 24,
Tao Baod7db5942015-01-28 10:07:51 -0800189 FUSE_FLUSH = 25,
190 FUSE_INIT = 26,
191 FUSE_OPENDIR = 27,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700192 FUSE_READDIR = 28,
Tao Baod7db5942015-01-28 10:07:51 -0800193 FUSE_RELEASEDIR = 29,
194 FUSE_FSYNCDIR = 30,
195 FUSE_GETLK = 31,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700196 FUSE_SETLK = 32,
Tao Baod7db5942015-01-28 10:07:51 -0800197 FUSE_SETLKW = 33,
198 FUSE_ACCESS = 34,
199 FUSE_CREATE = 35,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700200 FUSE_INTERRUPT = 36,
Tao Baod7db5942015-01-28 10:07:51 -0800201 FUSE_BMAP = 37,
202 FUSE_DESTROY = 38,
203 FUSE_IOCTL = 39,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700204 FUSE_POLL = 40,
Tao Baod7db5942015-01-28 10:07:51 -0800205 FUSE_NOTIFY_REPLY = 41,
206 FUSE_BATCH_FORGET = 42,
207 FUSE_FALLOCATE = 43,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700208 FUSE_READDIRPLUS = 44,
Tao Baod7db5942015-01-28 10:07:51 -0800209 FUSE_RENAME2 = 45,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700210 FUSE_LSEEK = 46,
Christopher Ferris86a48372019-01-10 14:14:59 -0800211 FUSE_COPY_FILE_RANGE = 47,
Christopher Ferris9584fa42019-12-09 15:36:13 -0800212 FUSE_SETUPMAPPING = 48,
213 FUSE_REMOVEMAPPING = 49,
Christopher Ferris3a39c0b2021-09-02 00:03:38 +0000214 FUSE_SYNCFS = 50,
Christopher Ferris6cd53a52022-12-12 23:39:16 +0000215 FUSE_TMPFILE = 51,
Christopher Ferris67d1e5e2023-10-31 13:36:37 -0700216 FUSE_STATX = 52,
Christopher Ferris32ff3f82020-12-14 13:10:04 -0800217 FUSE_CANONICAL_PATH = 2016,
Tao Baod7db5942015-01-28 10:07:51 -0800218 CUSE_INIT = 4096,
Christopher Ferris9584fa42019-12-09 15:36:13 -0800219 CUSE_INIT_BSWAP_RESERVED = 1048576,
220 FUSE_INIT_BSWAP_RESERVED = 436207616,
Ben Cheng655a7c02013-10-16 16:09:24 -0700221};
222enum fuse_notify_code {
Tao Baod7db5942015-01-28 10:07:51 -0800223 FUSE_NOTIFY_POLL = 1,
224 FUSE_NOTIFY_INVAL_INODE = 2,
225 FUSE_NOTIFY_INVAL_ENTRY = 3,
226 FUSE_NOTIFY_STORE = 4,
Tao Baod7db5942015-01-28 10:07:51 -0800227 FUSE_NOTIFY_RETRIEVE = 5,
228 FUSE_NOTIFY_DELETE = 6,
229 FUSE_NOTIFY_CODE_MAX,
Ben Cheng655a7c02013-10-16 16:09:24 -0700230};
Ben Cheng655a7c02013-10-16 16:09:24 -0700231#define FUSE_MIN_READ_BUFFER 8192
232#define FUSE_COMPAT_ENTRY_OUT_SIZE 120
233struct fuse_entry_out {
Tao Baod7db5942015-01-28 10:07:51 -0800234 uint64_t nodeid;
Tao Baod7db5942015-01-28 10:07:51 -0800235 uint64_t generation;
236 uint64_t entry_valid;
237 uint64_t attr_valid;
238 uint32_t entry_valid_nsec;
Tao Baod7db5942015-01-28 10:07:51 -0800239 uint32_t attr_valid_nsec;
240 struct fuse_attr attr;
Ben Cheng655a7c02013-10-16 16:09:24 -0700241};
242struct fuse_forget_in {
Tao Baod7db5942015-01-28 10:07:51 -0800243 uint64_t nlookup;
Ben Cheng655a7c02013-10-16 16:09:24 -0700244};
245struct fuse_forget_one {
Tao Baod7db5942015-01-28 10:07:51 -0800246 uint64_t nodeid;
Tao Baod7db5942015-01-28 10:07:51 -0800247 uint64_t nlookup;
Ben Cheng655a7c02013-10-16 16:09:24 -0700248};
249struct fuse_batch_forget_in {
Tao Baod7db5942015-01-28 10:07:51 -0800250 uint32_t count;
Tao Baod7db5942015-01-28 10:07:51 -0800251 uint32_t dummy;
Ben Cheng655a7c02013-10-16 16:09:24 -0700252};
253struct fuse_getattr_in {
Tao Baod7db5942015-01-28 10:07:51 -0800254 uint32_t getattr_flags;
Tao Baod7db5942015-01-28 10:07:51 -0800255 uint32_t dummy;
256 uint64_t fh;
Ben Cheng655a7c02013-10-16 16:09:24 -0700257};
258#define FUSE_COMPAT_ATTR_OUT_SIZE 96
Ben Cheng655a7c02013-10-16 16:09:24 -0700259struct fuse_attr_out {
Tao Baod7db5942015-01-28 10:07:51 -0800260 uint64_t attr_valid;
261 uint32_t attr_valid_nsec;
262 uint32_t dummy;
Tao Baod7db5942015-01-28 10:07:51 -0800263 struct fuse_attr attr;
Ben Cheng655a7c02013-10-16 16:09:24 -0700264};
Christopher Ferris67d1e5e2023-10-31 13:36:37 -0700265struct fuse_statx_in {
266 uint32_t getattr_flags;
267 uint32_t reserved;
268 uint64_t fh;
269 uint32_t sx_flags;
270 uint32_t sx_mask;
271};
272struct fuse_statx_out {
273 uint64_t attr_valid;
274 uint32_t attr_valid_nsec;
275 uint32_t flags;
276 uint64_t spare[2];
277 struct fuse_statx stat;
278};
Ben Cheng655a7c02013-10-16 16:09:24 -0700279#define FUSE_COMPAT_MKNOD_IN_SIZE 8
280struct fuse_mknod_in {
Tao Baod7db5942015-01-28 10:07:51 -0800281 uint32_t mode;
282 uint32_t rdev;
283 uint32_t umask;
284 uint32_t padding;
Ben Cheng655a7c02013-10-16 16:09:24 -0700285};
286struct fuse_mkdir_in {
Tao Baod7db5942015-01-28 10:07:51 -0800287 uint32_t mode;
288 uint32_t umask;
Ben Cheng655a7c02013-10-16 16:09:24 -0700289};
290struct fuse_rename_in {
Tao Baod7db5942015-01-28 10:07:51 -0800291 uint64_t newdir;
Ben Cheng655a7c02013-10-16 16:09:24 -0700292};
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700293struct fuse_rename2_in {
Tao Baod7db5942015-01-28 10:07:51 -0800294 uint64_t newdir;
295 uint32_t flags;
296 uint32_t padding;
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700297};
Ben Cheng655a7c02013-10-16 16:09:24 -0700298struct fuse_link_in {
Tao Baod7db5942015-01-28 10:07:51 -0800299 uint64_t oldnodeid;
Ben Cheng655a7c02013-10-16 16:09:24 -0700300};
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700301struct fuse_setattr_in {
Tao Baod7db5942015-01-28 10:07:51 -0800302 uint32_t valid;
303 uint32_t padding;
304 uint64_t fh;
Tao Baod7db5942015-01-28 10:07:51 -0800305 uint64_t size;
306 uint64_t lock_owner;
307 uint64_t atime;
308 uint64_t mtime;
Tao Baod7db5942015-01-28 10:07:51 -0800309 uint64_t ctime;
310 uint32_t atimensec;
311 uint32_t mtimensec;
312 uint32_t ctimensec;
Tao Baod7db5942015-01-28 10:07:51 -0800313 uint32_t mode;
314 uint32_t unused4;
315 uint32_t uid;
316 uint32_t gid;
Tao Baod7db5942015-01-28 10:07:51 -0800317 uint32_t unused5;
Ben Cheng655a7c02013-10-16 16:09:24 -0700318};
319struct fuse_open_in {
Tao Baod7db5942015-01-28 10:07:51 -0800320 uint32_t flags;
Christopher Ferris05667cd2021-02-16 16:01:34 -0800321 uint32_t open_flags;
Ben Cheng655a7c02013-10-16 16:09:24 -0700322};
323struct fuse_create_in {
Tao Baod7db5942015-01-28 10:07:51 -0800324 uint32_t flags;
Tao Baod7db5942015-01-28 10:07:51 -0800325 uint32_t mode;
326 uint32_t umask;
Christopher Ferris05667cd2021-02-16 16:01:34 -0800327 uint32_t open_flags;
Ben Cheng655a7c02013-10-16 16:09:24 -0700328};
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700329struct fuse_open_out {
Tao Baod7db5942015-01-28 10:07:51 -0800330 uint64_t fh;
331 uint32_t open_flags;
Christopher Ferris32ff3f82020-12-14 13:10:04 -0800332 uint32_t passthrough_fh;
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700333};
Ben Cheng655a7c02013-10-16 16:09:24 -0700334struct fuse_release_in {
Tao Baod7db5942015-01-28 10:07:51 -0800335 uint64_t fh;
336 uint32_t flags;
Tao Baod7db5942015-01-28 10:07:51 -0800337 uint32_t release_flags;
338 uint64_t lock_owner;
Ben Cheng655a7c02013-10-16 16:09:24 -0700339};
340struct fuse_flush_in {
Tao Baod7db5942015-01-28 10:07:51 -0800341 uint64_t fh;
342 uint32_t unused;
343 uint32_t padding;
344 uint64_t lock_owner;
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700345};
Ben Cheng655a7c02013-10-16 16:09:24 -0700346struct fuse_read_in {
Tao Baod7db5942015-01-28 10:07:51 -0800347 uint64_t fh;
348 uint64_t offset;
Tao Baod7db5942015-01-28 10:07:51 -0800349 uint32_t size;
350 uint32_t read_flags;
351 uint64_t lock_owner;
352 uint32_t flags;
Tao Baod7db5942015-01-28 10:07:51 -0800353 uint32_t padding;
Ben Cheng655a7c02013-10-16 16:09:24 -0700354};
355#define FUSE_COMPAT_WRITE_IN_SIZE 24
356struct fuse_write_in {
Tao Baod7db5942015-01-28 10:07:51 -0800357 uint64_t fh;
358 uint64_t offset;
359 uint32_t size;
360 uint32_t write_flags;
Tao Baod7db5942015-01-28 10:07:51 -0800361 uint64_t lock_owner;
362 uint32_t flags;
363 uint32_t padding;
Ben Cheng655a7c02013-10-16 16:09:24 -0700364};
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700365struct fuse_write_out {
Tao Baod7db5942015-01-28 10:07:51 -0800366 uint32_t size;
367 uint32_t padding;
Ben Cheng655a7c02013-10-16 16:09:24 -0700368};
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700369#define FUSE_COMPAT_STATFS_SIZE 48
Ben Cheng655a7c02013-10-16 16:09:24 -0700370struct fuse_statfs_out {
Tao Baod7db5942015-01-28 10:07:51 -0800371 struct fuse_kstatfs st;
Ben Cheng655a7c02013-10-16 16:09:24 -0700372};
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700373struct fuse_fsync_in {
Tao Baod7db5942015-01-28 10:07:51 -0800374 uint64_t fh;
375 uint32_t fsync_flags;
376 uint32_t padding;
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700377};
Christopher Ferrisfcc3b4f2021-07-01 01:30:21 +0000378#define FUSE_COMPAT_SETXATTR_IN_SIZE 8
Ben Cheng655a7c02013-10-16 16:09:24 -0700379struct fuse_setxattr_in {
Tao Baod7db5942015-01-28 10:07:51 -0800380 uint32_t size;
381 uint32_t flags;
Christopher Ferrisfcc3b4f2021-07-01 01:30:21 +0000382 uint32_t setxattr_flags;
383 uint32_t padding;
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700384};
Ben Cheng655a7c02013-10-16 16:09:24 -0700385struct fuse_getxattr_in {
Tao Baod7db5942015-01-28 10:07:51 -0800386 uint32_t size;
387 uint32_t padding;
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700388};
Ben Cheng655a7c02013-10-16 16:09:24 -0700389struct fuse_getxattr_out {
Tao Baod7db5942015-01-28 10:07:51 -0800390 uint32_t size;
391 uint32_t padding;
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700392};
Ben Cheng655a7c02013-10-16 16:09:24 -0700393struct fuse_lk_in {
Tao Baod7db5942015-01-28 10:07:51 -0800394 uint64_t fh;
395 uint64_t owner;
Tao Baod7db5942015-01-28 10:07:51 -0800396 struct fuse_file_lock lk;
397 uint32_t lk_flags;
398 uint32_t padding;
Ben Cheng655a7c02013-10-16 16:09:24 -0700399};
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700400struct fuse_lk_out {
Tao Baod7db5942015-01-28 10:07:51 -0800401 struct fuse_file_lock lk;
Ben Cheng655a7c02013-10-16 16:09:24 -0700402};
403struct fuse_access_in {
Tao Baod7db5942015-01-28 10:07:51 -0800404 uint32_t mask;
405 uint32_t padding;
Ben Cheng655a7c02013-10-16 16:09:24 -0700406};
407struct fuse_init_in {
Tao Baod7db5942015-01-28 10:07:51 -0800408 uint32_t major;
409 uint32_t minor;
410 uint32_t max_readahead;
411 uint32_t flags;
Christopher Ferris1ed55342022-03-22 16:06:25 -0700412 uint32_t flags2;
413 uint32_t unused[11];
Ben Cheng655a7c02013-10-16 16:09:24 -0700414};
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700415#define FUSE_COMPAT_INIT_OUT_SIZE 8
416#define FUSE_COMPAT_22_INIT_OUT_SIZE 24
Ben Cheng655a7c02013-10-16 16:09:24 -0700417struct fuse_init_out {
Tao Baod7db5942015-01-28 10:07:51 -0800418 uint32_t major;
419 uint32_t minor;
420 uint32_t max_readahead;
421 uint32_t flags;
Tao Baod7db5942015-01-28 10:07:51 -0800422 uint16_t max_background;
423 uint16_t congestion_threshold;
424 uint32_t max_write;
425 uint32_t time_gran;
Christopher Ferris86a48372019-01-10 14:14:59 -0800426 uint16_t max_pages;
Christopher Ferris9584fa42019-12-09 15:36:13 -0800427 uint16_t map_alignment;
Christopher Ferris1ed55342022-03-22 16:06:25 -0700428 uint32_t flags2;
429 uint32_t unused[7];
Ben Cheng655a7c02013-10-16 16:09:24 -0700430};
431#define CUSE_INIT_INFO_MAX 4096
432struct cuse_init_in {
Tao Baod7db5942015-01-28 10:07:51 -0800433 uint32_t major;
434 uint32_t minor;
435 uint32_t unused;
436 uint32_t flags;
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700437};
Ben Cheng655a7c02013-10-16 16:09:24 -0700438struct cuse_init_out {
Tao Baod7db5942015-01-28 10:07:51 -0800439 uint32_t major;
440 uint32_t minor;
Tao Baod7db5942015-01-28 10:07:51 -0800441 uint32_t unused;
442 uint32_t flags;
443 uint32_t max_read;
444 uint32_t max_write;
Tao Baod7db5942015-01-28 10:07:51 -0800445 uint32_t dev_major;
446 uint32_t dev_minor;
447 uint32_t spare[10];
Ben Cheng655a7c02013-10-16 16:09:24 -0700448};
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700449struct fuse_interrupt_in {
Tao Baod7db5942015-01-28 10:07:51 -0800450 uint64_t unique;
Ben Cheng655a7c02013-10-16 16:09:24 -0700451};
452struct fuse_bmap_in {
Tao Baod7db5942015-01-28 10:07:51 -0800453 uint64_t block;
454 uint32_t blocksize;
455 uint32_t padding;
Ben Cheng655a7c02013-10-16 16:09:24 -0700456};
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700457struct fuse_bmap_out {
Tao Baod7db5942015-01-28 10:07:51 -0800458 uint64_t block;
Ben Cheng655a7c02013-10-16 16:09:24 -0700459};
460struct fuse_ioctl_in {
Tao Baod7db5942015-01-28 10:07:51 -0800461 uint64_t fh;
462 uint32_t flags;
463 uint32_t cmd;
464 uint64_t arg;
Tao Baod7db5942015-01-28 10:07:51 -0800465 uint32_t in_size;
466 uint32_t out_size;
Ben Cheng655a7c02013-10-16 16:09:24 -0700467};
468struct fuse_ioctl_iovec {
Tao Baod7db5942015-01-28 10:07:51 -0800469 uint64_t base;
470 uint64_t len;
Ben Cheng655a7c02013-10-16 16:09:24 -0700471};
472struct fuse_ioctl_out {
Tao Baod7db5942015-01-28 10:07:51 -0800473 int32_t result;
474 uint32_t flags;
475 uint32_t in_iovs;
476 uint32_t out_iovs;
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700477};
Ben Cheng655a7c02013-10-16 16:09:24 -0700478struct fuse_poll_in {
Tao Baod7db5942015-01-28 10:07:51 -0800479 uint64_t fh;
480 uint64_t kh;
Tao Baod7db5942015-01-28 10:07:51 -0800481 uint32_t flags;
482 uint32_t events;
Ben Cheng655a7c02013-10-16 16:09:24 -0700483};
484struct fuse_poll_out {
Tao Baod7db5942015-01-28 10:07:51 -0800485 uint32_t revents;
486 uint32_t padding;
Ben Cheng655a7c02013-10-16 16:09:24 -0700487};
488struct fuse_notify_poll_wakeup_out {
Tao Baod7db5942015-01-28 10:07:51 -0800489 uint64_t kh;
Ben Cheng655a7c02013-10-16 16:09:24 -0700490};
491struct fuse_fallocate_in {
Tao Baod7db5942015-01-28 10:07:51 -0800492 uint64_t fh;
Tao Baod7db5942015-01-28 10:07:51 -0800493 uint64_t offset;
494 uint64_t length;
495 uint32_t mode;
496 uint32_t padding;
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700497};
Ben Cheng655a7c02013-10-16 16:09:24 -0700498struct fuse_in_header {
Tao Baod7db5942015-01-28 10:07:51 -0800499 uint32_t len;
500 uint32_t opcode;
Tao Baod7db5942015-01-28 10:07:51 -0800501 uint64_t unique;
502 uint64_t nodeid;
503 uint32_t uid;
504 uint32_t gid;
Tao Baod7db5942015-01-28 10:07:51 -0800505 uint32_t pid;
Christopher Ferrisb7cef6d2023-05-09 19:04:15 +0000506 uint16_t total_extlen;
507 uint16_t padding;
Ben Cheng655a7c02013-10-16 16:09:24 -0700508};
509struct fuse_out_header {
Tao Baod7db5942015-01-28 10:07:51 -0800510 uint32_t len;
511 int32_t error;
512 uint64_t unique;
Ben Cheng655a7c02013-10-16 16:09:24 -0700513};
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700514struct fuse_dirent {
Tao Baod7db5942015-01-28 10:07:51 -0800515 uint64_t ino;
516 uint64_t off;
517 uint32_t namelen;
Tao Baod7db5942015-01-28 10:07:51 -0800518 uint32_t type;
519 char name[];
Ben Cheng655a7c02013-10-16 16:09:24 -0700520};
Christopher Ferris1ed55342022-03-22 16:06:25 -0700521#define FUSE_REC_ALIGN(x) (((x) + sizeof(uint64_t) - 1) & ~(sizeof(uint64_t) - 1))
Ben Cheng655a7c02013-10-16 16:09:24 -0700522#define FUSE_NAME_OFFSET offsetof(struct fuse_dirent, name)
Christopher Ferris1ed55342022-03-22 16:06:25 -0700523#define FUSE_DIRENT_ALIGN(x) FUSE_REC_ALIGN(x)
Tao Baod7db5942015-01-28 10:07:51 -0800524#define FUSE_DIRENT_SIZE(d) FUSE_DIRENT_ALIGN(FUSE_NAME_OFFSET + (d)->namelen)
Ben Cheng655a7c02013-10-16 16:09:24 -0700525struct fuse_direntplus {
Tao Baod7db5942015-01-28 10:07:51 -0800526 struct fuse_entry_out entry_out;
Tao Baod7db5942015-01-28 10:07:51 -0800527 struct fuse_dirent dirent;
Ben Cheng655a7c02013-10-16 16:09:24 -0700528};
Tao Baod7db5942015-01-28 10:07:51 -0800529#define FUSE_NAME_OFFSET_DIRENTPLUS offsetof(struct fuse_direntplus, dirent.name)
530#define FUSE_DIRENTPLUS_SIZE(d) FUSE_DIRENT_ALIGN(FUSE_NAME_OFFSET_DIRENTPLUS + (d)->dirent.namelen)
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700531struct fuse_notify_inval_inode_out {
Tao Baod7db5942015-01-28 10:07:51 -0800532 uint64_t ino;
533 int64_t off;
534 int64_t len;
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700535};
Ben Cheng655a7c02013-10-16 16:09:24 -0700536struct fuse_notify_inval_entry_out {
Tao Baod7db5942015-01-28 10:07:51 -0800537 uint64_t parent;
538 uint32_t namelen;
Christopher Ferris8b7fdc92023-02-21 13:36:32 -0800539 uint32_t flags;
Ben Cheng655a7c02013-10-16 16:09:24 -0700540};
541struct fuse_notify_delete_out {
Tao Baod7db5942015-01-28 10:07:51 -0800542 uint64_t parent;
Tao Baod7db5942015-01-28 10:07:51 -0800543 uint64_t child;
544 uint32_t namelen;
545 uint32_t padding;
Ben Cheng655a7c02013-10-16 16:09:24 -0700546};
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700547struct fuse_notify_store_out {
Tao Baod7db5942015-01-28 10:07:51 -0800548 uint64_t nodeid;
549 uint64_t offset;
550 uint32_t size;
Tao Baod7db5942015-01-28 10:07:51 -0800551 uint32_t padding;
Ben Cheng655a7c02013-10-16 16:09:24 -0700552};
553struct fuse_notify_retrieve_out {
Tao Baod7db5942015-01-28 10:07:51 -0800554 uint64_t notify_unique;
Tao Baod7db5942015-01-28 10:07:51 -0800555 uint64_t nodeid;
556 uint64_t offset;
557 uint32_t size;
558 uint32_t padding;
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700559};
Ben Cheng655a7c02013-10-16 16:09:24 -0700560struct fuse_notify_retrieve_in {
Tao Baod7db5942015-01-28 10:07:51 -0800561 uint64_t dummy1;
562 uint64_t offset;
Tao Baod7db5942015-01-28 10:07:51 -0800563 uint32_t size;
564 uint32_t dummy2;
565 uint64_t dummy3;
566 uint64_t dummy4;
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700567};
Christopher Ferris05667cd2021-02-16 16:01:34 -0800568#define FUSE_DEV_IOC_MAGIC 229
569#define FUSE_DEV_IOC_CLONE _IOR(FUSE_DEV_IOC_MAGIC, 0, uint32_t)
Christopher Ferris1ed55342022-03-22 16:06:25 -0700570#define FUSE_DEV_IOC_PASSTHROUGH_OPEN _IOW(FUSE_DEV_IOC_MAGIC, 126, uint32_t)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700571struct fuse_lseek_in {
572 uint64_t fh;
573 uint64_t offset;
574 uint32_t whence;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700575 uint32_t padding;
576};
577struct fuse_lseek_out {
578 uint64_t offset;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700579};
Christopher Ferris86a48372019-01-10 14:14:59 -0800580struct fuse_copy_file_range_in {
581 uint64_t fh_in;
582 uint64_t off_in;
583 uint64_t nodeid_out;
584 uint64_t fh_out;
585 uint64_t off_out;
586 uint64_t len;
587 uint64_t flags;
588};
Christopher Ferris32ff3f82020-12-14 13:10:04 -0800589#define FUSE_SETUPMAPPING_FLAG_WRITE (1ull << 0)
590#define FUSE_SETUPMAPPING_FLAG_READ (1ull << 1)
591struct fuse_setupmapping_in {
592 uint64_t fh;
593 uint64_t foffset;
594 uint64_t len;
595 uint64_t flags;
596 uint64_t moffset;
597};
598struct fuse_removemapping_in {
599 uint32_t count;
600};
601struct fuse_removemapping_one {
602 uint64_t moffset;
603 uint64_t len;
604};
605#define FUSE_REMOVEMAPPING_MAX_ENTRY (PAGE_SIZE / sizeof(struct fuse_removemapping_one))
Christopher Ferris3a39c0b2021-09-02 00:03:38 +0000606struct fuse_syncfs_in {
607 uint64_t padding;
608};
Christopher Ferris1ed55342022-03-22 16:06:25 -0700609struct fuse_secctx {
610 uint32_t size;
611 uint32_t padding;
612};
613struct fuse_secctx_header {
614 uint32_t size;
615 uint32_t nr_secctx;
616};
Christopher Ferrisb7cef6d2023-05-09 19:04:15 +0000617struct fuse_ext_header {
618 uint32_t size;
619 uint32_t type;
620};
621struct fuse_supp_groups {
622 uint32_t nr_groups;
623 uint32_t groups[];
624};
Ben Cheng655a7c02013-10-16 16:09:24 -0700625#endif