• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /****************************************************************************
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
23 #define FUSE_KERNEL_MINOR_VERSION 38
24 #define FUSE_ROOT_ID 1
25 struct fuse_attr {
26   uint64_t ino;
27   uint64_t size;
28   uint64_t blocks;
29   uint64_t atime;
30   uint64_t mtime;
31   uint64_t ctime;
32   uint32_t atimensec;
33   uint32_t mtimensec;
34   uint32_t ctimensec;
35   uint32_t mode;
36   uint32_t nlink;
37   uint32_t uid;
38   uint32_t gid;
39   uint32_t rdev;
40   uint32_t blksize;
41   uint32_t flags;
42 };
43 struct fuse_kstatfs {
44   uint64_t blocks;
45   uint64_t bfree;
46   uint64_t bavail;
47   uint64_t files;
48   uint64_t ffree;
49   uint32_t bsize;
50   uint32_t namelen;
51   uint32_t frsize;
52   uint32_t padding;
53   uint32_t spare[6];
54 };
55 struct fuse_file_lock {
56   uint64_t start;
57   uint64_t end;
58   uint32_t type;
59   uint32_t pid;
60 };
61 #define FATTR_MODE (1 << 0)
62 #define FATTR_UID (1 << 1)
63 #define FATTR_GID (1 << 2)
64 #define FATTR_SIZE (1 << 3)
65 #define FATTR_ATIME (1 << 4)
66 #define FATTR_MTIME (1 << 5)
67 #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)
71 #define FATTR_CTIME (1 << 10)
72 #define FATTR_KILL_SUIDGID (1 << 11)
73 #define FOPEN_DIRECT_IO (1 << 0)
74 #define FOPEN_KEEP_CACHE (1 << 1)
75 #define FOPEN_NONSEEKABLE (1 << 2)
76 #define FOPEN_CACHE_DIR (1 << 3)
77 #define FOPEN_STREAM (1 << 4)
78 #define FOPEN_NOFLUSH (1 << 5)
79 #define FOPEN_PARALLEL_DIRECT_WRITES (1 << 6)
80 #define FUSE_ASYNC_READ (1 << 0)
81 #define FUSE_POSIX_LOCKS (1 << 1)
82 #define FUSE_FILE_OPS (1 << 2)
83 #define FUSE_ATOMIC_O_TRUNC (1 << 3)
84 #define FUSE_EXPORT_SUPPORT (1 << 4)
85 #define FUSE_BIG_WRITES (1 << 5)
86 #define FUSE_DONT_MASK (1 << 6)
87 #define FUSE_SPLICE_WRITE (1 << 7)
88 #define FUSE_SPLICE_MOVE (1 << 8)
89 #define FUSE_SPLICE_READ (1 << 9)
90 #define FUSE_FLOCK_LOCKS (1 << 10)
91 #define FUSE_HAS_IOCTL_DIR (1 << 11)
92 #define FUSE_AUTO_INVAL_DATA (1 << 12)
93 #define FUSE_DO_READDIRPLUS (1 << 13)
94 #define FUSE_READDIRPLUS_AUTO (1 << 14)
95 #define FUSE_ASYNC_DIO (1 << 15)
96 #define FUSE_WRITEBACK_CACHE (1 << 16)
97 #define FUSE_NO_OPEN_SUPPORT (1 << 17)
98 #define FUSE_PARALLEL_DIROPS (1 << 18)
99 #define FUSE_HANDLE_KILLPRIV (1 << 19)
100 #define FUSE_POSIX_ACL (1 << 20)
101 #define FUSE_ABORT_ERROR (1 << 21)
102 #define FUSE_MAX_PAGES (1 << 22)
103 #define FUSE_CACHE_SYMLINKS (1 << 23)
104 #define FUSE_NO_OPENDIR_SUPPORT (1 << 24)
105 #define FUSE_EXPLICIT_INVAL_DATA (1 << 25)
106 #define FUSE_MAP_ALIGNMENT (1 << 26)
107 #define FUSE_SUBMOUNTS (1 << 27)
108 #define FUSE_HANDLE_KILLPRIV_V2 (1 << 28)
109 #define FUSE_SETXATTR_EXT (1 << 29)
110 #define FUSE_INIT_EXT (1 << 30)
111 #define FUSE_INIT_RESERVED (1 << 31)
112 #define FUSE_SECURITY_CTX (1ULL << 32)
113 #define FUSE_HAS_INODE_DAX (1ULL << 33)
114 #if FUSE_KERNEL_VERSION > 7 || FUSE_KERNEL_VERSION == 7 && FUSE_KERNEL_MINOR_VERSION >= 36
115 #define FUSE_PASSTHROUGH (1ULL << 63)
116 #else
117 #define FUSE_PASSTHROUGH (1 << 31)
118 #endif
119 #define CUSE_UNRESTRICTED_IOCTL (1 << 0)
120 #define FUSE_RELEASE_FLUSH (1 << 0)
121 #define FUSE_RELEASE_FLOCK_UNLOCK (1 << 1)
122 #define FUSE_GETATTR_FH (1 << 0)
123 #define FUSE_LK_FLOCK (1 << 0)
124 #define FUSE_WRITE_CACHE (1 << 0)
125 #define FUSE_WRITE_LOCKOWNER (1 << 1)
126 #define FUSE_WRITE_KILL_SUIDGID (1 << 2)
127 #define FUSE_WRITE_KILL_PRIV FUSE_WRITE_KILL_SUIDGID
128 #define FUSE_READ_LOCKOWNER (1 << 1)
129 #define FUSE_IOCTL_COMPAT (1 << 0)
130 #define FUSE_IOCTL_UNRESTRICTED (1 << 1)
131 #define FUSE_IOCTL_RETRY (1 << 2)
132 #define FUSE_IOCTL_32BIT (1 << 3)
133 #define FUSE_IOCTL_DIR (1 << 4)
134 #define FUSE_IOCTL_COMPAT_X32 (1 << 5)
135 #define FUSE_IOCTL_MAX_IOV 256
136 #define FUSE_POLL_SCHEDULE_NOTIFY (1 << 0)
137 #define FUSE_FSYNC_FDATASYNC (1 << 0)
138 #define FUSE_ATTR_SUBMOUNT (1 << 0)
139 #define FUSE_ATTR_DAX (1 << 1)
140 #define FUSE_OPEN_KILL_SUIDGID (1 << 0)
141 #define FUSE_SETXATTR_ACL_KILL_SGID (1 << 0)
142 #define FUSE_EXPIRE_ONLY (1 << 0)
143 enum fuse_opcode {
144   FUSE_LOOKUP = 1,
145   FUSE_FORGET = 2,
146   FUSE_GETATTR = 3,
147   FUSE_SETATTR = 4,
148   FUSE_READLINK = 5,
149   FUSE_SYMLINK = 6,
150   FUSE_MKNOD = 8,
151   FUSE_MKDIR = 9,
152   FUSE_UNLINK = 10,
153   FUSE_RMDIR = 11,
154   FUSE_RENAME = 12,
155   FUSE_LINK = 13,
156   FUSE_OPEN = 14,
157   FUSE_READ = 15,
158   FUSE_WRITE = 16,
159   FUSE_STATFS = 17,
160   FUSE_RELEASE = 18,
161   FUSE_FSYNC = 20,
162   FUSE_SETXATTR = 21,
163   FUSE_GETXATTR = 22,
164   FUSE_LISTXATTR = 23,
165   FUSE_REMOVEXATTR = 24,
166   FUSE_FLUSH = 25,
167   FUSE_INIT = 26,
168   FUSE_OPENDIR = 27,
169   FUSE_READDIR = 28,
170   FUSE_RELEASEDIR = 29,
171   FUSE_FSYNCDIR = 30,
172   FUSE_GETLK = 31,
173   FUSE_SETLK = 32,
174   FUSE_SETLKW = 33,
175   FUSE_ACCESS = 34,
176   FUSE_CREATE = 35,
177   FUSE_INTERRUPT = 36,
178   FUSE_BMAP = 37,
179   FUSE_DESTROY = 38,
180   FUSE_IOCTL = 39,
181   FUSE_POLL = 40,
182   FUSE_NOTIFY_REPLY = 41,
183   FUSE_BATCH_FORGET = 42,
184   FUSE_FALLOCATE = 43,
185   FUSE_READDIRPLUS = 44,
186   FUSE_RENAME2 = 45,
187   FUSE_LSEEK = 46,
188   FUSE_COPY_FILE_RANGE = 47,
189   FUSE_SETUPMAPPING = 48,
190   FUSE_REMOVEMAPPING = 49,
191   FUSE_SYNCFS = 50,
192   FUSE_TMPFILE = 51,
193   FUSE_CANONICAL_PATH = 2016,
194   CUSE_INIT = 4096,
195   CUSE_INIT_BSWAP_RESERVED = 1048576,
196   FUSE_INIT_BSWAP_RESERVED = 436207616,
197 };
198 enum fuse_notify_code {
199   FUSE_NOTIFY_POLL = 1,
200   FUSE_NOTIFY_INVAL_INODE = 2,
201   FUSE_NOTIFY_INVAL_ENTRY = 3,
202   FUSE_NOTIFY_STORE = 4,
203   FUSE_NOTIFY_RETRIEVE = 5,
204   FUSE_NOTIFY_DELETE = 6,
205   FUSE_NOTIFY_CODE_MAX,
206 };
207 #define FUSE_MIN_READ_BUFFER 8192
208 #define FUSE_COMPAT_ENTRY_OUT_SIZE 120
209 struct fuse_entry_out {
210   uint64_t nodeid;
211   uint64_t generation;
212   uint64_t entry_valid;
213   uint64_t attr_valid;
214   uint32_t entry_valid_nsec;
215   uint32_t attr_valid_nsec;
216   struct fuse_attr attr;
217 };
218 struct fuse_forget_in {
219   uint64_t nlookup;
220 };
221 struct fuse_forget_one {
222   uint64_t nodeid;
223   uint64_t nlookup;
224 };
225 struct fuse_batch_forget_in {
226   uint32_t count;
227   uint32_t dummy;
228 };
229 struct fuse_getattr_in {
230   uint32_t getattr_flags;
231   uint32_t dummy;
232   uint64_t fh;
233 };
234 #define FUSE_COMPAT_ATTR_OUT_SIZE 96
235 struct fuse_attr_out {
236   uint64_t attr_valid;
237   uint32_t attr_valid_nsec;
238   uint32_t dummy;
239   struct fuse_attr attr;
240 };
241 #define FUSE_COMPAT_MKNOD_IN_SIZE 8
242 struct fuse_mknod_in {
243   uint32_t mode;
244   uint32_t rdev;
245   uint32_t umask;
246   uint32_t padding;
247 };
248 struct fuse_mkdir_in {
249   uint32_t mode;
250   uint32_t umask;
251 };
252 struct fuse_rename_in {
253   uint64_t newdir;
254 };
255 struct fuse_rename2_in {
256   uint64_t newdir;
257   uint32_t flags;
258   uint32_t padding;
259 };
260 struct fuse_link_in {
261   uint64_t oldnodeid;
262 };
263 struct fuse_setattr_in {
264   uint32_t valid;
265   uint32_t padding;
266   uint64_t fh;
267   uint64_t size;
268   uint64_t lock_owner;
269   uint64_t atime;
270   uint64_t mtime;
271   uint64_t ctime;
272   uint32_t atimensec;
273   uint32_t mtimensec;
274   uint32_t ctimensec;
275   uint32_t mode;
276   uint32_t unused4;
277   uint32_t uid;
278   uint32_t gid;
279   uint32_t unused5;
280 };
281 struct fuse_open_in {
282   uint32_t flags;
283   uint32_t open_flags;
284 };
285 struct fuse_create_in {
286   uint32_t flags;
287   uint32_t mode;
288   uint32_t umask;
289   uint32_t open_flags;
290 };
291 struct fuse_open_out {
292   uint64_t fh;
293   uint32_t open_flags;
294   uint32_t passthrough_fh;
295 };
296 struct fuse_release_in {
297   uint64_t fh;
298   uint32_t flags;
299   uint32_t release_flags;
300   uint64_t lock_owner;
301 };
302 struct fuse_flush_in {
303   uint64_t fh;
304   uint32_t unused;
305   uint32_t padding;
306   uint64_t lock_owner;
307 };
308 struct fuse_read_in {
309   uint64_t fh;
310   uint64_t offset;
311   uint32_t size;
312   uint32_t read_flags;
313   uint64_t lock_owner;
314   uint32_t flags;
315   uint32_t padding;
316 };
317 #define FUSE_COMPAT_WRITE_IN_SIZE 24
318 struct fuse_write_in {
319   uint64_t fh;
320   uint64_t offset;
321   uint32_t size;
322   uint32_t write_flags;
323   uint64_t lock_owner;
324   uint32_t flags;
325   uint32_t padding;
326 };
327 struct fuse_write_out {
328   uint32_t size;
329   uint32_t padding;
330 };
331 #define FUSE_COMPAT_STATFS_SIZE 48
332 struct fuse_statfs_out {
333   struct fuse_kstatfs st;
334 };
335 struct fuse_fsync_in {
336   uint64_t fh;
337   uint32_t fsync_flags;
338   uint32_t padding;
339 };
340 #define FUSE_COMPAT_SETXATTR_IN_SIZE 8
341 struct fuse_setxattr_in {
342   uint32_t size;
343   uint32_t flags;
344   uint32_t setxattr_flags;
345   uint32_t padding;
346 };
347 struct fuse_getxattr_in {
348   uint32_t size;
349   uint32_t padding;
350 };
351 struct fuse_getxattr_out {
352   uint32_t size;
353   uint32_t padding;
354 };
355 struct fuse_lk_in {
356   uint64_t fh;
357   uint64_t owner;
358   struct fuse_file_lock lk;
359   uint32_t lk_flags;
360   uint32_t padding;
361 };
362 struct fuse_lk_out {
363   struct fuse_file_lock lk;
364 };
365 struct fuse_access_in {
366   uint32_t mask;
367   uint32_t padding;
368 };
369 struct fuse_init_in {
370   uint32_t major;
371   uint32_t minor;
372   uint32_t max_readahead;
373   uint32_t flags;
374   uint32_t flags2;
375   uint32_t unused[11];
376 };
377 #define FUSE_COMPAT_INIT_OUT_SIZE 8
378 #define FUSE_COMPAT_22_INIT_OUT_SIZE 24
379 struct fuse_init_out {
380   uint32_t major;
381   uint32_t minor;
382   uint32_t max_readahead;
383   uint32_t flags;
384   uint16_t max_background;
385   uint16_t congestion_threshold;
386   uint32_t max_write;
387   uint32_t time_gran;
388   uint16_t max_pages;
389   uint16_t map_alignment;
390   uint32_t flags2;
391   uint32_t unused[7];
392 };
393 #define CUSE_INIT_INFO_MAX 4096
394 struct cuse_init_in {
395   uint32_t major;
396   uint32_t minor;
397   uint32_t unused;
398   uint32_t flags;
399 };
400 struct cuse_init_out {
401   uint32_t major;
402   uint32_t minor;
403   uint32_t unused;
404   uint32_t flags;
405   uint32_t max_read;
406   uint32_t max_write;
407   uint32_t dev_major;
408   uint32_t dev_minor;
409   uint32_t spare[10];
410 };
411 struct fuse_interrupt_in {
412   uint64_t unique;
413 };
414 struct fuse_bmap_in {
415   uint64_t block;
416   uint32_t blocksize;
417   uint32_t padding;
418 };
419 struct fuse_bmap_out {
420   uint64_t block;
421 };
422 struct fuse_ioctl_in {
423   uint64_t fh;
424   uint32_t flags;
425   uint32_t cmd;
426   uint64_t arg;
427   uint32_t in_size;
428   uint32_t out_size;
429 };
430 struct fuse_ioctl_iovec {
431   uint64_t base;
432   uint64_t len;
433 };
434 struct fuse_ioctl_out {
435   int32_t result;
436   uint32_t flags;
437   uint32_t in_iovs;
438   uint32_t out_iovs;
439 };
440 struct fuse_poll_in {
441   uint64_t fh;
442   uint64_t kh;
443   uint32_t flags;
444   uint32_t events;
445 };
446 struct fuse_poll_out {
447   uint32_t revents;
448   uint32_t padding;
449 };
450 struct fuse_notify_poll_wakeup_out {
451   uint64_t kh;
452 };
453 struct fuse_fallocate_in {
454   uint64_t fh;
455   uint64_t offset;
456   uint64_t length;
457   uint32_t mode;
458   uint32_t padding;
459 };
460 struct fuse_in_header {
461   uint32_t len;
462   uint32_t opcode;
463   uint64_t unique;
464   uint64_t nodeid;
465   uint32_t uid;
466   uint32_t gid;
467   uint32_t pid;
468   uint32_t padding;
469 };
470 struct fuse_out_header {
471   uint32_t len;
472   int32_t error;
473   uint64_t unique;
474 };
475 struct fuse_dirent {
476   uint64_t ino;
477   uint64_t off;
478   uint32_t namelen;
479   uint32_t type;
480   char name[];
481 };
482 #define FUSE_REC_ALIGN(x) (((x) + sizeof(uint64_t) - 1) & ~(sizeof(uint64_t) - 1))
483 #define FUSE_NAME_OFFSET offsetof(struct fuse_dirent, name)
484 #define FUSE_DIRENT_ALIGN(x) FUSE_REC_ALIGN(x)
485 #define FUSE_DIRENT_SIZE(d) FUSE_DIRENT_ALIGN(FUSE_NAME_OFFSET + (d)->namelen)
486 struct fuse_direntplus {
487   struct fuse_entry_out entry_out;
488   struct fuse_dirent dirent;
489 };
490 #define FUSE_NAME_OFFSET_DIRENTPLUS offsetof(struct fuse_direntplus, dirent.name)
491 #define FUSE_DIRENTPLUS_SIZE(d) FUSE_DIRENT_ALIGN(FUSE_NAME_OFFSET_DIRENTPLUS + (d)->dirent.namelen)
492 struct fuse_notify_inval_inode_out {
493   uint64_t ino;
494   int64_t off;
495   int64_t len;
496 };
497 struct fuse_notify_inval_entry_out {
498   uint64_t parent;
499   uint32_t namelen;
500   uint32_t flags;
501 };
502 struct fuse_notify_delete_out {
503   uint64_t parent;
504   uint64_t child;
505   uint32_t namelen;
506   uint32_t padding;
507 };
508 struct fuse_notify_store_out {
509   uint64_t nodeid;
510   uint64_t offset;
511   uint32_t size;
512   uint32_t padding;
513 };
514 struct fuse_notify_retrieve_out {
515   uint64_t notify_unique;
516   uint64_t nodeid;
517   uint64_t offset;
518   uint32_t size;
519   uint32_t padding;
520 };
521 struct fuse_notify_retrieve_in {
522   uint64_t dummy1;
523   uint64_t offset;
524   uint32_t size;
525   uint32_t dummy2;
526   uint64_t dummy3;
527   uint64_t dummy4;
528 };
529 #define FUSE_DEV_IOC_MAGIC 229
530 #define FUSE_DEV_IOC_CLONE _IOR(FUSE_DEV_IOC_MAGIC, 0, uint32_t)
531 #define FUSE_DEV_IOC_PASSTHROUGH_OPEN _IOW(FUSE_DEV_IOC_MAGIC, 126, uint32_t)
532 struct fuse_lseek_in {
533   uint64_t fh;
534   uint64_t offset;
535   uint32_t whence;
536   uint32_t padding;
537 };
538 struct fuse_lseek_out {
539   uint64_t offset;
540 };
541 struct fuse_copy_file_range_in {
542   uint64_t fh_in;
543   uint64_t off_in;
544   uint64_t nodeid_out;
545   uint64_t fh_out;
546   uint64_t off_out;
547   uint64_t len;
548   uint64_t flags;
549 };
550 #define FUSE_SETUPMAPPING_FLAG_WRITE (1ull << 0)
551 #define FUSE_SETUPMAPPING_FLAG_READ (1ull << 1)
552 struct fuse_setupmapping_in {
553   uint64_t fh;
554   uint64_t foffset;
555   uint64_t len;
556   uint64_t flags;
557   uint64_t moffset;
558 };
559 struct fuse_removemapping_in {
560   uint32_t count;
561 };
562 struct fuse_removemapping_one {
563   uint64_t moffset;
564   uint64_t len;
565 };
566 #define FUSE_REMOVEMAPPING_MAX_ENTRY (PAGE_SIZE / sizeof(struct fuse_removemapping_one))
567 struct fuse_syncfs_in {
568   uint64_t padding;
569 };
570 struct fuse_secctx {
571   uint32_t size;
572   uint32_t padding;
573 };
574 struct fuse_secctx_header {
575   uint32_t size;
576   uint32_t nr_secctx;
577 };
578 #endif
579