211 #ifndef _LINUX_FUSE_H
212 #define _LINUX_FUSE_H
215 #include <linux/types.h>
241 #define FUSE_KERNEL_VERSION 7
244 #define FUSE_KERNEL_MINOR_VERSION 38
247 #define FUSE_ROOT_ID 1
271 struct fuse_kstatfs {
284 struct fuse_file_lock {
294 #define FATTR_MODE (1 << 0)
295 #define FATTR_UID (1 << 1)
296 #define FATTR_GID (1 << 2)
297 #define FATTR_SIZE (1 << 3)
298 #define FATTR_ATIME (1 << 4)
299 #define FATTR_MTIME (1 << 5)
300 #define FATTR_FH (1 << 6)
301 #define FATTR_ATIME_NOW (1 << 7)
302 #define FATTR_MTIME_NOW (1 << 8)
303 #define FATTR_LOCKOWNER (1 << 9)
304 #define FATTR_CTIME (1 << 10)
305 #define FATTR_KILL_SUIDGID (1 << 11)
318 #define FOPEN_DIRECT_IO (1 << 0)
319 #define FOPEN_KEEP_CACHE (1 << 1)
320 #define FOPEN_NONSEEKABLE (1 << 2)
321 #define FOPEN_CACHE_DIR (1 << 3)
322 #define FOPEN_STREAM (1 << 4)
323 #define FOPEN_NOFLUSH (1 << 5)
324 #define FOPEN_PARALLEL_DIRECT_WRITES (1 << 6)
373 #define FUSE_ASYNC_READ (1 << 0)
374 #define FUSE_POSIX_LOCKS (1 << 1)
375 #define FUSE_FILE_OPS (1 << 2)
376 #define FUSE_ATOMIC_O_TRUNC (1 << 3)
377 #define FUSE_EXPORT_SUPPORT (1 << 4)
378 #define FUSE_BIG_WRITES (1 << 5)
379 #define FUSE_DONT_MASK (1 << 6)
380 #define FUSE_SPLICE_WRITE (1 << 7)
381 #define FUSE_SPLICE_MOVE (1 << 8)
382 #define FUSE_SPLICE_READ (1 << 9)
383 #define FUSE_FLOCK_LOCKS (1 << 10)
384 #define FUSE_HAS_IOCTL_DIR (1 << 11)
385 #define FUSE_AUTO_INVAL_DATA (1 << 12)
386 #define FUSE_DO_READDIRPLUS (1 << 13)
387 #define FUSE_READDIRPLUS_AUTO (1 << 14)
388 #define FUSE_ASYNC_DIO (1 << 15)
389 #define FUSE_WRITEBACK_CACHE (1 << 16)
390 #define FUSE_NO_OPEN_SUPPORT (1 << 17)
391 #define FUSE_PARALLEL_DIROPS (1 << 18)
392 #define FUSE_HANDLE_KILLPRIV (1 << 19)
393 #define FUSE_POSIX_ACL (1 << 20)
394 #define FUSE_ABORT_ERROR (1 << 21)
395 #define FUSE_MAX_PAGES (1 << 22)
396 #define FUSE_CACHE_SYMLINKS (1 << 23)
397 #define FUSE_NO_OPENDIR_SUPPORT (1 << 24)
398 #define FUSE_EXPLICIT_INVAL_DATA (1 << 25)
399 #define FUSE_MAP_ALIGNMENT (1 << 26)
400 #define FUSE_SUBMOUNTS (1 << 27)
401 #define FUSE_HANDLE_KILLPRIV_V2 (1 << 28)
402 #define FUSE_SETXATTR_EXT (1 << 29)
403 #define FUSE_INIT_EXT (1 << 30)
404 #define FUSE_INIT_RESERVED (1 << 31)
406 #define FUSE_SECURITY_CTX (1ULL << 32)
407 #define FUSE_HAS_INODE_DAX (1ULL << 33)
408 #define FUSE_CREATE_SUPP_GROUP (1ULL << 34)
415 #define CUSE_UNRESTRICTED_IOCTL (1 << 0)
420 #define FUSE_RELEASE_FLUSH (1 << 0)
421 #define FUSE_RELEASE_FLOCK_UNLOCK (1 << 1)
426 #define FUSE_GETATTR_FH (1 << 0)
431 #define FUSE_LK_FLOCK (1 << 0)
440 #define FUSE_WRITE_CACHE (1 << 0)
441 #define FUSE_WRITE_LOCKOWNER (1 << 1)
442 #define FUSE_WRITE_KILL_SUIDGID (1 << 2)
445 #define FUSE_WRITE_KILL_PRIV FUSE_WRITE_KILL_SUIDGID
450 #define FUSE_READ_LOCKOWNER (1 << 1)
464 #define FUSE_IOCTL_COMPAT (1 << 0)
465 #define FUSE_IOCTL_UNRESTRICTED (1 << 1)
466 #define FUSE_IOCTL_RETRY (1 << 2)
467 #define FUSE_IOCTL_32BIT (1 << 3)
468 #define FUSE_IOCTL_DIR (1 << 4)
469 #define FUSE_IOCTL_COMPAT_X32 (1 << 5)
471 #define FUSE_IOCTL_MAX_IOV 256
478 #define FUSE_POLL_SCHEDULE_NOTIFY (1 << 0)
485 #define FUSE_FSYNC_FDATASYNC (1 << 0)
493 #define FUSE_ATTR_SUBMOUNT (1 << 0)
494 #define FUSE_ATTR_DAX (1 << 1)
500 #define FUSE_OPEN_KILL_SUIDGID (1 << 0)
506 #define FUSE_SETXATTR_ACL_KILL_SGID (1 << 0)
512 #define FUSE_EXPIRE_ONLY (1 << 0)
521 FUSE_MAX_NR_SECCTX = 31,
522 FUSE_EXT_GROUPS = 32,
547 FUSE_REMOVEXATTR = 24,
552 FUSE_RELEASEDIR = 29,
564 FUSE_NOTIFY_REPLY = 41,
565 FUSE_BATCH_FORGET = 42,
567 FUSE_READDIRPLUS = 44,
570 FUSE_COPY_FILE_RANGE = 47,
571 FUSE_SETUPMAPPING = 48,
572 FUSE_REMOVEMAPPING = 49,
580 CUSE_INIT_BSWAP_RESERVED = 1048576,
581 FUSE_INIT_BSWAP_RESERVED = 436207616,
584 enum fuse_notify_code {
585 FUSE_NOTIFY_POLL = 1,
586 FUSE_NOTIFY_INVAL_INODE = 2,
587 FUSE_NOTIFY_INVAL_ENTRY = 3,
588 FUSE_NOTIFY_STORE = 4,
589 FUSE_NOTIFY_RETRIEVE = 5,
590 FUSE_NOTIFY_DELETE = 6,
591 FUSE_NOTIFY_CODE_MAX,
595 #define FUSE_MIN_READ_BUFFER 8192
597 #define FUSE_COMPAT_ENTRY_OUT_SIZE 120
599 struct fuse_entry_out {
603 uint64_t entry_valid;
605 uint32_t entry_valid_nsec;
606 uint32_t attr_valid_nsec;
607 struct fuse_attr attr;
610 struct fuse_forget_in {
614 struct fuse_forget_one {
619 struct fuse_batch_forget_in {
624 struct fuse_getattr_in {
625 uint32_t getattr_flags;
630 #define FUSE_COMPAT_ATTR_OUT_SIZE 96
632 struct fuse_attr_out {
634 uint32_t attr_valid_nsec;
636 struct fuse_attr attr;
639 #define FUSE_COMPAT_MKNOD_IN_SIZE 8
641 struct fuse_mknod_in {
648 struct fuse_mkdir_in {
653 struct fuse_rename_in {
657 struct fuse_rename2_in {
663 struct fuse_link_in {
667 struct fuse_setattr_in {
686 struct fuse_open_in {
691 struct fuse_create_in {
698 struct fuse_open_out {
704 struct fuse_release_in {
707 uint32_t release_flags;
711 struct fuse_flush_in {
718 struct fuse_read_in {
728 #define FUSE_COMPAT_WRITE_IN_SIZE 24
730 struct fuse_write_in {
734 uint32_t write_flags;
740 struct fuse_write_out {
745 #define FUSE_COMPAT_STATFS_SIZE 48
747 struct fuse_statfs_out {
748 struct fuse_kstatfs st;
751 struct fuse_fsync_in {
753 uint32_t fsync_flags;
757 #define FUSE_COMPAT_SETXATTR_IN_SIZE 8
759 struct fuse_setxattr_in {
762 uint32_t setxattr_flags;
766 struct fuse_getxattr_in {
771 struct fuse_getxattr_out {
779 struct fuse_file_lock lk;
785 struct fuse_file_lock lk;
788 struct fuse_access_in {
793 struct fuse_init_in {
796 uint32_t max_readahead;
802 #define FUSE_COMPAT_INIT_OUT_SIZE 8
803 #define FUSE_COMPAT_22_INIT_OUT_SIZE 24
805 struct fuse_init_out {
808 uint32_t max_readahead;
810 uint16_t max_background;
811 uint16_t congestion_threshold;
815 uint16_t map_alignment;
820 #define CUSE_INIT_INFO_MAX 4096
822 struct cuse_init_in {
829 struct cuse_init_out {
841 struct fuse_interrupt_in {
845 struct fuse_bmap_in {
851 struct fuse_bmap_out {
855 struct fuse_ioctl_in {
864 struct fuse_ioctl_iovec {
869 struct fuse_ioctl_out {
876 struct fuse_poll_in {
883 struct fuse_poll_out {
888 struct fuse_notify_poll_wakeup_out {
892 struct fuse_fallocate_in {
900 struct fuse_in_header {
908 uint16_t total_extlen;
912 struct fuse_out_header {
927 #define FUSE_REC_ALIGN(x) \
928 (((x) + sizeof(uint64_t) - 1) & ~(sizeof(uint64_t) - 1))
930 #define FUSE_NAME_OFFSET offsetof(struct fuse_dirent, name)
931 #define FUSE_DIRENT_ALIGN(x) FUSE_REC_ALIGN(x)
932 #define FUSE_DIRENT_SIZE(d) \
933 FUSE_DIRENT_ALIGN(FUSE_NAME_OFFSET + (d)->namelen)
935 struct fuse_direntplus {
936 struct fuse_entry_out entry_out;
937 struct fuse_dirent dirent;
940 #define FUSE_NAME_OFFSET_DIRENTPLUS \
941 offsetof(struct fuse_direntplus, dirent.name)
942 #define FUSE_DIRENTPLUS_SIZE(d) \
943 FUSE_DIRENT_ALIGN(FUSE_NAME_OFFSET_DIRENTPLUS + (d)->dirent.namelen)
945 struct fuse_notify_inval_inode_out {
951 struct fuse_notify_inval_entry_out {
957 struct fuse_notify_delete_out {
964 struct fuse_notify_store_out {
971 struct fuse_notify_retrieve_out {
972 uint64_t notify_unique;
980 struct fuse_notify_retrieve_in {
990 #define FUSE_DEV_IOC_MAGIC 229
991 #define FUSE_DEV_IOC_CLONE _IOR(FUSE_DEV_IOC_MAGIC, 0, uint32_t)
993 struct fuse_lseek_in {
1000 struct fuse_lseek_out {
1004 struct fuse_copy_file_range_in {
1007 uint64_t nodeid_out;
1014 #define FUSE_SETUPMAPPING_FLAG_WRITE (1ull << 0)
1015 #define FUSE_SETUPMAPPING_FLAG_READ (1ull << 1)
1016 struct fuse_setupmapping_in {
1029 struct fuse_removemapping_in {
1034 struct fuse_removemapping_one {
1041 #define FUSE_REMOVEMAPPING_MAX_ENTRY \
1042 (PAGE_SIZE / sizeof(struct fuse_removemapping_one))
1044 struct fuse_syncfs_in {
1054 struct fuse_secctx {
1065 struct fuse_secctx_header {