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