Miklos Szeredi | d8a5ba4 | 2005-09-09 13:10:26 -0700 | [diff] [blame] | 1 | /* |
| 2 | FUSE: Filesystem in Userspace |
Miklos Szeredi | 1f55ed0 | 2008-12-01 19:14:02 +0100 | [diff] [blame] | 3 | Copyright (C) 2001-2008 Miklos Szeredi <miklos@szeredi.hu> |
Miklos Szeredi | d8a5ba4 | 2005-09-09 13:10:26 -0700 | [diff] [blame] | 4 | |
| 5 | This program can be distributed under the terms of the GNU GPL. |
| 6 | See the file COPYING. |
| 7 | */ |
| 8 | |
Miklos Szeredi | c79e322 | 2007-10-18 03:06:59 -0700 | [diff] [blame] | 9 | /* |
| 10 | * This file defines the kernel interface of FUSE |
| 11 | * |
| 12 | * Protocol changelog: |
| 13 | * |
| 14 | * 7.9: |
| 15 | * - new fuse_getattr_in input argument of GETATTR |
Miklos Szeredi | a9ff4f8 | 2007-10-18 03:07:02 -0700 | [diff] [blame] | 16 | * - add lk_flags in fuse_lk_in |
Miklos Szeredi | f333211 | 2007-10-18 03:07:04 -0700 | [diff] [blame] | 17 | * - add lock_owner field to fuse_setattr_in, fuse_read_in and fuse_write_in |
Miklos Szeredi | 0e9663e | 2007-10-18 03:07:05 -0700 | [diff] [blame] | 18 | * - add blksize field to fuse_attr |
Miklos Szeredi | a664309 | 2007-11-28 16:22:00 -0800 | [diff] [blame] | 19 | * - add file flags field to fuse_read_in and fuse_write_in |
Tejun Heo | a7c1b99 | 2008-10-16 16:08:57 +0200 | [diff] [blame] | 20 | * |
| 21 | * 7.10 |
| 22 | * - add nonseekable open flag |
Miklos Szeredi | 1f55ed0 | 2008-12-01 19:14:02 +0100 | [diff] [blame] | 23 | * |
| 24 | * 7.11 |
| 25 | * - add IOCTL message |
| 26 | * - add unsolicited notification support |
| 27 | * - add POLL message and NOTIFY_POLL notification |
Miklos Szeredi | e0a43dd | 2009-06-30 20:12:23 +0200 | [diff] [blame] | 28 | * |
| 29 | * 7.12 |
| 30 | * - add umask flag to input argument of open, mknod and mkdir |
John Muir | 3b463ae | 2009-05-31 11:13:57 -0400 | [diff] [blame] | 31 | * - add notification messages for invalidation of inodes and |
| 32 | * directory entries |
Csaba Henk | 7a6d3c8 | 2009-07-01 17:28:41 -0700 | [diff] [blame] | 33 | * |
| 34 | * 7.13 |
| 35 | * - make max number of background requests and congestion threshold |
| 36 | * tunables |
Miklos Szeredi | dd3bb14 | 2010-05-25 15:06:06 +0200 | [diff] [blame] | 37 | * |
| 38 | * 7.14 |
| 39 | * - add splice support to fuse device |
Miklos Szeredi | c79e322 | 2007-10-18 03:06:59 -0700 | [diff] [blame] | 40 | */ |
Miklos Szeredi | d8a5ba4 | 2005-09-09 13:10:26 -0700 | [diff] [blame] | 41 | |
Tejun Heo | 29d434b | 2008-10-16 16:08:57 +0200 | [diff] [blame] | 42 | #ifndef _LINUX_FUSE_H |
| 43 | #define _LINUX_FUSE_H |
| 44 | |
Miklos Szeredi | 1f55ed0 | 2008-12-01 19:14:02 +0100 | [diff] [blame] | 45 | #include <linux/types.h> |
Miklos Szeredi | d8a5ba4 | 2005-09-09 13:10:26 -0700 | [diff] [blame] | 46 | |
Miklos Szeredi | 37d217f | 2009-07-08 18:17:58 +0200 | [diff] [blame] | 47 | /* |
| 48 | * Version negotiation: |
| 49 | * |
| 50 | * Both the kernel and userspace send the version they support in the |
| 51 | * INIT request and reply respectively. |
| 52 | * |
| 53 | * If the major versions match then both shall use the smallest |
| 54 | * of the two minor versions for communication. |
| 55 | * |
| 56 | * If the kernel supports a larger major version, then userspace shall |
| 57 | * reply with the major version it supports, ignore the rest of the |
| 58 | * INIT message and expect a new INIT message from the kernel with a |
| 59 | * matching major version. |
| 60 | * |
| 61 | * If the library supports a larger major version, then it shall fall |
| 62 | * back to the major protocol version sent by the kernel for |
| 63 | * communication and reply with that major version (and an arbitrary |
| 64 | * supported minor version). |
| 65 | */ |
| 66 | |
Miklos Szeredi | d8a5ba4 | 2005-09-09 13:10:26 -0700 | [diff] [blame] | 67 | /** Version number of this interface */ |
Miklos Szeredi | 9e6268d | 2005-09-09 13:10:29 -0700 | [diff] [blame] | 68 | #define FUSE_KERNEL_VERSION 7 |
Miklos Szeredi | d8a5ba4 | 2005-09-09 13:10:26 -0700 | [diff] [blame] | 69 | |
| 70 | /** Minor version number of this interface */ |
Miklos Szeredi | dd3bb14 | 2010-05-25 15:06:06 +0200 | [diff] [blame] | 71 | #define FUSE_KERNEL_MINOR_VERSION 14 |
Miklos Szeredi | d8a5ba4 | 2005-09-09 13:10:26 -0700 | [diff] [blame] | 72 | |
| 73 | /** The node ID of the root inode */ |
| 74 | #define FUSE_ROOT_ID 1 |
| 75 | |
Miklos Szeredi | 0666326 | 2005-09-09 13:10:32 -0700 | [diff] [blame] | 76 | /* Make sure all structures are padded to 64bit boundary, so 32bit |
| 77 | userspace works under 64bit kernels */ |
| 78 | |
Miklos Szeredi | d8a5ba4 | 2005-09-09 13:10:26 -0700 | [diff] [blame] | 79 | struct fuse_attr { |
| 80 | __u64 ino; |
| 81 | __u64 size; |
| 82 | __u64 blocks; |
| 83 | __u64 atime; |
| 84 | __u64 mtime; |
| 85 | __u64 ctime; |
| 86 | __u32 atimensec; |
| 87 | __u32 mtimensec; |
| 88 | __u32 ctimensec; |
| 89 | __u32 mode; |
| 90 | __u32 nlink; |
| 91 | __u32 uid; |
| 92 | __u32 gid; |
| 93 | __u32 rdev; |
Miklos Szeredi | 0e9663e | 2007-10-18 03:07:05 -0700 | [diff] [blame] | 94 | __u32 blksize; |
| 95 | __u32 padding; |
Miklos Szeredi | d8a5ba4 | 2005-09-09 13:10:26 -0700 | [diff] [blame] | 96 | }; |
| 97 | |
Miklos Szeredi | e5e5558 | 2005-09-09 13:10:28 -0700 | [diff] [blame] | 98 | struct fuse_kstatfs { |
| 99 | __u64 blocks; |
| 100 | __u64 bfree; |
| 101 | __u64 bavail; |
| 102 | __u64 files; |
| 103 | __u64 ffree; |
| 104 | __u32 bsize; |
| 105 | __u32 namelen; |
Miklos Szeredi | de5f120 | 2006-01-06 00:19:37 -0800 | [diff] [blame] | 106 | __u32 frsize; |
| 107 | __u32 padding; |
| 108 | __u32 spare[6]; |
Miklos Szeredi | e5e5558 | 2005-09-09 13:10:28 -0700 | [diff] [blame] | 109 | }; |
| 110 | |
Miklos Szeredi | 7142125 | 2006-06-25 05:48:52 -0700 | [diff] [blame] | 111 | struct fuse_file_lock { |
| 112 | __u64 start; |
| 113 | __u64 end; |
| 114 | __u32 type; |
| 115 | __u32 pid; /* tgid */ |
| 116 | }; |
| 117 | |
Miklos Szeredi | 9cd6845 | 2006-02-01 03:04:40 -0800 | [diff] [blame] | 118 | /** |
| 119 | * Bitmasks for fuse_setattr_in.valid |
| 120 | */ |
Miklos Szeredi | 9e6268d | 2005-09-09 13:10:29 -0700 | [diff] [blame] | 121 | #define FATTR_MODE (1 << 0) |
| 122 | #define FATTR_UID (1 << 1) |
| 123 | #define FATTR_GID (1 << 2) |
| 124 | #define FATTR_SIZE (1 << 3) |
| 125 | #define FATTR_ATIME (1 << 4) |
| 126 | #define FATTR_MTIME (1 << 5) |
Miklos Szeredi | befc649 | 2005-11-07 00:59:52 -0800 | [diff] [blame] | 127 | #define FATTR_FH (1 << 6) |
Miklos Szeredi | 17637cb | 2007-10-18 03:07:01 -0700 | [diff] [blame] | 128 | #define FATTR_ATIME_NOW (1 << 7) |
| 129 | #define FATTR_MTIME_NOW (1 << 8) |
Miklos Szeredi | f333211 | 2007-10-18 03:07:04 -0700 | [diff] [blame] | 130 | #define FATTR_LOCKOWNER (1 << 9) |
Miklos Szeredi | 9e6268d | 2005-09-09 13:10:29 -0700 | [diff] [blame] | 131 | |
Miklos Szeredi | 45323fb | 2005-09-09 13:10:37 -0700 | [diff] [blame] | 132 | /** |
| 133 | * Flags returned by the OPEN request |
| 134 | * |
| 135 | * FOPEN_DIRECT_IO: bypass page cache for this open file |
| 136 | * FOPEN_KEEP_CACHE: don't invalidate the data cache on open |
Tejun Heo | a7c1b99 | 2008-10-16 16:08:57 +0200 | [diff] [blame] | 137 | * FOPEN_NONSEEKABLE: the file is not seekable |
Miklos Szeredi | 45323fb | 2005-09-09 13:10:37 -0700 | [diff] [blame] | 138 | */ |
| 139 | #define FOPEN_DIRECT_IO (1 << 0) |
| 140 | #define FOPEN_KEEP_CACHE (1 << 1) |
Tejun Heo | a7c1b99 | 2008-10-16 16:08:57 +0200 | [diff] [blame] | 141 | #define FOPEN_NONSEEKABLE (1 << 2) |
Miklos Szeredi | 45323fb | 2005-09-09 13:10:37 -0700 | [diff] [blame] | 142 | |
Miklos Szeredi | 9cd6845 | 2006-02-01 03:04:40 -0800 | [diff] [blame] | 143 | /** |
| 144 | * INIT request/reply flags |
Miklos Szeredi | 33670fa | 2008-07-25 01:49:02 -0700 | [diff] [blame] | 145 | * |
| 146 | * FUSE_EXPORT_SUPPORT: filesystem handles lookups of "." and ".." |
Miklos Szeredi | e0a43dd | 2009-06-30 20:12:23 +0200 | [diff] [blame] | 147 | * FUSE_DONT_MASK: don't apply umask to file mode on create operations |
Miklos Szeredi | 9cd6845 | 2006-02-01 03:04:40 -0800 | [diff] [blame] | 148 | */ |
| 149 | #define FUSE_ASYNC_READ (1 << 0) |
Miklos Szeredi | 7142125 | 2006-06-25 05:48:52 -0700 | [diff] [blame] | 150 | #define FUSE_POSIX_LOCKS (1 << 1) |
Miklos Szeredi | c79e322 | 2007-10-18 03:06:59 -0700 | [diff] [blame] | 151 | #define FUSE_FILE_OPS (1 << 2) |
Miklos Szeredi | 6ff958e | 2007-10-18 03:07:02 -0700 | [diff] [blame] | 152 | #define FUSE_ATOMIC_O_TRUNC (1 << 3) |
Miklos Szeredi | 33670fa | 2008-07-25 01:49:02 -0700 | [diff] [blame] | 153 | #define FUSE_EXPORT_SUPPORT (1 << 4) |
Miklos Szeredi | 78bb6cb | 2008-05-12 14:02:32 -0700 | [diff] [blame] | 154 | #define FUSE_BIG_WRITES (1 << 5) |
Miklos Szeredi | e0a43dd | 2009-06-30 20:12:23 +0200 | [diff] [blame] | 155 | #define FUSE_DONT_MASK (1 << 6) |
Miklos Szeredi | 9cd6845 | 2006-02-01 03:04:40 -0800 | [diff] [blame] | 156 | |
Miklos Szeredi | e9168c1 | 2006-12-06 20:35:38 -0800 | [diff] [blame] | 157 | /** |
Tejun Heo | 151060a | 2009-04-14 10:54:54 +0900 | [diff] [blame] | 158 | * CUSE INIT request/reply flags |
| 159 | * |
| 160 | * CUSE_UNRESTRICTED_IOCTL: use unrestricted ioctl |
| 161 | */ |
| 162 | #define CUSE_UNRESTRICTED_IOCTL (1 << 0) |
| 163 | |
| 164 | /** |
Miklos Szeredi | e9168c1 | 2006-12-06 20:35:38 -0800 | [diff] [blame] | 165 | * Release flags |
| 166 | */ |
| 167 | #define FUSE_RELEASE_FLUSH (1 << 0) |
| 168 | |
Miklos Szeredi | c79e322 | 2007-10-18 03:06:59 -0700 | [diff] [blame] | 169 | /** |
| 170 | * Getattr flags |
| 171 | */ |
| 172 | #define FUSE_GETATTR_FH (1 << 0) |
| 173 | |
Miklos Szeredi | a9ff4f8 | 2007-10-18 03:07:02 -0700 | [diff] [blame] | 174 | /** |
| 175 | * Lock flags |
| 176 | */ |
| 177 | #define FUSE_LK_FLOCK (1 << 0) |
| 178 | |
Miklos Szeredi | b25e82e | 2007-10-18 03:07:03 -0700 | [diff] [blame] | 179 | /** |
| 180 | * WRITE flags |
| 181 | * |
| 182 | * FUSE_WRITE_CACHE: delayed write from page cache, file handle is guessed |
Miklos Szeredi | f333211 | 2007-10-18 03:07:04 -0700 | [diff] [blame] | 183 | * FUSE_WRITE_LOCKOWNER: lock_owner field is valid |
Miklos Szeredi | b25e82e | 2007-10-18 03:07:03 -0700 | [diff] [blame] | 184 | */ |
| 185 | #define FUSE_WRITE_CACHE (1 << 0) |
Miklos Szeredi | f333211 | 2007-10-18 03:07:04 -0700 | [diff] [blame] | 186 | #define FUSE_WRITE_LOCKOWNER (1 << 1) |
| 187 | |
| 188 | /** |
| 189 | * Read flags |
| 190 | */ |
| 191 | #define FUSE_READ_LOCKOWNER (1 << 1) |
Miklos Szeredi | b25e82e | 2007-10-18 03:07:03 -0700 | [diff] [blame] | 192 | |
Tejun Heo | 59efec7 | 2008-11-26 12:03:55 +0100 | [diff] [blame] | 193 | /** |
| 194 | * Ioctl flags |
| 195 | * |
| 196 | * FUSE_IOCTL_COMPAT: 32bit compat ioctl on 64bit machine |
| 197 | * FUSE_IOCTL_UNRESTRICTED: not restricted to well-formed ioctls, retry allowed |
| 198 | * FUSE_IOCTL_RETRY: retry with new iovecs |
| 199 | * |
| 200 | * FUSE_IOCTL_MAX_IOV: maximum of in_iovecs + out_iovecs |
| 201 | */ |
| 202 | #define FUSE_IOCTL_COMPAT (1 << 0) |
| 203 | #define FUSE_IOCTL_UNRESTRICTED (1 << 1) |
| 204 | #define FUSE_IOCTL_RETRY (1 << 2) |
| 205 | |
| 206 | #define FUSE_IOCTL_MAX_IOV 256 |
| 207 | |
Tejun Heo | 95668a6 | 2008-11-26 12:03:55 +0100 | [diff] [blame] | 208 | /** |
| 209 | * Poll flags |
| 210 | * |
| 211 | * FUSE_POLL_SCHEDULE_NOTIFY: request poll notify |
| 212 | */ |
| 213 | #define FUSE_POLL_SCHEDULE_NOTIFY (1 << 0) |
| 214 | |
Miklos Szeredi | 334f485 | 2005-09-09 13:10:27 -0700 | [diff] [blame] | 215 | enum fuse_opcode { |
Miklos Szeredi | e5e5558 | 2005-09-09 13:10:28 -0700 | [diff] [blame] | 216 | FUSE_LOOKUP = 1, |
| 217 | FUSE_FORGET = 2, /* no reply */ |
| 218 | FUSE_GETATTR = 3, |
Miklos Szeredi | 9e6268d | 2005-09-09 13:10:29 -0700 | [diff] [blame] | 219 | FUSE_SETATTR = 4, |
Miklos Szeredi | e5e5558 | 2005-09-09 13:10:28 -0700 | [diff] [blame] | 220 | FUSE_READLINK = 5, |
Miklos Szeredi | 9e6268d | 2005-09-09 13:10:29 -0700 | [diff] [blame] | 221 | FUSE_SYMLINK = 6, |
Miklos Szeredi | 9e6268d | 2005-09-09 13:10:29 -0700 | [diff] [blame] | 222 | FUSE_MKNOD = 8, |
| 223 | FUSE_MKDIR = 9, |
| 224 | FUSE_UNLINK = 10, |
| 225 | FUSE_RMDIR = 11, |
| 226 | FUSE_RENAME = 12, |
| 227 | FUSE_LINK = 13, |
Miklos Szeredi | b6aeade | 2005-09-09 13:10:30 -0700 | [diff] [blame] | 228 | FUSE_OPEN = 14, |
| 229 | FUSE_READ = 15, |
| 230 | FUSE_WRITE = 16, |
Miklos Szeredi | e5e5558 | 2005-09-09 13:10:28 -0700 | [diff] [blame] | 231 | FUSE_STATFS = 17, |
Miklos Szeredi | b6aeade | 2005-09-09 13:10:30 -0700 | [diff] [blame] | 232 | FUSE_RELEASE = 18, |
| 233 | FUSE_FSYNC = 20, |
Miklos Szeredi | 92a8780 | 2005-09-09 13:10:31 -0700 | [diff] [blame] | 234 | FUSE_SETXATTR = 21, |
| 235 | FUSE_GETXATTR = 22, |
| 236 | FUSE_LISTXATTR = 23, |
| 237 | FUSE_REMOVEXATTR = 24, |
Miklos Szeredi | b6aeade | 2005-09-09 13:10:30 -0700 | [diff] [blame] | 238 | FUSE_FLUSH = 25, |
Miklos Szeredi | 04730fe | 2005-09-09 13:10:36 -0700 | [diff] [blame] | 239 | FUSE_INIT = 26, |
| 240 | FUSE_OPENDIR = 27, |
| 241 | FUSE_READDIR = 28, |
Miklos Szeredi | 8254798 | 2005-09-09 13:10:38 -0700 | [diff] [blame] | 242 | FUSE_RELEASEDIR = 29, |
Miklos Szeredi | 31d40d7 | 2005-11-07 00:59:50 -0800 | [diff] [blame] | 243 | FUSE_FSYNCDIR = 30, |
Miklos Szeredi | 7142125 | 2006-06-25 05:48:52 -0700 | [diff] [blame] | 244 | FUSE_GETLK = 31, |
| 245 | FUSE_SETLK = 32, |
| 246 | FUSE_SETLKW = 33, |
Miklos Szeredi | fd72faa | 2005-11-07 00:59:51 -0800 | [diff] [blame] | 247 | FUSE_ACCESS = 34, |
Miklos Szeredi | a4d27e7 | 2006-06-25 05:48:54 -0700 | [diff] [blame] | 248 | FUSE_CREATE = 35, |
| 249 | FUSE_INTERRUPT = 36, |
Miklos Szeredi | b2d2272 | 2006-12-06 20:35:51 -0800 | [diff] [blame] | 250 | FUSE_BMAP = 37, |
Miklos Szeredi | 0ec7ca4 | 2006-12-06 20:35:52 -0800 | [diff] [blame] | 251 | FUSE_DESTROY = 38, |
Tejun Heo | 59efec7 | 2008-11-26 12:03:55 +0100 | [diff] [blame] | 252 | FUSE_IOCTL = 39, |
Tejun Heo | 95668a6 | 2008-11-26 12:03:55 +0100 | [diff] [blame] | 253 | FUSE_POLL = 40, |
Tejun Heo | 151060a | 2009-04-14 10:54:54 +0900 | [diff] [blame] | 254 | |
| 255 | /* CUSE specific operations */ |
| 256 | CUSE_INIT = 4096, |
Miklos Szeredi | 334f485 | 2005-09-09 13:10:27 -0700 | [diff] [blame] | 257 | }; |
| 258 | |
Tejun Heo | 8599396 | 2008-11-26 12:03:55 +0100 | [diff] [blame] | 259 | enum fuse_notify_code { |
Tejun Heo | 95668a6 | 2008-11-26 12:03:55 +0100 | [diff] [blame] | 260 | FUSE_NOTIFY_POLL = 1, |
John Muir | 3b463ae | 2009-05-31 11:13:57 -0400 | [diff] [blame] | 261 | FUSE_NOTIFY_INVAL_INODE = 2, |
| 262 | FUSE_NOTIFY_INVAL_ENTRY = 3, |
Tejun Heo | 8599396 | 2008-11-26 12:03:55 +0100 | [diff] [blame] | 263 | FUSE_NOTIFY_CODE_MAX, |
| 264 | }; |
| 265 | |
Miklos Szeredi | 1d3d752 | 2006-01-06 00:19:40 -0800 | [diff] [blame] | 266 | /* The read buffer is required to be at least 8k, but may be much larger */ |
| 267 | #define FUSE_MIN_READ_BUFFER 8192 |
Miklos Szeredi | e5e5558 | 2005-09-09 13:10:28 -0700 | [diff] [blame] | 268 | |
Miklos Szeredi | 0e9663e | 2007-10-18 03:07:05 -0700 | [diff] [blame] | 269 | #define FUSE_COMPAT_ENTRY_OUT_SIZE 120 |
| 270 | |
Miklos Szeredi | e5e5558 | 2005-09-09 13:10:28 -0700 | [diff] [blame] | 271 | struct fuse_entry_out { |
| 272 | __u64 nodeid; /* Inode ID */ |
| 273 | __u64 generation; /* Inode generation: nodeid:gen must |
| 274 | be unique for the fs's lifetime */ |
| 275 | __u64 entry_valid; /* Cache timeout for the name */ |
| 276 | __u64 attr_valid; /* Cache timeout for the attributes */ |
| 277 | __u32 entry_valid_nsec; |
| 278 | __u32 attr_valid_nsec; |
| 279 | struct fuse_attr attr; |
| 280 | }; |
| 281 | |
| 282 | struct fuse_forget_in { |
Miklos Szeredi | 9e6268d | 2005-09-09 13:10:29 -0700 | [diff] [blame] | 283 | __u64 nlookup; |
Miklos Szeredi | e5e5558 | 2005-09-09 13:10:28 -0700 | [diff] [blame] | 284 | }; |
| 285 | |
Miklos Szeredi | c79e322 | 2007-10-18 03:06:59 -0700 | [diff] [blame] | 286 | struct fuse_getattr_in { |
| 287 | __u32 getattr_flags; |
| 288 | __u32 dummy; |
| 289 | __u64 fh; |
| 290 | }; |
| 291 | |
Miklos Szeredi | 0e9663e | 2007-10-18 03:07:05 -0700 | [diff] [blame] | 292 | #define FUSE_COMPAT_ATTR_OUT_SIZE 96 |
| 293 | |
Miklos Szeredi | e5e5558 | 2005-09-09 13:10:28 -0700 | [diff] [blame] | 294 | struct fuse_attr_out { |
| 295 | __u64 attr_valid; /* Cache timeout for the attributes */ |
| 296 | __u32 attr_valid_nsec; |
| 297 | __u32 dummy; |
| 298 | struct fuse_attr attr; |
| 299 | }; |
| 300 | |
Miklos Szeredi | e0a43dd | 2009-06-30 20:12:23 +0200 | [diff] [blame] | 301 | #define FUSE_COMPAT_MKNOD_IN_SIZE 8 |
| 302 | |
Miklos Szeredi | 9e6268d | 2005-09-09 13:10:29 -0700 | [diff] [blame] | 303 | struct fuse_mknod_in { |
| 304 | __u32 mode; |
| 305 | __u32 rdev; |
Miklos Szeredi | e0a43dd | 2009-06-30 20:12:23 +0200 | [diff] [blame] | 306 | __u32 umask; |
| 307 | __u32 padding; |
Miklos Szeredi | 9e6268d | 2005-09-09 13:10:29 -0700 | [diff] [blame] | 308 | }; |
| 309 | |
| 310 | struct fuse_mkdir_in { |
| 311 | __u32 mode; |
Miklos Szeredi | e0a43dd | 2009-06-30 20:12:23 +0200 | [diff] [blame] | 312 | __u32 umask; |
Miklos Szeredi | 9e6268d | 2005-09-09 13:10:29 -0700 | [diff] [blame] | 313 | }; |
| 314 | |
| 315 | struct fuse_rename_in { |
| 316 | __u64 newdir; |
| 317 | }; |
| 318 | |
| 319 | struct fuse_link_in { |
| 320 | __u64 oldnodeid; |
| 321 | }; |
| 322 | |
| 323 | struct fuse_setattr_in { |
| 324 | __u32 valid; |
Miklos Szeredi | 0666326 | 2005-09-09 13:10:32 -0700 | [diff] [blame] | 325 | __u32 padding; |
Miklos Szeredi | befc649 | 2005-11-07 00:59:52 -0800 | [diff] [blame] | 326 | __u64 fh; |
| 327 | __u64 size; |
Miklos Szeredi | f333211 | 2007-10-18 03:07:04 -0700 | [diff] [blame] | 328 | __u64 lock_owner; |
Miklos Szeredi | befc649 | 2005-11-07 00:59:52 -0800 | [diff] [blame] | 329 | __u64 atime; |
| 330 | __u64 mtime; |
| 331 | __u64 unused2; |
| 332 | __u32 atimensec; |
| 333 | __u32 mtimensec; |
| 334 | __u32 unused3; |
| 335 | __u32 mode; |
| 336 | __u32 unused4; |
| 337 | __u32 uid; |
| 338 | __u32 gid; |
| 339 | __u32 unused5; |
Miklos Szeredi | 9e6268d | 2005-09-09 13:10:29 -0700 | [diff] [blame] | 340 | }; |
| 341 | |
Miklos Szeredi | b6aeade | 2005-09-09 13:10:30 -0700 | [diff] [blame] | 342 | struct fuse_open_in { |
| 343 | __u32 flags; |
Miklos Szeredi | e0a43dd | 2009-06-30 20:12:23 +0200 | [diff] [blame] | 344 | __u32 unused; |
| 345 | }; |
| 346 | |
| 347 | struct fuse_create_in { |
| 348 | __u32 flags; |
Miklos Szeredi | fd72faa | 2005-11-07 00:59:51 -0800 | [diff] [blame] | 349 | __u32 mode; |
Miklos Szeredi | e0a43dd | 2009-06-30 20:12:23 +0200 | [diff] [blame] | 350 | __u32 umask; |
| 351 | __u32 padding; |
Miklos Szeredi | b6aeade | 2005-09-09 13:10:30 -0700 | [diff] [blame] | 352 | }; |
| 353 | |
| 354 | struct fuse_open_out { |
| 355 | __u64 fh; |
| 356 | __u32 open_flags; |
Miklos Szeredi | 0666326 | 2005-09-09 13:10:32 -0700 | [diff] [blame] | 357 | __u32 padding; |
Miklos Szeredi | b6aeade | 2005-09-09 13:10:30 -0700 | [diff] [blame] | 358 | }; |
| 359 | |
| 360 | struct fuse_release_in { |
| 361 | __u64 fh; |
| 362 | __u32 flags; |
Miklos Szeredi | e9168c1 | 2006-12-06 20:35:38 -0800 | [diff] [blame] | 363 | __u32 release_flags; |
| 364 | __u64 lock_owner; |
Miklos Szeredi | b6aeade | 2005-09-09 13:10:30 -0700 | [diff] [blame] | 365 | }; |
| 366 | |
| 367 | struct fuse_flush_in { |
| 368 | __u64 fh; |
Miklos Szeredi | e9168c1 | 2006-12-06 20:35:38 -0800 | [diff] [blame] | 369 | __u32 unused; |
Miklos Szeredi | 0666326 | 2005-09-09 13:10:32 -0700 | [diff] [blame] | 370 | __u32 padding; |
Miklos Szeredi | 7142125 | 2006-06-25 05:48:52 -0700 | [diff] [blame] | 371 | __u64 lock_owner; |
Miklos Szeredi | b6aeade | 2005-09-09 13:10:30 -0700 | [diff] [blame] | 372 | }; |
| 373 | |
| 374 | struct fuse_read_in { |
| 375 | __u64 fh; |
| 376 | __u64 offset; |
| 377 | __u32 size; |
Miklos Szeredi | f333211 | 2007-10-18 03:07:04 -0700 | [diff] [blame] | 378 | __u32 read_flags; |
| 379 | __u64 lock_owner; |
Miklos Szeredi | a664309 | 2007-11-28 16:22:00 -0800 | [diff] [blame] | 380 | __u32 flags; |
| 381 | __u32 padding; |
Miklos Szeredi | b6aeade | 2005-09-09 13:10:30 -0700 | [diff] [blame] | 382 | }; |
| 383 | |
Miklos Szeredi | f333211 | 2007-10-18 03:07:04 -0700 | [diff] [blame] | 384 | #define FUSE_COMPAT_WRITE_IN_SIZE 24 |
| 385 | |
Miklos Szeredi | b6aeade | 2005-09-09 13:10:30 -0700 | [diff] [blame] | 386 | struct fuse_write_in { |
| 387 | __u64 fh; |
| 388 | __u64 offset; |
| 389 | __u32 size; |
| 390 | __u32 write_flags; |
Miklos Szeredi | f333211 | 2007-10-18 03:07:04 -0700 | [diff] [blame] | 391 | __u64 lock_owner; |
Miklos Szeredi | a664309 | 2007-11-28 16:22:00 -0800 | [diff] [blame] | 392 | __u32 flags; |
| 393 | __u32 padding; |
Miklos Szeredi | b6aeade | 2005-09-09 13:10:30 -0700 | [diff] [blame] | 394 | }; |
| 395 | |
| 396 | struct fuse_write_out { |
| 397 | __u32 size; |
Miklos Szeredi | 0666326 | 2005-09-09 13:10:32 -0700 | [diff] [blame] | 398 | __u32 padding; |
Miklos Szeredi | b6aeade | 2005-09-09 13:10:30 -0700 | [diff] [blame] | 399 | }; |
| 400 | |
Miklos Szeredi | de5f120 | 2006-01-06 00:19:37 -0800 | [diff] [blame] | 401 | #define FUSE_COMPAT_STATFS_SIZE 48 |
| 402 | |
Miklos Szeredi | e5e5558 | 2005-09-09 13:10:28 -0700 | [diff] [blame] | 403 | struct fuse_statfs_out { |
| 404 | struct fuse_kstatfs st; |
| 405 | }; |
| 406 | |
Miklos Szeredi | b6aeade | 2005-09-09 13:10:30 -0700 | [diff] [blame] | 407 | struct fuse_fsync_in { |
| 408 | __u64 fh; |
| 409 | __u32 fsync_flags; |
Miklos Szeredi | 0666326 | 2005-09-09 13:10:32 -0700 | [diff] [blame] | 410 | __u32 padding; |
Miklos Szeredi | b6aeade | 2005-09-09 13:10:30 -0700 | [diff] [blame] | 411 | }; |
| 412 | |
Miklos Szeredi | 92a8780 | 2005-09-09 13:10:31 -0700 | [diff] [blame] | 413 | struct fuse_setxattr_in { |
| 414 | __u32 size; |
| 415 | __u32 flags; |
| 416 | }; |
| 417 | |
| 418 | struct fuse_getxattr_in { |
| 419 | __u32 size; |
Miklos Szeredi | 0666326 | 2005-09-09 13:10:32 -0700 | [diff] [blame] | 420 | __u32 padding; |
Miklos Szeredi | 92a8780 | 2005-09-09 13:10:31 -0700 | [diff] [blame] | 421 | }; |
| 422 | |
| 423 | struct fuse_getxattr_out { |
| 424 | __u32 size; |
Miklos Szeredi | 0666326 | 2005-09-09 13:10:32 -0700 | [diff] [blame] | 425 | __u32 padding; |
Miklos Szeredi | 92a8780 | 2005-09-09 13:10:31 -0700 | [diff] [blame] | 426 | }; |
| 427 | |
Miklos Szeredi | 7142125 | 2006-06-25 05:48:52 -0700 | [diff] [blame] | 428 | struct fuse_lk_in { |
| 429 | __u64 fh; |
| 430 | __u64 owner; |
| 431 | struct fuse_file_lock lk; |
Miklos Szeredi | a9ff4f8 | 2007-10-18 03:07:02 -0700 | [diff] [blame] | 432 | __u32 lk_flags; |
| 433 | __u32 padding; |
Miklos Szeredi | 7142125 | 2006-06-25 05:48:52 -0700 | [diff] [blame] | 434 | }; |
| 435 | |
| 436 | struct fuse_lk_out { |
| 437 | struct fuse_file_lock lk; |
| 438 | }; |
| 439 | |
Miklos Szeredi | 31d40d7 | 2005-11-07 00:59:50 -0800 | [diff] [blame] | 440 | struct fuse_access_in { |
| 441 | __u32 mask; |
| 442 | __u32 padding; |
| 443 | }; |
| 444 | |
Miklos Szeredi | 3ec870d | 2006-01-06 00:19:41 -0800 | [diff] [blame] | 445 | struct fuse_init_in { |
Miklos Szeredi | 334f485 | 2005-09-09 13:10:27 -0700 | [diff] [blame] | 446 | __u32 major; |
| 447 | __u32 minor; |
Miklos Szeredi | 9cd6845 | 2006-02-01 03:04:40 -0800 | [diff] [blame] | 448 | __u32 max_readahead; |
| 449 | __u32 flags; |
Miklos Szeredi | 334f485 | 2005-09-09 13:10:27 -0700 | [diff] [blame] | 450 | }; |
| 451 | |
Miklos Szeredi | 3ec870d | 2006-01-06 00:19:41 -0800 | [diff] [blame] | 452 | struct fuse_init_out { |
| 453 | __u32 major; |
| 454 | __u32 minor; |
Miklos Szeredi | 9cd6845 | 2006-02-01 03:04:40 -0800 | [diff] [blame] | 455 | __u32 max_readahead; |
| 456 | __u32 flags; |
Csaba Henk | 7a6d3c8 | 2009-07-01 17:28:41 -0700 | [diff] [blame] | 457 | __u16 max_background; |
| 458 | __u16 congestion_threshold; |
Miklos Szeredi | 3ec870d | 2006-01-06 00:19:41 -0800 | [diff] [blame] | 459 | __u32 max_write; |
| 460 | }; |
| 461 | |
Tejun Heo | 151060a | 2009-04-14 10:54:54 +0900 | [diff] [blame] | 462 | #define CUSE_INIT_INFO_MAX 4096 |
| 463 | |
| 464 | struct cuse_init_in { |
| 465 | __u32 major; |
| 466 | __u32 minor; |
| 467 | __u32 unused; |
| 468 | __u32 flags; |
| 469 | }; |
| 470 | |
| 471 | struct cuse_init_out { |
| 472 | __u32 major; |
| 473 | __u32 minor; |
| 474 | __u32 unused; |
| 475 | __u32 flags; |
| 476 | __u32 max_read; |
| 477 | __u32 max_write; |
| 478 | __u32 dev_major; /* chardev major */ |
| 479 | __u32 dev_minor; /* chardev minor */ |
| 480 | __u32 spare[10]; |
| 481 | }; |
| 482 | |
Miklos Szeredi | a4d27e7 | 2006-06-25 05:48:54 -0700 | [diff] [blame] | 483 | struct fuse_interrupt_in { |
| 484 | __u64 unique; |
| 485 | }; |
| 486 | |
Miklos Szeredi | b2d2272 | 2006-12-06 20:35:51 -0800 | [diff] [blame] | 487 | struct fuse_bmap_in { |
| 488 | __u64 block; |
| 489 | __u32 blocksize; |
| 490 | __u32 padding; |
| 491 | }; |
| 492 | |
| 493 | struct fuse_bmap_out { |
| 494 | __u64 block; |
| 495 | }; |
| 496 | |
Tejun Heo | 59efec7 | 2008-11-26 12:03:55 +0100 | [diff] [blame] | 497 | struct fuse_ioctl_in { |
| 498 | __u64 fh; |
| 499 | __u32 flags; |
| 500 | __u32 cmd; |
| 501 | __u64 arg; |
| 502 | __u32 in_size; |
| 503 | __u32 out_size; |
| 504 | }; |
| 505 | |
| 506 | struct fuse_ioctl_out { |
| 507 | __s32 result; |
| 508 | __u32 flags; |
| 509 | __u32 in_iovs; |
| 510 | __u32 out_iovs; |
| 511 | }; |
| 512 | |
Tejun Heo | 95668a6 | 2008-11-26 12:03:55 +0100 | [diff] [blame] | 513 | struct fuse_poll_in { |
| 514 | __u64 fh; |
| 515 | __u64 kh; |
| 516 | __u32 flags; |
| 517 | __u32 padding; |
| 518 | }; |
| 519 | |
| 520 | struct fuse_poll_out { |
| 521 | __u32 revents; |
| 522 | __u32 padding; |
| 523 | }; |
| 524 | |
| 525 | struct fuse_notify_poll_wakeup_out { |
| 526 | __u64 kh; |
| 527 | }; |
| 528 | |
Miklos Szeredi | 334f485 | 2005-09-09 13:10:27 -0700 | [diff] [blame] | 529 | struct fuse_in_header { |
| 530 | __u32 len; |
| 531 | __u32 opcode; |
| 532 | __u64 unique; |
| 533 | __u64 nodeid; |
| 534 | __u32 uid; |
| 535 | __u32 gid; |
| 536 | __u32 pid; |
Miklos Szeredi | 0666326 | 2005-09-09 13:10:32 -0700 | [diff] [blame] | 537 | __u32 padding; |
Miklos Szeredi | 334f485 | 2005-09-09 13:10:27 -0700 | [diff] [blame] | 538 | }; |
| 539 | |
| 540 | struct fuse_out_header { |
| 541 | __u32 len; |
| 542 | __s32 error; |
| 543 | __u64 unique; |
| 544 | }; |
| 545 | |
Miklos Szeredi | e5e5558 | 2005-09-09 13:10:28 -0700 | [diff] [blame] | 546 | struct fuse_dirent { |
| 547 | __u64 ino; |
| 548 | __u64 off; |
| 549 | __u32 namelen; |
| 550 | __u32 type; |
| 551 | char name[0]; |
| 552 | }; |
| 553 | |
Andrew Morton | 21f3da9 | 2007-07-15 23:39:50 -0700 | [diff] [blame] | 554 | #define FUSE_NAME_OFFSET offsetof(struct fuse_dirent, name) |
Miklos Szeredi | e5e5558 | 2005-09-09 13:10:28 -0700 | [diff] [blame] | 555 | #define FUSE_DIRENT_ALIGN(x) (((x) + sizeof(__u64) - 1) & ~(sizeof(__u64) - 1)) |
| 556 | #define FUSE_DIRENT_SIZE(d) \ |
| 557 | FUSE_DIRENT_ALIGN(FUSE_NAME_OFFSET + (d)->namelen) |
Tejun Heo | 29d434b | 2008-10-16 16:08:57 +0200 | [diff] [blame] | 558 | |
John Muir | 3b463ae | 2009-05-31 11:13:57 -0400 | [diff] [blame] | 559 | struct fuse_notify_inval_inode_out { |
| 560 | __u64 ino; |
| 561 | __s64 off; |
| 562 | __s64 len; |
| 563 | }; |
| 564 | |
| 565 | struct fuse_notify_inval_entry_out { |
| 566 | __u64 parent; |
| 567 | __u32 namelen; |
| 568 | __u32 padding; |
| 569 | }; |
| 570 | |
Tejun Heo | 29d434b | 2008-10-16 16:08:57 +0200 | [diff] [blame] | 571 | #endif /* _LINUX_FUSE_H */ |