215#include <linux/types.h>
241#define FUSE_KERNEL_VERSION 7
244#define FUSE_KERNEL_MINOR_VERSION 38
247#define FUSE_ROOT_ID 1
284struct 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,
584enum 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
599struct 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;
610struct fuse_forget_in {
614struct fuse_forget_one {
619struct fuse_batch_forget_in {
624struct fuse_getattr_in {
625 uint32_t getattr_flags;
630#define FUSE_COMPAT_ATTR_OUT_SIZE 96
632struct fuse_attr_out {
634 uint32_t attr_valid_nsec;
636 struct fuse_attr attr;
639#define FUSE_COMPAT_MKNOD_IN_SIZE 8
641struct fuse_mknod_in {
648struct fuse_mkdir_in {
653struct fuse_rename_in {
657struct fuse_rename2_in {
667struct fuse_setattr_in {
691struct fuse_create_in {
698struct fuse_open_out {
704struct fuse_release_in {
707 uint32_t release_flags;
711struct fuse_flush_in {
728#define FUSE_COMPAT_WRITE_IN_SIZE 24
730struct fuse_write_in {
734 uint32_t write_flags;
740struct fuse_write_out {
745#define FUSE_COMPAT_STATFS_SIZE 48
747struct fuse_statfs_out {
748 struct fuse_kstatfs st;
751struct fuse_fsync_in {
753 uint32_t fsync_flags;
757#define FUSE_COMPAT_SETXATTR_IN_SIZE 8
759struct fuse_setxattr_in {
762 uint32_t setxattr_flags;
766struct fuse_getxattr_in {
771struct fuse_getxattr_out {
779 struct fuse_file_lock lk;
785 struct fuse_file_lock lk;
788struct fuse_access_in {
796 uint32_t max_readahead;
802#define FUSE_COMPAT_INIT_OUT_SIZE 8
803#define FUSE_COMPAT_22_INIT_OUT_SIZE 24
805struct 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
829struct cuse_init_out {
841struct fuse_interrupt_in {
851struct fuse_bmap_out {
855struct fuse_ioctl_in {
864struct fuse_ioctl_iovec {
869struct fuse_ioctl_out {
883struct fuse_poll_out {
888struct fuse_notify_poll_wakeup_out {
892struct fuse_fallocate_in {
900struct fuse_in_header {
908 uint16_t total_extlen;
912struct 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)
935struct 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)
945struct fuse_notify_inval_inode_out {
951struct fuse_notify_inval_entry_out {
957struct fuse_notify_delete_out {
964struct fuse_notify_store_out {
971struct fuse_notify_retrieve_out {
972 uint64_t notify_unique;
980struct 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)
993struct fuse_lseek_in {
1000struct fuse_lseek_out {
1004struct 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)
1016struct fuse_setupmapping_in {
1029struct fuse_removemapping_in {
1034struct fuse_removemapping_one {
1041#define FUSE_REMOVEMAPPING_MAX_ENTRY \
1042 (PAGE_SIZE / sizeof(struct fuse_removemapping_one))
1044struct fuse_syncfs_in {
1065struct fuse_secctx_header {