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