blob: 114931eea4e62bbdfb5bc046c6535dffec32c16c [file] [log] [blame]
Ben Cheng655a7c02013-10-16 16:09:24 -07001/****************************************************************************
2 ****************************************************************************
3 ***
4 *** This header was automatically generated from a Linux kernel header
5 *** of the same name, to make information necessary for userspace to
6 *** call into the kernel available to libc. It contains only constants,
7 *** structures, and macros generated from the original header, and thus,
8 *** contains no copyrightable information.
9 ***
10 *** To edit the content of this header, modify the corresponding
11 *** source file (e.g. under external/kernel-headers/original/) then
12 *** run bionic/libc/kernel/tools/update_all.py
13 ***
14 *** Any manual change here will be lost the next time this script will
15 *** be run. You've been warned!
16 ***
17 ****************************************************************************
18 ****************************************************************************/
19#ifndef _LINUX_FUSE_H
20#define _LINUX_FUSE_H
21#include <stdint.h>
22#define FUSE_KERNEL_VERSION 7
Christopher Ferris3a39c0b2021-09-02 00:03:38 +000023#define FUSE_KERNEL_MINOR_VERSION 34
Ben Cheng655a7c02013-10-16 16:09:24 -070024#define FUSE_ROOT_ID 1
25struct fuse_attr {
Tao Baod7db5942015-01-28 10:07:51 -080026 uint64_t ino;
Tao Baod7db5942015-01-28 10:07:51 -080027 uint64_t size;
28 uint64_t blocks;
29 uint64_t atime;
30 uint64_t mtime;
Tao Baod7db5942015-01-28 10:07:51 -080031 uint64_t ctime;
32 uint32_t atimensec;
33 uint32_t mtimensec;
34 uint32_t ctimensec;
Tao Baod7db5942015-01-28 10:07:51 -080035 uint32_t mode;
36 uint32_t nlink;
37 uint32_t uid;
38 uint32_t gid;
Tao Baod7db5942015-01-28 10:07:51 -080039 uint32_t rdev;
40 uint32_t blksize;
Christopher Ferris32ff3f82020-12-14 13:10:04 -080041 uint32_t flags;
Ben Cheng655a7c02013-10-16 16:09:24 -070042};
Ben Cheng655a7c02013-10-16 16:09:24 -070043struct fuse_kstatfs {
Tao Baod7db5942015-01-28 10:07:51 -080044 uint64_t blocks;
45 uint64_t bfree;
46 uint64_t bavail;
Tao Baod7db5942015-01-28 10:07:51 -080047 uint64_t files;
48 uint64_t ffree;
49 uint32_t bsize;
50 uint32_t namelen;
Tao Baod7db5942015-01-28 10:07:51 -080051 uint32_t frsize;
52 uint32_t padding;
53 uint32_t spare[6];
Ben Cheng655a7c02013-10-16 16:09:24 -070054};
Ben Cheng655a7c02013-10-16 16:09:24 -070055struct fuse_file_lock {
Tao Baod7db5942015-01-28 10:07:51 -080056 uint64_t start;
57 uint64_t end;
58 uint32_t type;
Tao Baod7db5942015-01-28 10:07:51 -080059 uint32_t pid;
Ben Cheng655a7c02013-10-16 16:09:24 -070060};
61#define FATTR_MODE (1 << 0)
62#define FATTR_UID (1 << 1)
Ben Cheng655a7c02013-10-16 16:09:24 -070063#define FATTR_GID (1 << 2)
64#define FATTR_SIZE (1 << 3)
65#define FATTR_ATIME (1 << 4)
66#define FATTR_MTIME (1 << 5)
Ben Cheng655a7c02013-10-16 16:09:24 -070067#define FATTR_FH (1 << 6)
68#define FATTR_ATIME_NOW (1 << 7)
69#define FATTR_MTIME_NOW (1 << 8)
70#define FATTR_LOCKOWNER (1 << 9)
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070071#define FATTR_CTIME (1 << 10)
Christopher Ferris05667cd2021-02-16 16:01:34 -080072#define FATTR_KILL_SUIDGID (1 << 11)
Ben Cheng655a7c02013-10-16 16:09:24 -070073#define FOPEN_DIRECT_IO (1 << 0)
74#define FOPEN_KEEP_CACHE (1 << 1)
75#define FOPEN_NONSEEKABLE (1 << 2)
Christopher Ferris86a48372019-01-10 14:14:59 -080076#define FOPEN_CACHE_DIR (1 << 3)
Christopher Ferrisaeddbcf2019-07-08 12:45:46 -070077#define FOPEN_STREAM (1 << 4)
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070078#define FUSE_ASYNC_READ (1 << 0)
Ben Cheng655a7c02013-10-16 16:09:24 -070079#define FUSE_POSIX_LOCKS (1 << 1)
80#define FUSE_FILE_OPS (1 << 2)
81#define FUSE_ATOMIC_O_TRUNC (1 << 3)
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070082#define FUSE_EXPORT_SUPPORT (1 << 4)
Ben Cheng655a7c02013-10-16 16:09:24 -070083#define FUSE_BIG_WRITES (1 << 5)
84#define FUSE_DONT_MASK (1 << 6)
85#define FUSE_SPLICE_WRITE (1 << 7)
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070086#define FUSE_SPLICE_MOVE (1 << 8)
Ben Cheng655a7c02013-10-16 16:09:24 -070087#define FUSE_SPLICE_READ (1 << 9)
88#define FUSE_FLOCK_LOCKS (1 << 10)
89#define FUSE_HAS_IOCTL_DIR (1 << 11)
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070090#define FUSE_AUTO_INVAL_DATA (1 << 12)
Ben Cheng655a7c02013-10-16 16:09:24 -070091#define FUSE_DO_READDIRPLUS (1 << 13)
92#define FUSE_READDIRPLUS_AUTO (1 << 14)
93#define FUSE_ASYNC_DIO (1 << 15)
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070094#define FUSE_WRITEBACK_CACHE (1 << 16)
95#define FUSE_NO_OPEN_SUPPORT (1 << 17)
Christopher Ferris106b3a82016-08-24 12:15:38 -070096#define FUSE_PARALLEL_DIROPS (1 << 18)
Christopher Ferris6a9755d2017-01-13 14:09:31 -080097#define FUSE_HANDLE_KILLPRIV (1 << 19)
Christopher Ferris6a9755d2017-01-13 14:09:31 -080098#define FUSE_POSIX_ACL (1 << 20)
Christopher Ferris9ce28842018-10-25 12:11:39 -070099#define FUSE_ABORT_ERROR (1 << 21)
Christopher Ferris86a48372019-01-10 14:14:59 -0800100#define FUSE_MAX_PAGES (1 << 22)
101#define FUSE_CACHE_SYMLINKS (1 << 23)
Christopher Ferris24f97eb2019-05-20 12:58:13 -0700102#define FUSE_NO_OPENDIR_SUPPORT (1 << 24)
Christopher Ferrisaeddbcf2019-07-08 12:45:46 -0700103#define FUSE_EXPLICIT_INVAL_DATA (1 << 25)
Christopher Ferris9584fa42019-12-09 15:36:13 -0800104#define FUSE_MAP_ALIGNMENT (1 << 26)
Christopher Ferris32ff3f82020-12-14 13:10:04 -0800105#define FUSE_SUBMOUNTS (1 << 27)
Christopher Ferris05667cd2021-02-16 16:01:34 -0800106#define FUSE_HANDLE_KILLPRIV_V2 (1 << 28)
Christopher Ferrisfcc3b4f2021-07-01 01:30:21 +0000107#define FUSE_SETXATTR_EXT (1 << 29)
Christopher Ferris32ff3f82020-12-14 13:10:04 -0800108#define FUSE_PASSTHROUGH (1 << 31)
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800109#define CUSE_UNRESTRICTED_IOCTL (1 << 0)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700110#define FUSE_RELEASE_FLUSH (1 << 0)
Ben Cheng655a7c02013-10-16 16:09:24 -0700111#define FUSE_RELEASE_FLOCK_UNLOCK (1 << 1)
112#define FUSE_GETATTR_FH (1 << 0)
113#define FUSE_LK_FLOCK (1 << 0)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700114#define FUSE_WRITE_CACHE (1 << 0)
Ben Cheng655a7c02013-10-16 16:09:24 -0700115#define FUSE_WRITE_LOCKOWNER (1 << 1)
Christopher Ferris05667cd2021-02-16 16:01:34 -0800116#define FUSE_WRITE_KILL_SUIDGID (1 << 2)
117#define FUSE_WRITE_KILL_PRIV FUSE_WRITE_KILL_SUIDGID
Ben Cheng655a7c02013-10-16 16:09:24 -0700118#define FUSE_READ_LOCKOWNER (1 << 1)
119#define FUSE_IOCTL_COMPAT (1 << 0)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700120#define FUSE_IOCTL_UNRESTRICTED (1 << 1)
Ben Cheng655a7c02013-10-16 16:09:24 -0700121#define FUSE_IOCTL_RETRY (1 << 2)
122#define FUSE_IOCTL_32BIT (1 << 3)
123#define FUSE_IOCTL_DIR (1 << 4)
Christopher Ferrisaeddbcf2019-07-08 12:45:46 -0700124#define FUSE_IOCTL_COMPAT_X32 (1 << 5)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700125#define FUSE_IOCTL_MAX_IOV 256
Ben Cheng655a7c02013-10-16 16:09:24 -0700126#define FUSE_POLL_SCHEDULE_NOTIFY (1 << 0)
Christopher Ferrisaeddbcf2019-07-08 12:45:46 -0700127#define FUSE_FSYNC_FDATASYNC (1 << 0)
Christopher Ferris32ff3f82020-12-14 13:10:04 -0800128#define FUSE_ATTR_SUBMOUNT (1 << 0)
Christopher Ferris05667cd2021-02-16 16:01:34 -0800129#define FUSE_OPEN_KILL_SUIDGID (1 << 0)
Christopher Ferrisfcc3b4f2021-07-01 01:30:21 +0000130#define FUSE_SETXATTR_ACL_KILL_SGID (1 << 0)
Ben Cheng655a7c02013-10-16 16:09:24 -0700131enum fuse_opcode {
Tao Baod7db5942015-01-28 10:07:51 -0800132 FUSE_LOOKUP = 1,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700133 FUSE_FORGET = 2,
Tao Baod7db5942015-01-28 10:07:51 -0800134 FUSE_GETATTR = 3,
135 FUSE_SETATTR = 4,
136 FUSE_READLINK = 5,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700137 FUSE_SYMLINK = 6,
Tao Baod7db5942015-01-28 10:07:51 -0800138 FUSE_MKNOD = 8,
139 FUSE_MKDIR = 9,
140 FUSE_UNLINK = 10,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700141 FUSE_RMDIR = 11,
Tao Baod7db5942015-01-28 10:07:51 -0800142 FUSE_RENAME = 12,
143 FUSE_LINK = 13,
144 FUSE_OPEN = 14,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700145 FUSE_READ = 15,
Tao Baod7db5942015-01-28 10:07:51 -0800146 FUSE_WRITE = 16,
147 FUSE_STATFS = 17,
148 FUSE_RELEASE = 18,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700149 FUSE_FSYNC = 20,
Tao Baod7db5942015-01-28 10:07:51 -0800150 FUSE_SETXATTR = 21,
151 FUSE_GETXATTR = 22,
152 FUSE_LISTXATTR = 23,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700153 FUSE_REMOVEXATTR = 24,
Tao Baod7db5942015-01-28 10:07:51 -0800154 FUSE_FLUSH = 25,
155 FUSE_INIT = 26,
156 FUSE_OPENDIR = 27,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700157 FUSE_READDIR = 28,
Tao Baod7db5942015-01-28 10:07:51 -0800158 FUSE_RELEASEDIR = 29,
159 FUSE_FSYNCDIR = 30,
160 FUSE_GETLK = 31,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700161 FUSE_SETLK = 32,
Tao Baod7db5942015-01-28 10:07:51 -0800162 FUSE_SETLKW = 33,
163 FUSE_ACCESS = 34,
164 FUSE_CREATE = 35,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700165 FUSE_INTERRUPT = 36,
Tao Baod7db5942015-01-28 10:07:51 -0800166 FUSE_BMAP = 37,
167 FUSE_DESTROY = 38,
168 FUSE_IOCTL = 39,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700169 FUSE_POLL = 40,
Tao Baod7db5942015-01-28 10:07:51 -0800170 FUSE_NOTIFY_REPLY = 41,
171 FUSE_BATCH_FORGET = 42,
172 FUSE_FALLOCATE = 43,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700173 FUSE_READDIRPLUS = 44,
Tao Baod7db5942015-01-28 10:07:51 -0800174 FUSE_RENAME2 = 45,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700175 FUSE_LSEEK = 46,
Christopher Ferris86a48372019-01-10 14:14:59 -0800176 FUSE_COPY_FILE_RANGE = 47,
Christopher Ferris9584fa42019-12-09 15:36:13 -0800177 FUSE_SETUPMAPPING = 48,
178 FUSE_REMOVEMAPPING = 49,
Christopher Ferris3a39c0b2021-09-02 00:03:38 +0000179 FUSE_SYNCFS = 50,
Christopher Ferris32ff3f82020-12-14 13:10:04 -0800180 FUSE_CANONICAL_PATH = 2016,
Tao Baod7db5942015-01-28 10:07:51 -0800181 CUSE_INIT = 4096,
Christopher Ferris9584fa42019-12-09 15:36:13 -0800182 CUSE_INIT_BSWAP_RESERVED = 1048576,
183 FUSE_INIT_BSWAP_RESERVED = 436207616,
Ben Cheng655a7c02013-10-16 16:09:24 -0700184};
185enum fuse_notify_code {
Tao Baod7db5942015-01-28 10:07:51 -0800186 FUSE_NOTIFY_POLL = 1,
187 FUSE_NOTIFY_INVAL_INODE = 2,
188 FUSE_NOTIFY_INVAL_ENTRY = 3,
189 FUSE_NOTIFY_STORE = 4,
Tao Baod7db5942015-01-28 10:07:51 -0800190 FUSE_NOTIFY_RETRIEVE = 5,
191 FUSE_NOTIFY_DELETE = 6,
192 FUSE_NOTIFY_CODE_MAX,
Ben Cheng655a7c02013-10-16 16:09:24 -0700193};
Ben Cheng655a7c02013-10-16 16:09:24 -0700194#define FUSE_MIN_READ_BUFFER 8192
195#define FUSE_COMPAT_ENTRY_OUT_SIZE 120
196struct fuse_entry_out {
Tao Baod7db5942015-01-28 10:07:51 -0800197 uint64_t nodeid;
Tao Baod7db5942015-01-28 10:07:51 -0800198 uint64_t generation;
199 uint64_t entry_valid;
200 uint64_t attr_valid;
201 uint32_t entry_valid_nsec;
Tao Baod7db5942015-01-28 10:07:51 -0800202 uint32_t attr_valid_nsec;
203 struct fuse_attr attr;
Ben Cheng655a7c02013-10-16 16:09:24 -0700204};
205struct fuse_forget_in {
Tao Baod7db5942015-01-28 10:07:51 -0800206 uint64_t nlookup;
Ben Cheng655a7c02013-10-16 16:09:24 -0700207};
208struct fuse_forget_one {
Tao Baod7db5942015-01-28 10:07:51 -0800209 uint64_t nodeid;
Tao Baod7db5942015-01-28 10:07:51 -0800210 uint64_t nlookup;
Ben Cheng655a7c02013-10-16 16:09:24 -0700211};
212struct fuse_batch_forget_in {
Tao Baod7db5942015-01-28 10:07:51 -0800213 uint32_t count;
Tao Baod7db5942015-01-28 10:07:51 -0800214 uint32_t dummy;
Ben Cheng655a7c02013-10-16 16:09:24 -0700215};
216struct fuse_getattr_in {
Tao Baod7db5942015-01-28 10:07:51 -0800217 uint32_t getattr_flags;
Tao Baod7db5942015-01-28 10:07:51 -0800218 uint32_t dummy;
219 uint64_t fh;
Ben Cheng655a7c02013-10-16 16:09:24 -0700220};
221#define FUSE_COMPAT_ATTR_OUT_SIZE 96
Ben Cheng655a7c02013-10-16 16:09:24 -0700222struct fuse_attr_out {
Tao Baod7db5942015-01-28 10:07:51 -0800223 uint64_t attr_valid;
224 uint32_t attr_valid_nsec;
225 uint32_t dummy;
Tao Baod7db5942015-01-28 10:07:51 -0800226 struct fuse_attr attr;
Ben Cheng655a7c02013-10-16 16:09:24 -0700227};
228#define FUSE_COMPAT_MKNOD_IN_SIZE 8
229struct fuse_mknod_in {
Tao Baod7db5942015-01-28 10:07:51 -0800230 uint32_t mode;
231 uint32_t rdev;
232 uint32_t umask;
233 uint32_t padding;
Ben Cheng655a7c02013-10-16 16:09:24 -0700234};
235struct fuse_mkdir_in {
Tao Baod7db5942015-01-28 10:07:51 -0800236 uint32_t mode;
237 uint32_t umask;
Ben Cheng655a7c02013-10-16 16:09:24 -0700238};
239struct fuse_rename_in {
Tao Baod7db5942015-01-28 10:07:51 -0800240 uint64_t newdir;
Ben Cheng655a7c02013-10-16 16:09:24 -0700241};
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700242struct fuse_rename2_in {
Tao Baod7db5942015-01-28 10:07:51 -0800243 uint64_t newdir;
244 uint32_t flags;
245 uint32_t padding;
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700246};
Ben Cheng655a7c02013-10-16 16:09:24 -0700247struct fuse_link_in {
Tao Baod7db5942015-01-28 10:07:51 -0800248 uint64_t oldnodeid;
Ben Cheng655a7c02013-10-16 16:09:24 -0700249};
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700250struct fuse_setattr_in {
Tao Baod7db5942015-01-28 10:07:51 -0800251 uint32_t valid;
252 uint32_t padding;
253 uint64_t fh;
Tao Baod7db5942015-01-28 10:07:51 -0800254 uint64_t size;
255 uint64_t lock_owner;
256 uint64_t atime;
257 uint64_t mtime;
Tao Baod7db5942015-01-28 10:07:51 -0800258 uint64_t ctime;
259 uint32_t atimensec;
260 uint32_t mtimensec;
261 uint32_t ctimensec;
Tao Baod7db5942015-01-28 10:07:51 -0800262 uint32_t mode;
263 uint32_t unused4;
264 uint32_t uid;
265 uint32_t gid;
Tao Baod7db5942015-01-28 10:07:51 -0800266 uint32_t unused5;
Ben Cheng655a7c02013-10-16 16:09:24 -0700267};
268struct fuse_open_in {
Tao Baod7db5942015-01-28 10:07:51 -0800269 uint32_t flags;
Christopher Ferris05667cd2021-02-16 16:01:34 -0800270 uint32_t open_flags;
Ben Cheng655a7c02013-10-16 16:09:24 -0700271};
272struct fuse_create_in {
Tao Baod7db5942015-01-28 10:07:51 -0800273 uint32_t flags;
Tao Baod7db5942015-01-28 10:07:51 -0800274 uint32_t mode;
275 uint32_t umask;
Christopher Ferris05667cd2021-02-16 16:01:34 -0800276 uint32_t open_flags;
Ben Cheng655a7c02013-10-16 16:09:24 -0700277};
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700278struct fuse_open_out {
Tao Baod7db5942015-01-28 10:07:51 -0800279 uint64_t fh;
280 uint32_t open_flags;
Christopher Ferris32ff3f82020-12-14 13:10:04 -0800281 uint32_t passthrough_fh;
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700282};
Ben Cheng655a7c02013-10-16 16:09:24 -0700283struct fuse_release_in {
Tao Baod7db5942015-01-28 10:07:51 -0800284 uint64_t fh;
285 uint32_t flags;
Tao Baod7db5942015-01-28 10:07:51 -0800286 uint32_t release_flags;
287 uint64_t lock_owner;
Ben Cheng655a7c02013-10-16 16:09:24 -0700288};
289struct fuse_flush_in {
Tao Baod7db5942015-01-28 10:07:51 -0800290 uint64_t fh;
291 uint32_t unused;
292 uint32_t padding;
293 uint64_t lock_owner;
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700294};
Ben Cheng655a7c02013-10-16 16:09:24 -0700295struct fuse_read_in {
Tao Baod7db5942015-01-28 10:07:51 -0800296 uint64_t fh;
297 uint64_t offset;
Tao Baod7db5942015-01-28 10:07:51 -0800298 uint32_t size;
299 uint32_t read_flags;
300 uint64_t lock_owner;
301 uint32_t flags;
Tao Baod7db5942015-01-28 10:07:51 -0800302 uint32_t padding;
Ben Cheng655a7c02013-10-16 16:09:24 -0700303};
304#define FUSE_COMPAT_WRITE_IN_SIZE 24
305struct fuse_write_in {
Tao Baod7db5942015-01-28 10:07:51 -0800306 uint64_t fh;
307 uint64_t offset;
308 uint32_t size;
309 uint32_t write_flags;
Tao Baod7db5942015-01-28 10:07:51 -0800310 uint64_t lock_owner;
311 uint32_t flags;
312 uint32_t padding;
Ben Cheng655a7c02013-10-16 16:09:24 -0700313};
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700314struct fuse_write_out {
Tao Baod7db5942015-01-28 10:07:51 -0800315 uint32_t size;
316 uint32_t padding;
Ben Cheng655a7c02013-10-16 16:09:24 -0700317};
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700318#define FUSE_COMPAT_STATFS_SIZE 48
Ben Cheng655a7c02013-10-16 16:09:24 -0700319struct fuse_statfs_out {
Tao Baod7db5942015-01-28 10:07:51 -0800320 struct fuse_kstatfs st;
Ben Cheng655a7c02013-10-16 16:09:24 -0700321};
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700322struct fuse_fsync_in {
Tao Baod7db5942015-01-28 10:07:51 -0800323 uint64_t fh;
324 uint32_t fsync_flags;
325 uint32_t padding;
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700326};
Christopher Ferrisfcc3b4f2021-07-01 01:30:21 +0000327#define FUSE_COMPAT_SETXATTR_IN_SIZE 8
Ben Cheng655a7c02013-10-16 16:09:24 -0700328struct fuse_setxattr_in {
Tao Baod7db5942015-01-28 10:07:51 -0800329 uint32_t size;
330 uint32_t flags;
Christopher Ferrisfcc3b4f2021-07-01 01:30:21 +0000331 uint32_t setxattr_flags;
332 uint32_t padding;
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700333};
Ben Cheng655a7c02013-10-16 16:09:24 -0700334struct fuse_getxattr_in {
Tao Baod7db5942015-01-28 10:07:51 -0800335 uint32_t size;
336 uint32_t padding;
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700337};
Ben Cheng655a7c02013-10-16 16:09:24 -0700338struct fuse_getxattr_out {
Tao Baod7db5942015-01-28 10:07:51 -0800339 uint32_t size;
340 uint32_t padding;
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700341};
Ben Cheng655a7c02013-10-16 16:09:24 -0700342struct fuse_lk_in {
Tao Baod7db5942015-01-28 10:07:51 -0800343 uint64_t fh;
344 uint64_t owner;
Tao Baod7db5942015-01-28 10:07:51 -0800345 struct fuse_file_lock lk;
346 uint32_t lk_flags;
347 uint32_t padding;
Ben Cheng655a7c02013-10-16 16:09:24 -0700348};
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700349struct fuse_lk_out {
Tao Baod7db5942015-01-28 10:07:51 -0800350 struct fuse_file_lock lk;
Ben Cheng655a7c02013-10-16 16:09:24 -0700351};
352struct fuse_access_in {
Tao Baod7db5942015-01-28 10:07:51 -0800353 uint32_t mask;
354 uint32_t padding;
Ben Cheng655a7c02013-10-16 16:09:24 -0700355};
356struct fuse_init_in {
Tao Baod7db5942015-01-28 10:07:51 -0800357 uint32_t major;
358 uint32_t minor;
359 uint32_t max_readahead;
360 uint32_t flags;
Ben Cheng655a7c02013-10-16 16:09:24 -0700361};
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700362#define FUSE_COMPAT_INIT_OUT_SIZE 8
363#define FUSE_COMPAT_22_INIT_OUT_SIZE 24
Ben Cheng655a7c02013-10-16 16:09:24 -0700364struct fuse_init_out {
Tao Baod7db5942015-01-28 10:07:51 -0800365 uint32_t major;
366 uint32_t minor;
367 uint32_t max_readahead;
368 uint32_t flags;
Tao Baod7db5942015-01-28 10:07:51 -0800369 uint16_t max_background;
370 uint16_t congestion_threshold;
371 uint32_t max_write;
372 uint32_t time_gran;
Christopher Ferris86a48372019-01-10 14:14:59 -0800373 uint16_t max_pages;
Christopher Ferris9584fa42019-12-09 15:36:13 -0800374 uint16_t map_alignment;
Christopher Ferris86a48372019-01-10 14:14:59 -0800375 uint32_t unused[8];
Ben Cheng655a7c02013-10-16 16:09:24 -0700376};
377#define CUSE_INIT_INFO_MAX 4096
378struct cuse_init_in {
Tao Baod7db5942015-01-28 10:07:51 -0800379 uint32_t major;
380 uint32_t minor;
381 uint32_t unused;
382 uint32_t flags;
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700383};
Ben Cheng655a7c02013-10-16 16:09:24 -0700384struct cuse_init_out {
Tao Baod7db5942015-01-28 10:07:51 -0800385 uint32_t major;
386 uint32_t minor;
Tao Baod7db5942015-01-28 10:07:51 -0800387 uint32_t unused;
388 uint32_t flags;
389 uint32_t max_read;
390 uint32_t max_write;
Tao Baod7db5942015-01-28 10:07:51 -0800391 uint32_t dev_major;
392 uint32_t dev_minor;
393 uint32_t spare[10];
Ben Cheng655a7c02013-10-16 16:09:24 -0700394};
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700395struct fuse_interrupt_in {
Tao Baod7db5942015-01-28 10:07:51 -0800396 uint64_t unique;
Ben Cheng655a7c02013-10-16 16:09:24 -0700397};
398struct fuse_bmap_in {
Tao Baod7db5942015-01-28 10:07:51 -0800399 uint64_t block;
400 uint32_t blocksize;
401 uint32_t padding;
Ben Cheng655a7c02013-10-16 16:09:24 -0700402};
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700403struct fuse_bmap_out {
Tao Baod7db5942015-01-28 10:07:51 -0800404 uint64_t block;
Ben Cheng655a7c02013-10-16 16:09:24 -0700405};
406struct fuse_ioctl_in {
Tao Baod7db5942015-01-28 10:07:51 -0800407 uint64_t fh;
408 uint32_t flags;
409 uint32_t cmd;
410 uint64_t arg;
Tao Baod7db5942015-01-28 10:07:51 -0800411 uint32_t in_size;
412 uint32_t out_size;
Ben Cheng655a7c02013-10-16 16:09:24 -0700413};
414struct fuse_ioctl_iovec {
Tao Baod7db5942015-01-28 10:07:51 -0800415 uint64_t base;
416 uint64_t len;
Ben Cheng655a7c02013-10-16 16:09:24 -0700417};
418struct fuse_ioctl_out {
Tao Baod7db5942015-01-28 10:07:51 -0800419 int32_t result;
420 uint32_t flags;
421 uint32_t in_iovs;
422 uint32_t out_iovs;
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700423};
Ben Cheng655a7c02013-10-16 16:09:24 -0700424struct fuse_poll_in {
Tao Baod7db5942015-01-28 10:07:51 -0800425 uint64_t fh;
426 uint64_t kh;
Tao Baod7db5942015-01-28 10:07:51 -0800427 uint32_t flags;
428 uint32_t events;
Ben Cheng655a7c02013-10-16 16:09:24 -0700429};
430struct fuse_poll_out {
Tao Baod7db5942015-01-28 10:07:51 -0800431 uint32_t revents;
432 uint32_t padding;
Ben Cheng655a7c02013-10-16 16:09:24 -0700433};
434struct fuse_notify_poll_wakeup_out {
Tao Baod7db5942015-01-28 10:07:51 -0800435 uint64_t kh;
Ben Cheng655a7c02013-10-16 16:09:24 -0700436};
437struct fuse_fallocate_in {
Tao Baod7db5942015-01-28 10:07:51 -0800438 uint64_t fh;
Tao Baod7db5942015-01-28 10:07:51 -0800439 uint64_t offset;
440 uint64_t length;
441 uint32_t mode;
442 uint32_t padding;
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700443};
Ben Cheng655a7c02013-10-16 16:09:24 -0700444struct fuse_in_header {
Tao Baod7db5942015-01-28 10:07:51 -0800445 uint32_t len;
446 uint32_t opcode;
Tao Baod7db5942015-01-28 10:07:51 -0800447 uint64_t unique;
448 uint64_t nodeid;
449 uint32_t uid;
450 uint32_t gid;
Tao Baod7db5942015-01-28 10:07:51 -0800451 uint32_t pid;
452 uint32_t padding;
Ben Cheng655a7c02013-10-16 16:09:24 -0700453};
454struct fuse_out_header {
Tao Baod7db5942015-01-28 10:07:51 -0800455 uint32_t len;
456 int32_t error;
457 uint64_t unique;
Ben Cheng655a7c02013-10-16 16:09:24 -0700458};
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700459struct fuse_dirent {
Tao Baod7db5942015-01-28 10:07:51 -0800460 uint64_t ino;
461 uint64_t off;
462 uint32_t namelen;
Tao Baod7db5942015-01-28 10:07:51 -0800463 uint32_t type;
464 char name[];
Ben Cheng655a7c02013-10-16 16:09:24 -0700465};
466#define FUSE_NAME_OFFSET offsetof(struct fuse_dirent, name)
Tao Baod7db5942015-01-28 10:07:51 -0800467#define FUSE_DIRENT_ALIGN(x) (((x) + sizeof(uint64_t) - 1) & ~(sizeof(uint64_t) - 1))
468#define FUSE_DIRENT_SIZE(d) FUSE_DIRENT_ALIGN(FUSE_NAME_OFFSET + (d)->namelen)
Ben Cheng655a7c02013-10-16 16:09:24 -0700469struct fuse_direntplus {
Tao Baod7db5942015-01-28 10:07:51 -0800470 struct fuse_entry_out entry_out;
Tao Baod7db5942015-01-28 10:07:51 -0800471 struct fuse_dirent dirent;
Ben Cheng655a7c02013-10-16 16:09:24 -0700472};
Tao Baod7db5942015-01-28 10:07:51 -0800473#define FUSE_NAME_OFFSET_DIRENTPLUS offsetof(struct fuse_direntplus, dirent.name)
474#define FUSE_DIRENTPLUS_SIZE(d) FUSE_DIRENT_ALIGN(FUSE_NAME_OFFSET_DIRENTPLUS + (d)->dirent.namelen)
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700475struct fuse_notify_inval_inode_out {
Tao Baod7db5942015-01-28 10:07:51 -0800476 uint64_t ino;
477 int64_t off;
478 int64_t len;
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700479};
Ben Cheng655a7c02013-10-16 16:09:24 -0700480struct fuse_notify_inval_entry_out {
Tao Baod7db5942015-01-28 10:07:51 -0800481 uint64_t parent;
482 uint32_t namelen;
Tao Baod7db5942015-01-28 10:07:51 -0800483 uint32_t padding;
Ben Cheng655a7c02013-10-16 16:09:24 -0700484};
485struct fuse_notify_delete_out {
Tao Baod7db5942015-01-28 10:07:51 -0800486 uint64_t parent;
Tao Baod7db5942015-01-28 10:07:51 -0800487 uint64_t child;
488 uint32_t namelen;
489 uint32_t padding;
Ben Cheng655a7c02013-10-16 16:09:24 -0700490};
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700491struct fuse_notify_store_out {
Tao Baod7db5942015-01-28 10:07:51 -0800492 uint64_t nodeid;
493 uint64_t offset;
494 uint32_t size;
Tao Baod7db5942015-01-28 10:07:51 -0800495 uint32_t padding;
Ben Cheng655a7c02013-10-16 16:09:24 -0700496};
497struct fuse_notify_retrieve_out {
Tao Baod7db5942015-01-28 10:07:51 -0800498 uint64_t notify_unique;
Tao Baod7db5942015-01-28 10:07:51 -0800499 uint64_t nodeid;
500 uint64_t offset;
501 uint32_t size;
502 uint32_t padding;
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700503};
Ben Cheng655a7c02013-10-16 16:09:24 -0700504struct fuse_notify_retrieve_in {
Tao Baod7db5942015-01-28 10:07:51 -0800505 uint64_t dummy1;
506 uint64_t offset;
Tao Baod7db5942015-01-28 10:07:51 -0800507 uint32_t size;
508 uint32_t dummy2;
509 uint64_t dummy3;
510 uint64_t dummy4;
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700511};
Christopher Ferris05667cd2021-02-16 16:01:34 -0800512#define FUSE_DEV_IOC_MAGIC 229
513#define FUSE_DEV_IOC_CLONE _IOR(FUSE_DEV_IOC_MAGIC, 0, uint32_t)
Christopher Ferrisfcc3b4f2021-07-01 01:30:21 +0000514#define FUSE_DEV_IOC_PASSTHROUGH_OPEN _IOW(FUSE_DEV_IOC_MAGIC, 126, __u32)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700515struct fuse_lseek_in {
516 uint64_t fh;
517 uint64_t offset;
518 uint32_t whence;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700519 uint32_t padding;
520};
521struct fuse_lseek_out {
522 uint64_t offset;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700523};
Christopher Ferris86a48372019-01-10 14:14:59 -0800524struct fuse_copy_file_range_in {
525 uint64_t fh_in;
526 uint64_t off_in;
527 uint64_t nodeid_out;
528 uint64_t fh_out;
529 uint64_t off_out;
530 uint64_t len;
531 uint64_t flags;
532};
Christopher Ferris32ff3f82020-12-14 13:10:04 -0800533#define FUSE_SETUPMAPPING_FLAG_WRITE (1ull << 0)
534#define FUSE_SETUPMAPPING_FLAG_READ (1ull << 1)
535struct fuse_setupmapping_in {
536 uint64_t fh;
537 uint64_t foffset;
538 uint64_t len;
539 uint64_t flags;
540 uint64_t moffset;
541};
542struct fuse_removemapping_in {
543 uint32_t count;
544};
545struct fuse_removemapping_one {
546 uint64_t moffset;
547 uint64_t len;
548};
549#define FUSE_REMOVEMAPPING_MAX_ENTRY (PAGE_SIZE / sizeof(struct fuse_removemapping_one))
Christopher Ferris3a39c0b2021-09-02 00:03:38 +0000550struct fuse_syncfs_in {
551 uint64_t padding;
552};
Ben Cheng655a7c02013-10-16 16:09:24 -0700553#endif