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