blob: 86b01f05a3424ae39f641c56107010542d330718 [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 Ferrisaeddbcf2019-07-08 12:45:46 -070023#define FUSE_KERNEL_MINOR_VERSION 31
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;
41 uint32_t padding;
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)
Ben Cheng655a7c02013-10-16 16:09:24 -070072#define FOPEN_DIRECT_IO (1 << 0)
73#define FOPEN_KEEP_CACHE (1 << 1)
74#define FOPEN_NONSEEKABLE (1 << 2)
Christopher Ferris86a48372019-01-10 14:14:59 -080075#define FOPEN_CACHE_DIR (1 << 3)
Christopher Ferrisaeddbcf2019-07-08 12:45:46 -070076#define FOPEN_STREAM (1 << 4)
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070077#define FUSE_ASYNC_READ (1 << 0)
Ben Cheng655a7c02013-10-16 16:09:24 -070078#define FUSE_POSIX_LOCKS (1 << 1)
79#define FUSE_FILE_OPS (1 << 2)
80#define FUSE_ATOMIC_O_TRUNC (1 << 3)
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070081#define FUSE_EXPORT_SUPPORT (1 << 4)
Ben Cheng655a7c02013-10-16 16:09:24 -070082#define FUSE_BIG_WRITES (1 << 5)
83#define FUSE_DONT_MASK (1 << 6)
84#define FUSE_SPLICE_WRITE (1 << 7)
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070085#define FUSE_SPLICE_MOVE (1 << 8)
Ben Cheng655a7c02013-10-16 16:09:24 -070086#define FUSE_SPLICE_READ (1 << 9)
87#define FUSE_FLOCK_LOCKS (1 << 10)
88#define FUSE_HAS_IOCTL_DIR (1 << 11)
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070089#define FUSE_AUTO_INVAL_DATA (1 << 12)
Ben Cheng655a7c02013-10-16 16:09:24 -070090#define FUSE_DO_READDIRPLUS (1 << 13)
91#define FUSE_READDIRPLUS_AUTO (1 << 14)
92#define FUSE_ASYNC_DIO (1 << 15)
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070093#define FUSE_WRITEBACK_CACHE (1 << 16)
94#define FUSE_NO_OPEN_SUPPORT (1 << 17)
Christopher Ferris106b3a82016-08-24 12:15:38 -070095#define FUSE_PARALLEL_DIROPS (1 << 18)
Christopher Ferris6a9755d2017-01-13 14:09:31 -080096#define FUSE_HANDLE_KILLPRIV (1 << 19)
Christopher Ferris6a9755d2017-01-13 14:09:31 -080097#define FUSE_POSIX_ACL (1 << 20)
Christopher Ferris9ce28842018-10-25 12:11:39 -070098#define FUSE_ABORT_ERROR (1 << 21)
Christopher Ferris86a48372019-01-10 14:14:59 -080099#define FUSE_MAX_PAGES (1 << 22)
100#define FUSE_CACHE_SYMLINKS (1 << 23)
Christopher Ferris24f97eb2019-05-20 12:58:13 -0700101#define FUSE_NO_OPENDIR_SUPPORT (1 << 24)
Christopher Ferrisaeddbcf2019-07-08 12:45:46 -0700102#define FUSE_EXPLICIT_INVAL_DATA (1 << 25)
Christopher Ferris6a9755d2017-01-13 14:09:31 -0800103#define CUSE_UNRESTRICTED_IOCTL (1 << 0)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700104#define FUSE_RELEASE_FLUSH (1 << 0)
Ben Cheng655a7c02013-10-16 16:09:24 -0700105#define FUSE_RELEASE_FLOCK_UNLOCK (1 << 1)
106#define FUSE_GETATTR_FH (1 << 0)
107#define FUSE_LK_FLOCK (1 << 0)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700108#define FUSE_WRITE_CACHE (1 << 0)
Ben Cheng655a7c02013-10-16 16:09:24 -0700109#define FUSE_WRITE_LOCKOWNER (1 << 1)
Christopher Ferrisaeddbcf2019-07-08 12:45:46 -0700110#define FUSE_WRITE_KILL_PRIV (1 << 2)
Ben Cheng655a7c02013-10-16 16:09:24 -0700111#define FUSE_READ_LOCKOWNER (1 << 1)
112#define FUSE_IOCTL_COMPAT (1 << 0)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700113#define FUSE_IOCTL_UNRESTRICTED (1 << 1)
Ben Cheng655a7c02013-10-16 16:09:24 -0700114#define FUSE_IOCTL_RETRY (1 << 2)
115#define FUSE_IOCTL_32BIT (1 << 3)
116#define FUSE_IOCTL_DIR (1 << 4)
Christopher Ferrisaeddbcf2019-07-08 12:45:46 -0700117#define FUSE_IOCTL_COMPAT_X32 (1 << 5)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700118#define FUSE_IOCTL_MAX_IOV 256
Ben Cheng655a7c02013-10-16 16:09:24 -0700119#define FUSE_POLL_SCHEDULE_NOTIFY (1 << 0)
Christopher Ferrisaeddbcf2019-07-08 12:45:46 -0700120#define FUSE_FSYNC_FDATASYNC (1 << 0)
Ben Cheng655a7c02013-10-16 16:09:24 -0700121enum fuse_opcode {
Tao Baod7db5942015-01-28 10:07:51 -0800122 FUSE_LOOKUP = 1,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700123 FUSE_FORGET = 2,
Tao Baod7db5942015-01-28 10:07:51 -0800124 FUSE_GETATTR = 3,
125 FUSE_SETATTR = 4,
126 FUSE_READLINK = 5,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700127 FUSE_SYMLINK = 6,
Tao Baod7db5942015-01-28 10:07:51 -0800128 FUSE_MKNOD = 8,
129 FUSE_MKDIR = 9,
130 FUSE_UNLINK = 10,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700131 FUSE_RMDIR = 11,
Tao Baod7db5942015-01-28 10:07:51 -0800132 FUSE_RENAME = 12,
133 FUSE_LINK = 13,
134 FUSE_OPEN = 14,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700135 FUSE_READ = 15,
Tao Baod7db5942015-01-28 10:07:51 -0800136 FUSE_WRITE = 16,
137 FUSE_STATFS = 17,
138 FUSE_RELEASE = 18,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700139 FUSE_FSYNC = 20,
Tao Baod7db5942015-01-28 10:07:51 -0800140 FUSE_SETXATTR = 21,
141 FUSE_GETXATTR = 22,
142 FUSE_LISTXATTR = 23,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700143 FUSE_REMOVEXATTR = 24,
Tao Baod7db5942015-01-28 10:07:51 -0800144 FUSE_FLUSH = 25,
145 FUSE_INIT = 26,
146 FUSE_OPENDIR = 27,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700147 FUSE_READDIR = 28,
Tao Baod7db5942015-01-28 10:07:51 -0800148 FUSE_RELEASEDIR = 29,
149 FUSE_FSYNCDIR = 30,
150 FUSE_GETLK = 31,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700151 FUSE_SETLK = 32,
Tao Baod7db5942015-01-28 10:07:51 -0800152 FUSE_SETLKW = 33,
153 FUSE_ACCESS = 34,
154 FUSE_CREATE = 35,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700155 FUSE_INTERRUPT = 36,
Tao Baod7db5942015-01-28 10:07:51 -0800156 FUSE_BMAP = 37,
157 FUSE_DESTROY = 38,
158 FUSE_IOCTL = 39,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700159 FUSE_POLL = 40,
Tao Baod7db5942015-01-28 10:07:51 -0800160 FUSE_NOTIFY_REPLY = 41,
161 FUSE_BATCH_FORGET = 42,
162 FUSE_FALLOCATE = 43,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700163 FUSE_READDIRPLUS = 44,
Tao Baod7db5942015-01-28 10:07:51 -0800164 FUSE_RENAME2 = 45,
Christopher Ferris106b3a82016-08-24 12:15:38 -0700165 FUSE_LSEEK = 46,
Christopher Ferris86a48372019-01-10 14:14:59 -0800166 FUSE_COPY_FILE_RANGE = 47,
Tao Baod7db5942015-01-28 10:07:51 -0800167 CUSE_INIT = 4096,
Ben Cheng655a7c02013-10-16 16:09:24 -0700168};
169enum fuse_notify_code {
Tao Baod7db5942015-01-28 10:07:51 -0800170 FUSE_NOTIFY_POLL = 1,
171 FUSE_NOTIFY_INVAL_INODE = 2,
172 FUSE_NOTIFY_INVAL_ENTRY = 3,
173 FUSE_NOTIFY_STORE = 4,
Tao Baod7db5942015-01-28 10:07:51 -0800174 FUSE_NOTIFY_RETRIEVE = 5,
175 FUSE_NOTIFY_DELETE = 6,
176 FUSE_NOTIFY_CODE_MAX,
Ben Cheng655a7c02013-10-16 16:09:24 -0700177};
Ben Cheng655a7c02013-10-16 16:09:24 -0700178#define FUSE_MIN_READ_BUFFER 8192
179#define FUSE_COMPAT_ENTRY_OUT_SIZE 120
180struct fuse_entry_out {
Tao Baod7db5942015-01-28 10:07:51 -0800181 uint64_t nodeid;
Tao Baod7db5942015-01-28 10:07:51 -0800182 uint64_t generation;
183 uint64_t entry_valid;
184 uint64_t attr_valid;
185 uint32_t entry_valid_nsec;
Tao Baod7db5942015-01-28 10:07:51 -0800186 uint32_t attr_valid_nsec;
187 struct fuse_attr attr;
Ben Cheng655a7c02013-10-16 16:09:24 -0700188};
189struct fuse_forget_in {
Tao Baod7db5942015-01-28 10:07:51 -0800190 uint64_t nlookup;
Ben Cheng655a7c02013-10-16 16:09:24 -0700191};
192struct fuse_forget_one {
Tao Baod7db5942015-01-28 10:07:51 -0800193 uint64_t nodeid;
Tao Baod7db5942015-01-28 10:07:51 -0800194 uint64_t nlookup;
Ben Cheng655a7c02013-10-16 16:09:24 -0700195};
196struct fuse_batch_forget_in {
Tao Baod7db5942015-01-28 10:07:51 -0800197 uint32_t count;
Tao Baod7db5942015-01-28 10:07:51 -0800198 uint32_t dummy;
Ben Cheng655a7c02013-10-16 16:09:24 -0700199};
200struct fuse_getattr_in {
Tao Baod7db5942015-01-28 10:07:51 -0800201 uint32_t getattr_flags;
Tao Baod7db5942015-01-28 10:07:51 -0800202 uint32_t dummy;
203 uint64_t fh;
Ben Cheng655a7c02013-10-16 16:09:24 -0700204};
205#define FUSE_COMPAT_ATTR_OUT_SIZE 96
Ben Cheng655a7c02013-10-16 16:09:24 -0700206struct fuse_attr_out {
Tao Baod7db5942015-01-28 10:07:51 -0800207 uint64_t attr_valid;
208 uint32_t attr_valid_nsec;
209 uint32_t dummy;
Tao Baod7db5942015-01-28 10:07:51 -0800210 struct fuse_attr attr;
Ben Cheng655a7c02013-10-16 16:09:24 -0700211};
212#define FUSE_COMPAT_MKNOD_IN_SIZE 8
213struct fuse_mknod_in {
Tao Baod7db5942015-01-28 10:07:51 -0800214 uint32_t mode;
215 uint32_t rdev;
216 uint32_t umask;
217 uint32_t padding;
Ben Cheng655a7c02013-10-16 16:09:24 -0700218};
219struct fuse_mkdir_in {
Tao Baod7db5942015-01-28 10:07:51 -0800220 uint32_t mode;
221 uint32_t umask;
Ben Cheng655a7c02013-10-16 16:09:24 -0700222};
223struct fuse_rename_in {
Tao Baod7db5942015-01-28 10:07:51 -0800224 uint64_t newdir;
Ben Cheng655a7c02013-10-16 16:09:24 -0700225};
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700226struct fuse_rename2_in {
Tao Baod7db5942015-01-28 10:07:51 -0800227 uint64_t newdir;
228 uint32_t flags;
229 uint32_t padding;
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700230};
Ben Cheng655a7c02013-10-16 16:09:24 -0700231struct fuse_link_in {
Tao Baod7db5942015-01-28 10:07:51 -0800232 uint64_t oldnodeid;
Ben Cheng655a7c02013-10-16 16:09:24 -0700233};
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700234struct fuse_setattr_in {
Tao Baod7db5942015-01-28 10:07:51 -0800235 uint32_t valid;
236 uint32_t padding;
237 uint64_t fh;
Tao Baod7db5942015-01-28 10:07:51 -0800238 uint64_t size;
239 uint64_t lock_owner;
240 uint64_t atime;
241 uint64_t mtime;
Tao Baod7db5942015-01-28 10:07:51 -0800242 uint64_t ctime;
243 uint32_t atimensec;
244 uint32_t mtimensec;
245 uint32_t ctimensec;
Tao Baod7db5942015-01-28 10:07:51 -0800246 uint32_t mode;
247 uint32_t unused4;
248 uint32_t uid;
249 uint32_t gid;
Tao Baod7db5942015-01-28 10:07:51 -0800250 uint32_t unused5;
Ben Cheng655a7c02013-10-16 16:09:24 -0700251};
252struct fuse_open_in {
Tao Baod7db5942015-01-28 10:07:51 -0800253 uint32_t flags;
Tao Baod7db5942015-01-28 10:07:51 -0800254 uint32_t unused;
Ben Cheng655a7c02013-10-16 16:09:24 -0700255};
256struct fuse_create_in {
Tao Baod7db5942015-01-28 10:07:51 -0800257 uint32_t flags;
Tao Baod7db5942015-01-28 10:07:51 -0800258 uint32_t mode;
259 uint32_t umask;
260 uint32_t padding;
Ben Cheng655a7c02013-10-16 16:09:24 -0700261};
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700262struct fuse_open_out {
Tao Baod7db5942015-01-28 10:07:51 -0800263 uint64_t fh;
264 uint32_t open_flags;
265 uint32_t padding;
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700266};
Ben Cheng655a7c02013-10-16 16:09:24 -0700267struct fuse_release_in {
Tao Baod7db5942015-01-28 10:07:51 -0800268 uint64_t fh;
269 uint32_t flags;
Tao Baod7db5942015-01-28 10:07:51 -0800270 uint32_t release_flags;
271 uint64_t lock_owner;
Ben Cheng655a7c02013-10-16 16:09:24 -0700272};
273struct fuse_flush_in {
Tao Baod7db5942015-01-28 10:07:51 -0800274 uint64_t fh;
275 uint32_t unused;
276 uint32_t padding;
277 uint64_t lock_owner;
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700278};
Ben Cheng655a7c02013-10-16 16:09:24 -0700279struct fuse_read_in {
Tao Baod7db5942015-01-28 10:07:51 -0800280 uint64_t fh;
281 uint64_t offset;
Tao Baod7db5942015-01-28 10:07:51 -0800282 uint32_t size;
283 uint32_t read_flags;
284 uint64_t lock_owner;
285 uint32_t flags;
Tao Baod7db5942015-01-28 10:07:51 -0800286 uint32_t padding;
Ben Cheng655a7c02013-10-16 16:09:24 -0700287};
288#define FUSE_COMPAT_WRITE_IN_SIZE 24
289struct fuse_write_in {
Tao Baod7db5942015-01-28 10:07:51 -0800290 uint64_t fh;
291 uint64_t offset;
292 uint32_t size;
293 uint32_t write_flags;
Tao Baod7db5942015-01-28 10:07:51 -0800294 uint64_t lock_owner;
295 uint32_t flags;
296 uint32_t padding;
Ben Cheng655a7c02013-10-16 16:09:24 -0700297};
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700298struct fuse_write_out {
Tao Baod7db5942015-01-28 10:07:51 -0800299 uint32_t size;
300 uint32_t padding;
Ben Cheng655a7c02013-10-16 16:09:24 -0700301};
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700302#define FUSE_COMPAT_STATFS_SIZE 48
Ben Cheng655a7c02013-10-16 16:09:24 -0700303struct fuse_statfs_out {
Tao Baod7db5942015-01-28 10:07:51 -0800304 struct fuse_kstatfs st;
Ben Cheng655a7c02013-10-16 16:09:24 -0700305};
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700306struct fuse_fsync_in {
Tao Baod7db5942015-01-28 10:07:51 -0800307 uint64_t fh;
308 uint32_t fsync_flags;
309 uint32_t padding;
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700310};
Ben Cheng655a7c02013-10-16 16:09:24 -0700311struct fuse_setxattr_in {
Tao Baod7db5942015-01-28 10:07:51 -0800312 uint32_t size;
313 uint32_t flags;
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700314};
Ben Cheng655a7c02013-10-16 16:09:24 -0700315struct fuse_getxattr_in {
Tao Baod7db5942015-01-28 10:07:51 -0800316 uint32_t size;
317 uint32_t padding;
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700318};
Ben Cheng655a7c02013-10-16 16:09:24 -0700319struct fuse_getxattr_out {
Tao Baod7db5942015-01-28 10:07:51 -0800320 uint32_t size;
321 uint32_t padding;
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700322};
Ben Cheng655a7c02013-10-16 16:09:24 -0700323struct fuse_lk_in {
Tao Baod7db5942015-01-28 10:07:51 -0800324 uint64_t fh;
325 uint64_t owner;
Tao Baod7db5942015-01-28 10:07:51 -0800326 struct fuse_file_lock lk;
327 uint32_t lk_flags;
328 uint32_t padding;
Ben Cheng655a7c02013-10-16 16:09:24 -0700329};
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700330struct fuse_lk_out {
Tao Baod7db5942015-01-28 10:07:51 -0800331 struct fuse_file_lock lk;
Ben Cheng655a7c02013-10-16 16:09:24 -0700332};
333struct fuse_access_in {
Tao Baod7db5942015-01-28 10:07:51 -0800334 uint32_t mask;
335 uint32_t padding;
Ben Cheng655a7c02013-10-16 16:09:24 -0700336};
337struct fuse_init_in {
Tao Baod7db5942015-01-28 10:07:51 -0800338 uint32_t major;
339 uint32_t minor;
340 uint32_t max_readahead;
341 uint32_t flags;
Ben Cheng655a7c02013-10-16 16:09:24 -0700342};
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700343#define FUSE_COMPAT_INIT_OUT_SIZE 8
344#define FUSE_COMPAT_22_INIT_OUT_SIZE 24
Ben Cheng655a7c02013-10-16 16:09:24 -0700345struct fuse_init_out {
Tao Baod7db5942015-01-28 10:07:51 -0800346 uint32_t major;
347 uint32_t minor;
348 uint32_t max_readahead;
349 uint32_t flags;
Tao Baod7db5942015-01-28 10:07:51 -0800350 uint16_t max_background;
351 uint16_t congestion_threshold;
352 uint32_t max_write;
353 uint32_t time_gran;
Christopher Ferris86a48372019-01-10 14:14:59 -0800354 uint16_t max_pages;
355 uint16_t padding;
356 uint32_t unused[8];
Ben Cheng655a7c02013-10-16 16:09:24 -0700357};
358#define CUSE_INIT_INFO_MAX 4096
359struct cuse_init_in {
Tao Baod7db5942015-01-28 10:07:51 -0800360 uint32_t major;
361 uint32_t minor;
362 uint32_t unused;
363 uint32_t flags;
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700364};
Ben Cheng655a7c02013-10-16 16:09:24 -0700365struct cuse_init_out {
Tao Baod7db5942015-01-28 10:07:51 -0800366 uint32_t major;
367 uint32_t minor;
Tao Baod7db5942015-01-28 10:07:51 -0800368 uint32_t unused;
369 uint32_t flags;
370 uint32_t max_read;
371 uint32_t max_write;
Tao Baod7db5942015-01-28 10:07:51 -0800372 uint32_t dev_major;
373 uint32_t dev_minor;
374 uint32_t spare[10];
Ben Cheng655a7c02013-10-16 16:09:24 -0700375};
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700376struct fuse_interrupt_in {
Tao Baod7db5942015-01-28 10:07:51 -0800377 uint64_t unique;
Ben Cheng655a7c02013-10-16 16:09:24 -0700378};
379struct fuse_bmap_in {
Tao Baod7db5942015-01-28 10:07:51 -0800380 uint64_t block;
381 uint32_t blocksize;
382 uint32_t padding;
Ben Cheng655a7c02013-10-16 16:09:24 -0700383};
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700384struct fuse_bmap_out {
Tao Baod7db5942015-01-28 10:07:51 -0800385 uint64_t block;
Ben Cheng655a7c02013-10-16 16:09:24 -0700386};
387struct fuse_ioctl_in {
Tao Baod7db5942015-01-28 10:07:51 -0800388 uint64_t fh;
389 uint32_t flags;
390 uint32_t cmd;
391 uint64_t arg;
Tao Baod7db5942015-01-28 10:07:51 -0800392 uint32_t in_size;
393 uint32_t out_size;
Ben Cheng655a7c02013-10-16 16:09:24 -0700394};
395struct fuse_ioctl_iovec {
Tao Baod7db5942015-01-28 10:07:51 -0800396 uint64_t base;
397 uint64_t len;
Ben Cheng655a7c02013-10-16 16:09:24 -0700398};
399struct fuse_ioctl_out {
Tao Baod7db5942015-01-28 10:07:51 -0800400 int32_t result;
401 uint32_t flags;
402 uint32_t in_iovs;
403 uint32_t out_iovs;
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700404};
Ben Cheng655a7c02013-10-16 16:09:24 -0700405struct fuse_poll_in {
Tao Baod7db5942015-01-28 10:07:51 -0800406 uint64_t fh;
407 uint64_t kh;
Tao Baod7db5942015-01-28 10:07:51 -0800408 uint32_t flags;
409 uint32_t events;
Ben Cheng655a7c02013-10-16 16:09:24 -0700410};
411struct fuse_poll_out {
Tao Baod7db5942015-01-28 10:07:51 -0800412 uint32_t revents;
413 uint32_t padding;
Ben Cheng655a7c02013-10-16 16:09:24 -0700414};
415struct fuse_notify_poll_wakeup_out {
Tao Baod7db5942015-01-28 10:07:51 -0800416 uint64_t kh;
Ben Cheng655a7c02013-10-16 16:09:24 -0700417};
418struct fuse_fallocate_in {
Tao Baod7db5942015-01-28 10:07:51 -0800419 uint64_t fh;
Tao Baod7db5942015-01-28 10:07:51 -0800420 uint64_t offset;
421 uint64_t length;
422 uint32_t mode;
423 uint32_t padding;
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700424};
Ben Cheng655a7c02013-10-16 16:09:24 -0700425struct fuse_in_header {
Tao Baod7db5942015-01-28 10:07:51 -0800426 uint32_t len;
427 uint32_t opcode;
Tao Baod7db5942015-01-28 10:07:51 -0800428 uint64_t unique;
429 uint64_t nodeid;
430 uint32_t uid;
431 uint32_t gid;
Tao Baod7db5942015-01-28 10:07:51 -0800432 uint32_t pid;
433 uint32_t padding;
Ben Cheng655a7c02013-10-16 16:09:24 -0700434};
435struct fuse_out_header {
Tao Baod7db5942015-01-28 10:07:51 -0800436 uint32_t len;
437 int32_t error;
438 uint64_t unique;
Ben Cheng655a7c02013-10-16 16:09:24 -0700439};
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700440struct fuse_dirent {
Tao Baod7db5942015-01-28 10:07:51 -0800441 uint64_t ino;
442 uint64_t off;
443 uint32_t namelen;
Tao Baod7db5942015-01-28 10:07:51 -0800444 uint32_t type;
445 char name[];
Ben Cheng655a7c02013-10-16 16:09:24 -0700446};
447#define FUSE_NAME_OFFSET offsetof(struct fuse_dirent, name)
Tao Baod7db5942015-01-28 10:07:51 -0800448#define FUSE_DIRENT_ALIGN(x) (((x) + sizeof(uint64_t) - 1) & ~(sizeof(uint64_t) - 1))
449#define FUSE_DIRENT_SIZE(d) FUSE_DIRENT_ALIGN(FUSE_NAME_OFFSET + (d)->namelen)
Ben Cheng655a7c02013-10-16 16:09:24 -0700450struct fuse_direntplus {
Tao Baod7db5942015-01-28 10:07:51 -0800451 struct fuse_entry_out entry_out;
Tao Baod7db5942015-01-28 10:07:51 -0800452 struct fuse_dirent dirent;
Ben Cheng655a7c02013-10-16 16:09:24 -0700453};
Tao Baod7db5942015-01-28 10:07:51 -0800454#define FUSE_NAME_OFFSET_DIRENTPLUS offsetof(struct fuse_direntplus, dirent.name)
455#define FUSE_DIRENTPLUS_SIZE(d) FUSE_DIRENT_ALIGN(FUSE_NAME_OFFSET_DIRENTPLUS + (d)->dirent.namelen)
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700456struct fuse_notify_inval_inode_out {
Tao Baod7db5942015-01-28 10:07:51 -0800457 uint64_t ino;
458 int64_t off;
459 int64_t len;
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700460};
Ben Cheng655a7c02013-10-16 16:09:24 -0700461struct fuse_notify_inval_entry_out {
Tao Baod7db5942015-01-28 10:07:51 -0800462 uint64_t parent;
463 uint32_t namelen;
Tao Baod7db5942015-01-28 10:07:51 -0800464 uint32_t padding;
Ben Cheng655a7c02013-10-16 16:09:24 -0700465};
466struct fuse_notify_delete_out {
Tao Baod7db5942015-01-28 10:07:51 -0800467 uint64_t parent;
Tao Baod7db5942015-01-28 10:07:51 -0800468 uint64_t child;
469 uint32_t namelen;
470 uint32_t padding;
Ben Cheng655a7c02013-10-16 16:09:24 -0700471};
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700472struct fuse_notify_store_out {
Tao Baod7db5942015-01-28 10:07:51 -0800473 uint64_t nodeid;
474 uint64_t offset;
475 uint32_t size;
Tao Baod7db5942015-01-28 10:07:51 -0800476 uint32_t padding;
Ben Cheng655a7c02013-10-16 16:09:24 -0700477};
478struct fuse_notify_retrieve_out {
Tao Baod7db5942015-01-28 10:07:51 -0800479 uint64_t notify_unique;
Tao Baod7db5942015-01-28 10:07:51 -0800480 uint64_t nodeid;
481 uint64_t offset;
482 uint32_t size;
483 uint32_t padding;
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700484};
Ben Cheng655a7c02013-10-16 16:09:24 -0700485struct fuse_notify_retrieve_in {
Tao Baod7db5942015-01-28 10:07:51 -0800486 uint64_t dummy1;
487 uint64_t offset;
Tao Baod7db5942015-01-28 10:07:51 -0800488 uint32_t size;
489 uint32_t dummy2;
490 uint64_t dummy3;
491 uint64_t dummy4;
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700492};
Christopher Ferris05d08e92016-02-04 13:16:38 -0800493#define FUSE_DEV_IOC_CLONE _IOR(229, 0, uint32_t)
Christopher Ferris106b3a82016-08-24 12:15:38 -0700494struct fuse_lseek_in {
495 uint64_t fh;
496 uint64_t offset;
497 uint32_t whence;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700498 uint32_t padding;
499};
500struct fuse_lseek_out {
501 uint64_t offset;
Christopher Ferris106b3a82016-08-24 12:15:38 -0700502};
Christopher Ferris86a48372019-01-10 14:14:59 -0800503struct fuse_copy_file_range_in {
504 uint64_t fh_in;
505 uint64_t off_in;
506 uint64_t nodeid_out;
507 uint64_t fh_out;
508 uint64_t off_out;
509 uint64_t len;
510 uint64_t flags;
511};
Ben Cheng655a7c02013-10-16 16:09:24 -0700512#endif