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