blob: 358db192dc39a479442a13a9b457e265d5636deb [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 Ferrisa4792612022-01-10 13:51:15 -080023#define FUSE_KERNEL_MINOR_VERSION 35
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 Ferrisa4792612022-01-10 13:51:15 -080078#define FOPEN_NOFLUSH (1 << 5)
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070079#define FUSE_ASYNC_READ (1 << 0)
Ben Cheng655a7c02013-10-16 16:09:24 -070080#define FUSE_POSIX_LOCKS (1 << 1)
81#define FUSE_FILE_OPS (1 << 2)
82#define FUSE_ATOMIC_O_TRUNC (1 << 3)
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070083#define FUSE_EXPORT_SUPPORT (1 << 4)
Ben Cheng655a7c02013-10-16 16:09:24 -070084#define FUSE_BIG_WRITES (1 << 5)
85#define FUSE_DONT_MASK (1 << 6)
86#define FUSE_SPLICE_WRITE (1 << 7)
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070087#define FUSE_SPLICE_MOVE (1 << 8)
Ben Cheng655a7c02013-10-16 16:09:24 -070088#define FUSE_SPLICE_READ (1 << 9)
89#define FUSE_FLOCK_LOCKS (1 << 10)
90#define FUSE_HAS_IOCTL_DIR (1 << 11)
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070091#define FUSE_AUTO_INVAL_DATA (1 << 12)
Ben Cheng655a7c02013-10-16 16:09:24 -070092#define FUSE_DO_READDIRPLUS (1 << 13)
93#define FUSE_READDIRPLUS_AUTO (1 << 14)
94#define FUSE_ASYNC_DIO (1 << 15)
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070095#define FUSE_WRITEBACK_CACHE (1 << 16)
96#define FUSE_NO_OPEN_SUPPORT (1 << 17)
Christopher Ferris106b3a82016-08-24 12:15:38 -070097#define FUSE_PARALLEL_DIROPS (1 << 18)
Christopher Ferris6a9755d2017-01-13 14:09:31 -080098#define FUSE_HANDLE_KILLPRIV (1 << 19)
Christopher Ferris6a9755d2017-01-13 14:09:31 -080099#define FUSE_POSIX_ACL (1 << 20)
Christopher Ferris9ce28842018-10-25 12:11:39 -0700100#define FUSE_ABORT_ERROR (1 << 21)
Christopher Ferris86a48372019-01-10 14:14:59 -0800101#define FUSE_MAX_PAGES (1 << 22)
102#define FUSE_CACHE_SYMLINKS (1 << 23)
Christopher Ferris24f97eb2019-05-20 12:58:13 -0700103#define FUSE_NO_OPENDIR_SUPPORT (1 << 24)
Christopher Ferrisaeddbcf2019-07-08 12:45:46 -0700104#define FUSE_EXPLICIT_INVAL_DATA (1 << 25)
Christopher Ferris9584fa42019-12-09 15:36:13 -0800105#define FUSE_MAP_ALIGNMENT (1 << 26)
Christopher Ferris32ff3f82020-12-14 13:10:04 -0800106#define FUSE_SUBMOUNTS (1 << 27)
Christopher Ferris05667cd2021-02-16 16:01:34 -0800107#define FUSE_HANDLE_KILLPRIV_V2 (1 << 28)
Christopher Ferrisfcc3b4f2021-07-01 01:30:21 +0000108#define FUSE_SETXATTR_EXT (1 << 29)
Christopher Ferris32ff3f82020-12-14 13:10:04 -0800109#define FUSE_PASSTHROUGH (1 << 31)
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800110#define CUSE_UNRESTRICTED_IOCTL (1 << 0)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700111#define FUSE_RELEASE_FLUSH (1 << 0)
Ben Cheng655a7c02013-10-16 16:09:24 -0700112#define FUSE_RELEASE_FLOCK_UNLOCK (1 << 1)
113#define FUSE_GETATTR_FH (1 << 0)
114#define FUSE_LK_FLOCK (1 << 0)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700115#define FUSE_WRITE_CACHE (1 << 0)
Ben Cheng655a7c02013-10-16 16:09:24 -0700116#define FUSE_WRITE_LOCKOWNER (1 << 1)
Christopher Ferris05667cd2021-02-16 16:01:34 -0800117#define FUSE_WRITE_KILL_SUIDGID (1 << 2)
118#define FUSE_WRITE_KILL_PRIV FUSE_WRITE_KILL_SUIDGID
Ben Cheng655a7c02013-10-16 16:09:24 -0700119#define FUSE_READ_LOCKOWNER (1 << 1)
120#define FUSE_IOCTL_COMPAT (1 << 0)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700121#define FUSE_IOCTL_UNRESTRICTED (1 << 1)
Ben Cheng655a7c02013-10-16 16:09:24 -0700122#define FUSE_IOCTL_RETRY (1 << 2)
123#define FUSE_IOCTL_32BIT (1 << 3)
124#define FUSE_IOCTL_DIR (1 << 4)
Christopher Ferrisaeddbcf2019-07-08 12:45:46 -0700125#define FUSE_IOCTL_COMPAT_X32 (1 << 5)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700126#define FUSE_IOCTL_MAX_IOV 256
Ben Cheng655a7c02013-10-16 16:09:24 -0700127#define FUSE_POLL_SCHEDULE_NOTIFY (1 << 0)
Christopher Ferrisaeddbcf2019-07-08 12:45:46 -0700128#define FUSE_FSYNC_FDATASYNC (1 << 0)
Christopher Ferris32ff3f82020-12-14 13:10:04 -0800129#define FUSE_ATTR_SUBMOUNT (1 << 0)
Christopher Ferris05667cd2021-02-16 16:01:34 -0800130#define FUSE_OPEN_KILL_SUIDGID (1 << 0)
Christopher Ferrisfcc3b4f2021-07-01 01:30:21 +0000131#define FUSE_SETXATTR_ACL_KILL_SGID (1 << 0)
Ben Cheng655a7c02013-10-16 16:09:24 -0700132enum fuse_opcode {
Tao Baod7db5942015-01-28 10:07:51 -0800133 FUSE_LOOKUP = 1,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700134 FUSE_FORGET = 2,
Tao Baod7db5942015-01-28 10:07:51 -0800135 FUSE_GETATTR = 3,
136 FUSE_SETATTR = 4,
137 FUSE_READLINK = 5,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700138 FUSE_SYMLINK = 6,
Tao Baod7db5942015-01-28 10:07:51 -0800139 FUSE_MKNOD = 8,
140 FUSE_MKDIR = 9,
141 FUSE_UNLINK = 10,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700142 FUSE_RMDIR = 11,
Tao Baod7db5942015-01-28 10:07:51 -0800143 FUSE_RENAME = 12,
144 FUSE_LINK = 13,
145 FUSE_OPEN = 14,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700146 FUSE_READ = 15,
Tao Baod7db5942015-01-28 10:07:51 -0800147 FUSE_WRITE = 16,
148 FUSE_STATFS = 17,
149 FUSE_RELEASE = 18,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700150 FUSE_FSYNC = 20,
Tao Baod7db5942015-01-28 10:07:51 -0800151 FUSE_SETXATTR = 21,
152 FUSE_GETXATTR = 22,
153 FUSE_LISTXATTR = 23,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700154 FUSE_REMOVEXATTR = 24,
Tao Baod7db5942015-01-28 10:07:51 -0800155 FUSE_FLUSH = 25,
156 FUSE_INIT = 26,
157 FUSE_OPENDIR = 27,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700158 FUSE_READDIR = 28,
Tao Baod7db5942015-01-28 10:07:51 -0800159 FUSE_RELEASEDIR = 29,
160 FUSE_FSYNCDIR = 30,
161 FUSE_GETLK = 31,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700162 FUSE_SETLK = 32,
Tao Baod7db5942015-01-28 10:07:51 -0800163 FUSE_SETLKW = 33,
164 FUSE_ACCESS = 34,
165 FUSE_CREATE = 35,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700166 FUSE_INTERRUPT = 36,
Tao Baod7db5942015-01-28 10:07:51 -0800167 FUSE_BMAP = 37,
168 FUSE_DESTROY = 38,
169 FUSE_IOCTL = 39,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700170 FUSE_POLL = 40,
Tao Baod7db5942015-01-28 10:07:51 -0800171 FUSE_NOTIFY_REPLY = 41,
172 FUSE_BATCH_FORGET = 42,
173 FUSE_FALLOCATE = 43,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700174 FUSE_READDIRPLUS = 44,
Tao Baod7db5942015-01-28 10:07:51 -0800175 FUSE_RENAME2 = 45,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700176 FUSE_LSEEK = 46,
Christopher Ferris86a48372019-01-10 14:14:59 -0800177 FUSE_COPY_FILE_RANGE = 47,
Christopher Ferris9584fa42019-12-09 15:36:13 -0800178 FUSE_SETUPMAPPING = 48,
179 FUSE_REMOVEMAPPING = 49,
Christopher Ferris3a39c0b2021-09-02 00:03:38 +0000180 FUSE_SYNCFS = 50,
Christopher Ferris32ff3f82020-12-14 13:10:04 -0800181 FUSE_CANONICAL_PATH = 2016,
Tao Baod7db5942015-01-28 10:07:51 -0800182 CUSE_INIT = 4096,
Christopher Ferris9584fa42019-12-09 15:36:13 -0800183 CUSE_INIT_BSWAP_RESERVED = 1048576,
184 FUSE_INIT_BSWAP_RESERVED = 436207616,
Ben Cheng655a7c02013-10-16 16:09:24 -0700185};
186enum fuse_notify_code {
Tao Baod7db5942015-01-28 10:07:51 -0800187 FUSE_NOTIFY_POLL = 1,
188 FUSE_NOTIFY_INVAL_INODE = 2,
189 FUSE_NOTIFY_INVAL_ENTRY = 3,
190 FUSE_NOTIFY_STORE = 4,
Tao Baod7db5942015-01-28 10:07:51 -0800191 FUSE_NOTIFY_RETRIEVE = 5,
192 FUSE_NOTIFY_DELETE = 6,
193 FUSE_NOTIFY_CODE_MAX,
Ben Cheng655a7c02013-10-16 16:09:24 -0700194};
Ben Cheng655a7c02013-10-16 16:09:24 -0700195#define FUSE_MIN_READ_BUFFER 8192
196#define FUSE_COMPAT_ENTRY_OUT_SIZE 120
197struct fuse_entry_out {
Tao Baod7db5942015-01-28 10:07:51 -0800198 uint64_t nodeid;
Tao Baod7db5942015-01-28 10:07:51 -0800199 uint64_t generation;
200 uint64_t entry_valid;
201 uint64_t attr_valid;
202 uint32_t entry_valid_nsec;
Tao Baod7db5942015-01-28 10:07:51 -0800203 uint32_t attr_valid_nsec;
204 struct fuse_attr attr;
Ben Cheng655a7c02013-10-16 16:09:24 -0700205};
206struct fuse_forget_in {
Tao Baod7db5942015-01-28 10:07:51 -0800207 uint64_t nlookup;
Ben Cheng655a7c02013-10-16 16:09:24 -0700208};
209struct fuse_forget_one {
Tao Baod7db5942015-01-28 10:07:51 -0800210 uint64_t nodeid;
Tao Baod7db5942015-01-28 10:07:51 -0800211 uint64_t nlookup;
Ben Cheng655a7c02013-10-16 16:09:24 -0700212};
213struct fuse_batch_forget_in {
Tao Baod7db5942015-01-28 10:07:51 -0800214 uint32_t count;
Tao Baod7db5942015-01-28 10:07:51 -0800215 uint32_t dummy;
Ben Cheng655a7c02013-10-16 16:09:24 -0700216};
217struct fuse_getattr_in {
Tao Baod7db5942015-01-28 10:07:51 -0800218 uint32_t getattr_flags;
Tao Baod7db5942015-01-28 10:07:51 -0800219 uint32_t dummy;
220 uint64_t fh;
Ben Cheng655a7c02013-10-16 16:09:24 -0700221};
222#define FUSE_COMPAT_ATTR_OUT_SIZE 96
Ben Cheng655a7c02013-10-16 16:09:24 -0700223struct fuse_attr_out {
Tao Baod7db5942015-01-28 10:07:51 -0800224 uint64_t attr_valid;
225 uint32_t attr_valid_nsec;
226 uint32_t dummy;
Tao Baod7db5942015-01-28 10:07:51 -0800227 struct fuse_attr attr;
Ben Cheng655a7c02013-10-16 16:09:24 -0700228};
229#define FUSE_COMPAT_MKNOD_IN_SIZE 8
230struct fuse_mknod_in {
Tao Baod7db5942015-01-28 10:07:51 -0800231 uint32_t mode;
232 uint32_t rdev;
233 uint32_t umask;
234 uint32_t padding;
Ben Cheng655a7c02013-10-16 16:09:24 -0700235};
236struct fuse_mkdir_in {
Tao Baod7db5942015-01-28 10:07:51 -0800237 uint32_t mode;
238 uint32_t umask;
Ben Cheng655a7c02013-10-16 16:09:24 -0700239};
240struct fuse_rename_in {
Tao Baod7db5942015-01-28 10:07:51 -0800241 uint64_t newdir;
Ben Cheng655a7c02013-10-16 16:09:24 -0700242};
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700243struct fuse_rename2_in {
Tao Baod7db5942015-01-28 10:07:51 -0800244 uint64_t newdir;
245 uint32_t flags;
246 uint32_t padding;
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700247};
Ben Cheng655a7c02013-10-16 16:09:24 -0700248struct fuse_link_in {
Tao Baod7db5942015-01-28 10:07:51 -0800249 uint64_t oldnodeid;
Ben Cheng655a7c02013-10-16 16:09:24 -0700250};
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700251struct fuse_setattr_in {
Tao Baod7db5942015-01-28 10:07:51 -0800252 uint32_t valid;
253 uint32_t padding;
254 uint64_t fh;
Tao Baod7db5942015-01-28 10:07:51 -0800255 uint64_t size;
256 uint64_t lock_owner;
257 uint64_t atime;
258 uint64_t mtime;
Tao Baod7db5942015-01-28 10:07:51 -0800259 uint64_t ctime;
260 uint32_t atimensec;
261 uint32_t mtimensec;
262 uint32_t ctimensec;
Tao Baod7db5942015-01-28 10:07:51 -0800263 uint32_t mode;
264 uint32_t unused4;
265 uint32_t uid;
266 uint32_t gid;
Tao Baod7db5942015-01-28 10:07:51 -0800267 uint32_t unused5;
Ben Cheng655a7c02013-10-16 16:09:24 -0700268};
269struct fuse_open_in {
Tao Baod7db5942015-01-28 10:07:51 -0800270 uint32_t flags;
Christopher Ferris05667cd2021-02-16 16:01:34 -0800271 uint32_t open_flags;
Ben Cheng655a7c02013-10-16 16:09:24 -0700272};
273struct fuse_create_in {
Tao Baod7db5942015-01-28 10:07:51 -0800274 uint32_t flags;
Tao Baod7db5942015-01-28 10:07:51 -0800275 uint32_t mode;
276 uint32_t umask;
Christopher Ferris05667cd2021-02-16 16:01:34 -0800277 uint32_t open_flags;
Ben Cheng655a7c02013-10-16 16:09:24 -0700278};
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700279struct fuse_open_out {
Tao Baod7db5942015-01-28 10:07:51 -0800280 uint64_t fh;
281 uint32_t open_flags;
Christopher Ferris32ff3f82020-12-14 13:10:04 -0800282 uint32_t passthrough_fh;
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700283};
Ben Cheng655a7c02013-10-16 16:09:24 -0700284struct fuse_release_in {
Tao Baod7db5942015-01-28 10:07:51 -0800285 uint64_t fh;
286 uint32_t flags;
Tao Baod7db5942015-01-28 10:07:51 -0800287 uint32_t release_flags;
288 uint64_t lock_owner;
Ben Cheng655a7c02013-10-16 16:09:24 -0700289};
290struct fuse_flush_in {
Tao Baod7db5942015-01-28 10:07:51 -0800291 uint64_t fh;
292 uint32_t unused;
293 uint32_t padding;
294 uint64_t lock_owner;
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700295};
Ben Cheng655a7c02013-10-16 16:09:24 -0700296struct fuse_read_in {
Tao Baod7db5942015-01-28 10:07:51 -0800297 uint64_t fh;
298 uint64_t offset;
Tao Baod7db5942015-01-28 10:07:51 -0800299 uint32_t size;
300 uint32_t read_flags;
301 uint64_t lock_owner;
302 uint32_t flags;
Tao Baod7db5942015-01-28 10:07:51 -0800303 uint32_t padding;
Ben Cheng655a7c02013-10-16 16:09:24 -0700304};
305#define FUSE_COMPAT_WRITE_IN_SIZE 24
306struct fuse_write_in {
Tao Baod7db5942015-01-28 10:07:51 -0800307 uint64_t fh;
308 uint64_t offset;
309 uint32_t size;
310 uint32_t write_flags;
Tao Baod7db5942015-01-28 10:07:51 -0800311 uint64_t lock_owner;
312 uint32_t flags;
313 uint32_t padding;
Ben Cheng655a7c02013-10-16 16:09:24 -0700314};
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700315struct fuse_write_out {
Tao Baod7db5942015-01-28 10:07:51 -0800316 uint32_t size;
317 uint32_t padding;
Ben Cheng655a7c02013-10-16 16:09:24 -0700318};
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700319#define FUSE_COMPAT_STATFS_SIZE 48
Ben Cheng655a7c02013-10-16 16:09:24 -0700320struct fuse_statfs_out {
Tao Baod7db5942015-01-28 10:07:51 -0800321 struct fuse_kstatfs st;
Ben Cheng655a7c02013-10-16 16:09:24 -0700322};
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700323struct fuse_fsync_in {
Tao Baod7db5942015-01-28 10:07:51 -0800324 uint64_t fh;
325 uint32_t fsync_flags;
326 uint32_t padding;
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700327};
Christopher Ferrisfcc3b4f2021-07-01 01:30:21 +0000328#define FUSE_COMPAT_SETXATTR_IN_SIZE 8
Ben Cheng655a7c02013-10-16 16:09:24 -0700329struct fuse_setxattr_in {
Tao Baod7db5942015-01-28 10:07:51 -0800330 uint32_t size;
331 uint32_t flags;
Christopher Ferrisfcc3b4f2021-07-01 01:30:21 +0000332 uint32_t setxattr_flags;
333 uint32_t padding;
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700334};
Ben Cheng655a7c02013-10-16 16:09:24 -0700335struct fuse_getxattr_in {
Tao Baod7db5942015-01-28 10:07:51 -0800336 uint32_t size;
337 uint32_t padding;
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700338};
Ben Cheng655a7c02013-10-16 16:09:24 -0700339struct fuse_getxattr_out {
Tao Baod7db5942015-01-28 10:07:51 -0800340 uint32_t size;
341 uint32_t padding;
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700342};
Ben Cheng655a7c02013-10-16 16:09:24 -0700343struct fuse_lk_in {
Tao Baod7db5942015-01-28 10:07:51 -0800344 uint64_t fh;
345 uint64_t owner;
Tao Baod7db5942015-01-28 10:07:51 -0800346 struct fuse_file_lock lk;
347 uint32_t lk_flags;
348 uint32_t padding;
Ben Cheng655a7c02013-10-16 16:09:24 -0700349};
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700350struct fuse_lk_out {
Tao Baod7db5942015-01-28 10:07:51 -0800351 struct fuse_file_lock lk;
Ben Cheng655a7c02013-10-16 16:09:24 -0700352};
353struct fuse_access_in {
Tao Baod7db5942015-01-28 10:07:51 -0800354 uint32_t mask;
355 uint32_t padding;
Ben Cheng655a7c02013-10-16 16:09:24 -0700356};
357struct fuse_init_in {
Tao Baod7db5942015-01-28 10:07:51 -0800358 uint32_t major;
359 uint32_t minor;
360 uint32_t max_readahead;
361 uint32_t flags;
Ben Cheng655a7c02013-10-16 16:09:24 -0700362};
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700363#define FUSE_COMPAT_INIT_OUT_SIZE 8
364#define FUSE_COMPAT_22_INIT_OUT_SIZE 24
Ben Cheng655a7c02013-10-16 16:09:24 -0700365struct fuse_init_out {
Tao Baod7db5942015-01-28 10:07:51 -0800366 uint32_t major;
367 uint32_t minor;
368 uint32_t max_readahead;
369 uint32_t flags;
Tao Baod7db5942015-01-28 10:07:51 -0800370 uint16_t max_background;
371 uint16_t congestion_threshold;
372 uint32_t max_write;
373 uint32_t time_gran;
Christopher Ferris86a48372019-01-10 14:14:59 -0800374 uint16_t max_pages;
Christopher Ferris9584fa42019-12-09 15:36:13 -0800375 uint16_t map_alignment;
Christopher Ferris86a48372019-01-10 14:14:59 -0800376 uint32_t unused[8];
Ben Cheng655a7c02013-10-16 16:09:24 -0700377};
378#define CUSE_INIT_INFO_MAX 4096
379struct cuse_init_in {
Tao Baod7db5942015-01-28 10:07:51 -0800380 uint32_t major;
381 uint32_t minor;
382 uint32_t unused;
383 uint32_t flags;
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700384};
Ben Cheng655a7c02013-10-16 16:09:24 -0700385struct cuse_init_out {
Tao Baod7db5942015-01-28 10:07:51 -0800386 uint32_t major;
387 uint32_t minor;
Tao Baod7db5942015-01-28 10:07:51 -0800388 uint32_t unused;
389 uint32_t flags;
390 uint32_t max_read;
391 uint32_t max_write;
Tao Baod7db5942015-01-28 10:07:51 -0800392 uint32_t dev_major;
393 uint32_t dev_minor;
394 uint32_t spare[10];
Ben Cheng655a7c02013-10-16 16:09:24 -0700395};
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700396struct fuse_interrupt_in {
Tao Baod7db5942015-01-28 10:07:51 -0800397 uint64_t unique;
Ben Cheng655a7c02013-10-16 16:09:24 -0700398};
399struct fuse_bmap_in {
Tao Baod7db5942015-01-28 10:07:51 -0800400 uint64_t block;
401 uint32_t blocksize;
402 uint32_t padding;
Ben Cheng655a7c02013-10-16 16:09:24 -0700403};
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700404struct fuse_bmap_out {
Tao Baod7db5942015-01-28 10:07:51 -0800405 uint64_t block;
Ben Cheng655a7c02013-10-16 16:09:24 -0700406};
407struct fuse_ioctl_in {
Tao Baod7db5942015-01-28 10:07:51 -0800408 uint64_t fh;
409 uint32_t flags;
410 uint32_t cmd;
411 uint64_t arg;
Tao Baod7db5942015-01-28 10:07:51 -0800412 uint32_t in_size;
413 uint32_t out_size;
Ben Cheng655a7c02013-10-16 16:09:24 -0700414};
415struct fuse_ioctl_iovec {
Tao Baod7db5942015-01-28 10:07:51 -0800416 uint64_t base;
417 uint64_t len;
Ben Cheng655a7c02013-10-16 16:09:24 -0700418};
419struct fuse_ioctl_out {
Tao Baod7db5942015-01-28 10:07:51 -0800420 int32_t result;
421 uint32_t flags;
422 uint32_t in_iovs;
423 uint32_t out_iovs;
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700424};
Ben Cheng655a7c02013-10-16 16:09:24 -0700425struct fuse_poll_in {
Tao Baod7db5942015-01-28 10:07:51 -0800426 uint64_t fh;
427 uint64_t kh;
Tao Baod7db5942015-01-28 10:07:51 -0800428 uint32_t flags;
429 uint32_t events;
Ben Cheng655a7c02013-10-16 16:09:24 -0700430};
431struct fuse_poll_out {
Tao Baod7db5942015-01-28 10:07:51 -0800432 uint32_t revents;
433 uint32_t padding;
Ben Cheng655a7c02013-10-16 16:09:24 -0700434};
435struct fuse_notify_poll_wakeup_out {
Tao Baod7db5942015-01-28 10:07:51 -0800436 uint64_t kh;
Ben Cheng655a7c02013-10-16 16:09:24 -0700437};
438struct fuse_fallocate_in {
Tao Baod7db5942015-01-28 10:07:51 -0800439 uint64_t fh;
Tao Baod7db5942015-01-28 10:07:51 -0800440 uint64_t offset;
441 uint64_t length;
442 uint32_t mode;
443 uint32_t padding;
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700444};
Ben Cheng655a7c02013-10-16 16:09:24 -0700445struct fuse_in_header {
Tao Baod7db5942015-01-28 10:07:51 -0800446 uint32_t len;
447 uint32_t opcode;
Tao Baod7db5942015-01-28 10:07:51 -0800448 uint64_t unique;
449 uint64_t nodeid;
450 uint32_t uid;
451 uint32_t gid;
Tao Baod7db5942015-01-28 10:07:51 -0800452 uint32_t pid;
453 uint32_t padding;
Ben Cheng655a7c02013-10-16 16:09:24 -0700454};
455struct fuse_out_header {
Tao Baod7db5942015-01-28 10:07:51 -0800456 uint32_t len;
457 int32_t error;
458 uint64_t unique;
Ben Cheng655a7c02013-10-16 16:09:24 -0700459};
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700460struct fuse_dirent {
Tao Baod7db5942015-01-28 10:07:51 -0800461 uint64_t ino;
462 uint64_t off;
463 uint32_t namelen;
Tao Baod7db5942015-01-28 10:07:51 -0800464 uint32_t type;
465 char name[];
Ben Cheng655a7c02013-10-16 16:09:24 -0700466};
467#define FUSE_NAME_OFFSET offsetof(struct fuse_dirent, name)
Tao Baod7db5942015-01-28 10:07:51 -0800468#define FUSE_DIRENT_ALIGN(x) (((x) + sizeof(uint64_t) - 1) & ~(sizeof(uint64_t) - 1))
469#define FUSE_DIRENT_SIZE(d) FUSE_DIRENT_ALIGN(FUSE_NAME_OFFSET + (d)->namelen)
Ben Cheng655a7c02013-10-16 16:09:24 -0700470struct fuse_direntplus {
Tao Baod7db5942015-01-28 10:07:51 -0800471 struct fuse_entry_out entry_out;
Tao Baod7db5942015-01-28 10:07:51 -0800472 struct fuse_dirent dirent;
Ben Cheng655a7c02013-10-16 16:09:24 -0700473};
Tao Baod7db5942015-01-28 10:07:51 -0800474#define FUSE_NAME_OFFSET_DIRENTPLUS offsetof(struct fuse_direntplus, dirent.name)
475#define FUSE_DIRENTPLUS_SIZE(d) FUSE_DIRENT_ALIGN(FUSE_NAME_OFFSET_DIRENTPLUS + (d)->dirent.namelen)
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700476struct fuse_notify_inval_inode_out {
Tao Baod7db5942015-01-28 10:07:51 -0800477 uint64_t ino;
478 int64_t off;
479 int64_t len;
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700480};
Ben Cheng655a7c02013-10-16 16:09:24 -0700481struct fuse_notify_inval_entry_out {
Tao Baod7db5942015-01-28 10:07:51 -0800482 uint64_t parent;
483 uint32_t namelen;
Tao Baod7db5942015-01-28 10:07:51 -0800484 uint32_t padding;
Ben Cheng655a7c02013-10-16 16:09:24 -0700485};
486struct fuse_notify_delete_out {
Tao Baod7db5942015-01-28 10:07:51 -0800487 uint64_t parent;
Tao Baod7db5942015-01-28 10:07:51 -0800488 uint64_t child;
489 uint32_t namelen;
490 uint32_t padding;
Ben Cheng655a7c02013-10-16 16:09:24 -0700491};
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700492struct fuse_notify_store_out {
Tao Baod7db5942015-01-28 10:07:51 -0800493 uint64_t nodeid;
494 uint64_t offset;
495 uint32_t size;
Tao Baod7db5942015-01-28 10:07:51 -0800496 uint32_t padding;
Ben Cheng655a7c02013-10-16 16:09:24 -0700497};
498struct fuse_notify_retrieve_out {
Tao Baod7db5942015-01-28 10:07:51 -0800499 uint64_t notify_unique;
Tao Baod7db5942015-01-28 10:07:51 -0800500 uint64_t nodeid;
501 uint64_t offset;
502 uint32_t size;
503 uint32_t padding;
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700504};
Ben Cheng655a7c02013-10-16 16:09:24 -0700505struct fuse_notify_retrieve_in {
Tao Baod7db5942015-01-28 10:07:51 -0800506 uint64_t dummy1;
507 uint64_t offset;
Tao Baod7db5942015-01-28 10:07:51 -0800508 uint32_t size;
509 uint32_t dummy2;
510 uint64_t dummy3;
511 uint64_t dummy4;
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700512};
Christopher Ferris05667cd2021-02-16 16:01:34 -0800513#define FUSE_DEV_IOC_MAGIC 229
514#define FUSE_DEV_IOC_CLONE _IOR(FUSE_DEV_IOC_MAGIC, 0, uint32_t)
Christopher Ferrisfcc3b4f2021-07-01 01:30:21 +0000515#define FUSE_DEV_IOC_PASSTHROUGH_OPEN _IOW(FUSE_DEV_IOC_MAGIC, 126, __u32)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700516struct fuse_lseek_in {
517 uint64_t fh;
518 uint64_t offset;
519 uint32_t whence;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700520 uint32_t padding;
521};
522struct fuse_lseek_out {
523 uint64_t offset;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700524};
Christopher Ferris86a48372019-01-10 14:14:59 -0800525struct fuse_copy_file_range_in {
526 uint64_t fh_in;
527 uint64_t off_in;
528 uint64_t nodeid_out;
529 uint64_t fh_out;
530 uint64_t off_out;
531 uint64_t len;
532 uint64_t flags;
533};
Christopher Ferris32ff3f82020-12-14 13:10:04 -0800534#define FUSE_SETUPMAPPING_FLAG_WRITE (1ull << 0)
535#define FUSE_SETUPMAPPING_FLAG_READ (1ull << 1)
536struct fuse_setupmapping_in {
537 uint64_t fh;
538 uint64_t foffset;
539 uint64_t len;
540 uint64_t flags;
541 uint64_t moffset;
542};
543struct fuse_removemapping_in {
544 uint32_t count;
545};
546struct fuse_removemapping_one {
547 uint64_t moffset;
548 uint64_t len;
549};
550#define FUSE_REMOVEMAPPING_MAX_ENTRY (PAGE_SIZE / sizeof(struct fuse_removemapping_one))
Christopher Ferris3a39c0b2021-09-02 00:03:38 +0000551struct fuse_syncfs_in {
552 uint64_t padding;
553};
Ben Cheng655a7c02013-10-16 16:09:24 -0700554#endif