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