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