blob: 9303348965fbdbc8a8d6d706949b543d54c5609b [file] [log] [blame]
Miklos Szeredid8a5ba42005-09-09 13:10:26 -07001/*
2 FUSE: Filesystem in Userspace
Miklos Szeredi1f55ed02008-12-01 19:14:02 +01003 Copyright (C) 2001-2008 Miklos Szeredi <miklos@szeredi.hu>
Miklos Szeredid8a5ba42005-09-09 13:10:26 -07004
5 This program can be distributed under the terms of the GNU GPL.
6 See the file COPYING.
7*/
8
Miklos Szeredic79e3222007-10-18 03:06:59 -07009/*
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 Szeredia9ff4f82007-10-18 03:07:02 -070016 * - add lk_flags in fuse_lk_in
Miklos Szeredif3332112007-10-18 03:07:04 -070017 * - add lock_owner field to fuse_setattr_in, fuse_read_in and fuse_write_in
Miklos Szeredi0e9663e2007-10-18 03:07:05 -070018 * - add blksize field to fuse_attr
Miklos Szeredia6643092007-11-28 16:22:00 -080019 * - add file flags field to fuse_read_in and fuse_write_in
Tejun Heoa7c1b992008-10-16 16:08:57 +020020 *
21 * 7.10
22 * - add nonseekable open flag
Miklos Szeredi1f55ed02008-12-01 19:14:02 +010023 *
24 * 7.11
25 * - add IOCTL message
26 * - add unsolicited notification support
27 * - add POLL message and NOTIFY_POLL notification
Miklos Szeredie0a43dd2009-06-30 20:12:23 +020028 *
29 * 7.12
30 * - add umask flag to input argument of open, mknod and mkdir
John Muir3b463ae2009-05-31 11:13:57 -040031 * - add notification messages for invalidation of inodes and
32 * directory entries
Csaba Henk7a6d3c82009-07-01 17:28:41 -070033 *
34 * 7.13
35 * - make max number of background requests and congestion threshold
36 * tunables
Miklos Szeredidd3bb142010-05-25 15:06:06 +020037 *
38 * 7.14
39 * - add splice support to fuse device
Miklos Szeredia1d75f22010-07-12 14:41:40 +020040 *
41 * 7.15
42 * - add store notify
Miklos Szeredi2d45ba32010-07-12 14:41:40 +020043 * - add retrieve notify
Miklos Szeredi02c048b2010-12-07 20:16:56 +010044 *
45 * 7.16
46 * - add BATCH_FORGET request
Miklos Szeredi1baa26b2010-12-07 20:16:56 +010047 * - FUSE_IOCTL_UNRESTRICTED shall now return with array of 'struct
48 * fuse_ioctl_iovec' instead of ambiguous 'struct iovec'
49 * - add FUSE_IOCTL_32BIT flag
Miklos Szeredi37fb3a32011-08-08 16:08:08 +020050 *
51 * 7.17
52 * - add FUSE_FLOCK_LOCKS and FUSE_RELEASE_FLOCK_UNLOCK
Miklos Szeredib18da0c2011-12-13 11:58:49 +010053 *
54 * 7.18
55 * - add FUSE_IOCTL_DIR flag
John Muir451d0f52011-12-06 21:50:06 +010056 * - add FUSE_NOTIFY_DELETE
Anatol Pomozov05ba1f02012-04-22 18:45:24 -070057 *
58 * 7.19
59 * - add FUSE_FALLOCATE
Miklos Szeredic79e3222007-10-18 03:06:59 -070060 */
Miklos Szeredid8a5ba42005-09-09 13:10:26 -070061
Tejun Heo29d434b2008-10-16 16:08:57 +020062#ifndef _LINUX_FUSE_H
63#define _LINUX_FUSE_H
64
Miklos Szeredi1f55ed02008-12-01 19:14:02 +010065#include <linux/types.h>
Miklos Szeredid8a5ba42005-09-09 13:10:26 -070066
Miklos Szeredi37d217f2009-07-08 18:17:58 +020067/*
68 * Version negotiation:
69 *
70 * Both the kernel and userspace send the version they support in the
71 * INIT request and reply respectively.
72 *
73 * If the major versions match then both shall use the smallest
74 * of the two minor versions for communication.
75 *
76 * If the kernel supports a larger major version, then userspace shall
77 * reply with the major version it supports, ignore the rest of the
78 * INIT message and expect a new INIT message from the kernel with a
79 * matching major version.
80 *
81 * If the library supports a larger major version, then it shall fall
82 * back to the major protocol version sent by the kernel for
83 * communication and reply with that major version (and an arbitrary
84 * supported minor version).
85 */
86
Miklos Szeredid8a5ba42005-09-09 13:10:26 -070087/** Version number of this interface */
Miklos Szeredi9e6268d2005-09-09 13:10:29 -070088#define FUSE_KERNEL_VERSION 7
Miklos Szeredid8a5ba42005-09-09 13:10:26 -070089
90/** Minor version number of this interface */
Anatol Pomozov05ba1f02012-04-22 18:45:24 -070091#define FUSE_KERNEL_MINOR_VERSION 19
Miklos Szeredid8a5ba42005-09-09 13:10:26 -070092
93/** The node ID of the root inode */
94#define FUSE_ROOT_ID 1
95
Miklos Szeredi06663262005-09-09 13:10:32 -070096/* Make sure all structures are padded to 64bit boundary, so 32bit
97 userspace works under 64bit kernels */
98
Miklos Szeredid8a5ba42005-09-09 13:10:26 -070099struct fuse_attr {
100 __u64 ino;
101 __u64 size;
102 __u64 blocks;
103 __u64 atime;
104 __u64 mtime;
105 __u64 ctime;
106 __u32 atimensec;
107 __u32 mtimensec;
108 __u32 ctimensec;
109 __u32 mode;
110 __u32 nlink;
111 __u32 uid;
112 __u32 gid;
113 __u32 rdev;
Miklos Szeredi0e9663e2007-10-18 03:07:05 -0700114 __u32 blksize;
115 __u32 padding;
Miklos Szeredid8a5ba42005-09-09 13:10:26 -0700116};
117
Miklos Szeredie5e55582005-09-09 13:10:28 -0700118struct fuse_kstatfs {
119 __u64 blocks;
120 __u64 bfree;
121 __u64 bavail;
122 __u64 files;
123 __u64 ffree;
124 __u32 bsize;
125 __u32 namelen;
Miklos Szeredide5f1202006-01-06 00:19:37 -0800126 __u32 frsize;
127 __u32 padding;
128 __u32 spare[6];
Miklos Szeredie5e55582005-09-09 13:10:28 -0700129};
130
Miklos Szeredi71421252006-06-25 05:48:52 -0700131struct fuse_file_lock {
132 __u64 start;
133 __u64 end;
134 __u32 type;
135 __u32 pid; /* tgid */
136};
137
Miklos Szeredi9cd68452006-02-01 03:04:40 -0800138/**
139 * Bitmasks for fuse_setattr_in.valid
140 */
Miklos Szeredi9e6268d2005-09-09 13:10:29 -0700141#define FATTR_MODE (1 << 0)
142#define FATTR_UID (1 << 1)
143#define FATTR_GID (1 << 2)
144#define FATTR_SIZE (1 << 3)
145#define FATTR_ATIME (1 << 4)
146#define FATTR_MTIME (1 << 5)
Miklos Szeredibefc6492005-11-07 00:59:52 -0800147#define FATTR_FH (1 << 6)
Miklos Szeredi17637cb2007-10-18 03:07:01 -0700148#define FATTR_ATIME_NOW (1 << 7)
149#define FATTR_MTIME_NOW (1 << 8)
Miklos Szeredif3332112007-10-18 03:07:04 -0700150#define FATTR_LOCKOWNER (1 << 9)
Miklos Szeredi9e6268d2005-09-09 13:10:29 -0700151
Miklos Szeredi45323fb2005-09-09 13:10:37 -0700152/**
153 * Flags returned by the OPEN request
154 *
155 * FOPEN_DIRECT_IO: bypass page cache for this open file
156 * FOPEN_KEEP_CACHE: don't invalidate the data cache on open
Tejun Heoa7c1b992008-10-16 16:08:57 +0200157 * FOPEN_NONSEEKABLE: the file is not seekable
Miklos Szeredi45323fb2005-09-09 13:10:37 -0700158 */
159#define FOPEN_DIRECT_IO (1 << 0)
160#define FOPEN_KEEP_CACHE (1 << 1)
Tejun Heoa7c1b992008-10-16 16:08:57 +0200161#define FOPEN_NONSEEKABLE (1 << 2)
Miklos Szeredi45323fb2005-09-09 13:10:37 -0700162
Miklos Szeredi9cd68452006-02-01 03:04:40 -0800163/**
164 * INIT request/reply flags
Miklos Szeredi33670fa2008-07-25 01:49:02 -0700165 *
Miklos Szeredi37fb3a32011-08-08 16:08:08 +0200166 * FUSE_POSIX_LOCKS: remote locking for POSIX file locks
Miklos Szeredi33670fa2008-07-25 01:49:02 -0700167 * FUSE_EXPORT_SUPPORT: filesystem handles lookups of "." and ".."
Miklos Szeredie0a43dd2009-06-30 20:12:23 +0200168 * FUSE_DONT_MASK: don't apply umask to file mode on create operations
Miklos Szeredi37fb3a32011-08-08 16:08:08 +0200169 * FUSE_FLOCK_LOCKS: remote locking for BSD style file locks
Miklos Szeredi9cd68452006-02-01 03:04:40 -0800170 */
171#define FUSE_ASYNC_READ (1 << 0)
Miklos Szeredi71421252006-06-25 05:48:52 -0700172#define FUSE_POSIX_LOCKS (1 << 1)
Miklos Szeredic79e3222007-10-18 03:06:59 -0700173#define FUSE_FILE_OPS (1 << 2)
Miklos Szeredi6ff958e2007-10-18 03:07:02 -0700174#define FUSE_ATOMIC_O_TRUNC (1 << 3)
Miklos Szeredi33670fa2008-07-25 01:49:02 -0700175#define FUSE_EXPORT_SUPPORT (1 << 4)
Miklos Szeredi78bb6cb2008-05-12 14:02:32 -0700176#define FUSE_BIG_WRITES (1 << 5)
Miklos Szeredie0a43dd2009-06-30 20:12:23 +0200177#define FUSE_DONT_MASK (1 << 6)
Miklos Szeredi37fb3a32011-08-08 16:08:08 +0200178#define FUSE_FLOCK_LOCKS (1 << 10)
Miklos Szeredi9cd68452006-02-01 03:04:40 -0800179
Miklos Szeredie9168c12006-12-06 20:35:38 -0800180/**
Tejun Heo151060a2009-04-14 10:54:54 +0900181 * CUSE INIT request/reply flags
182 *
183 * CUSE_UNRESTRICTED_IOCTL: use unrestricted ioctl
184 */
185#define CUSE_UNRESTRICTED_IOCTL (1 << 0)
186
187/**
Miklos Szeredie9168c12006-12-06 20:35:38 -0800188 * Release flags
189 */
190#define FUSE_RELEASE_FLUSH (1 << 0)
Miklos Szeredi37fb3a32011-08-08 16:08:08 +0200191#define FUSE_RELEASE_FLOCK_UNLOCK (1 << 1)
Miklos Szeredie9168c12006-12-06 20:35:38 -0800192
Miklos Szeredic79e3222007-10-18 03:06:59 -0700193/**
194 * Getattr flags
195 */
196#define FUSE_GETATTR_FH (1 << 0)
197
Miklos Szeredia9ff4f82007-10-18 03:07:02 -0700198/**
199 * Lock flags
200 */
201#define FUSE_LK_FLOCK (1 << 0)
202
Miklos Szeredib25e82e2007-10-18 03:07:03 -0700203/**
204 * WRITE flags
205 *
206 * FUSE_WRITE_CACHE: delayed write from page cache, file handle is guessed
Miklos Szeredif3332112007-10-18 03:07:04 -0700207 * FUSE_WRITE_LOCKOWNER: lock_owner field is valid
Miklos Szeredib25e82e2007-10-18 03:07:03 -0700208 */
209#define FUSE_WRITE_CACHE (1 << 0)
Miklos Szeredif3332112007-10-18 03:07:04 -0700210#define FUSE_WRITE_LOCKOWNER (1 << 1)
211
212/**
213 * Read flags
214 */
215#define FUSE_READ_LOCKOWNER (1 << 1)
Miklos Szeredib25e82e2007-10-18 03:07:03 -0700216
Tejun Heo59efec72008-11-26 12:03:55 +0100217/**
218 * Ioctl flags
219 *
220 * FUSE_IOCTL_COMPAT: 32bit compat ioctl on 64bit machine
221 * FUSE_IOCTL_UNRESTRICTED: not restricted to well-formed ioctls, retry allowed
222 * FUSE_IOCTL_RETRY: retry with new iovecs
Miklos Szeredi1baa26b2010-12-07 20:16:56 +0100223 * FUSE_IOCTL_32BIT: 32bit ioctl
Miklos Szeredib18da0c2011-12-13 11:58:49 +0100224 * FUSE_IOCTL_DIR: is a directory
Tejun Heo59efec72008-11-26 12:03:55 +0100225 *
226 * FUSE_IOCTL_MAX_IOV: maximum of in_iovecs + out_iovecs
227 */
228#define FUSE_IOCTL_COMPAT (1 << 0)
229#define FUSE_IOCTL_UNRESTRICTED (1 << 1)
230#define FUSE_IOCTL_RETRY (1 << 2)
Miklos Szeredi1baa26b2010-12-07 20:16:56 +0100231#define FUSE_IOCTL_32BIT (1 << 3)
Miklos Szeredib18da0c2011-12-13 11:58:49 +0100232#define FUSE_IOCTL_DIR (1 << 4)
Tejun Heo59efec72008-11-26 12:03:55 +0100233
234#define FUSE_IOCTL_MAX_IOV 256
235
Tejun Heo95668a62008-11-26 12:03:55 +0100236/**
237 * Poll flags
238 *
239 * FUSE_POLL_SCHEDULE_NOTIFY: request poll notify
240 */
241#define FUSE_POLL_SCHEDULE_NOTIFY (1 << 0)
242
Miklos Szeredi334f4852005-09-09 13:10:27 -0700243enum fuse_opcode {
Miklos Szeredie5e55582005-09-09 13:10:28 -0700244 FUSE_LOOKUP = 1,
245 FUSE_FORGET = 2, /* no reply */
246 FUSE_GETATTR = 3,
Miklos Szeredi9e6268d2005-09-09 13:10:29 -0700247 FUSE_SETATTR = 4,
Miklos Szeredie5e55582005-09-09 13:10:28 -0700248 FUSE_READLINK = 5,
Miklos Szeredi9e6268d2005-09-09 13:10:29 -0700249 FUSE_SYMLINK = 6,
Miklos Szeredi9e6268d2005-09-09 13:10:29 -0700250 FUSE_MKNOD = 8,
251 FUSE_MKDIR = 9,
252 FUSE_UNLINK = 10,
253 FUSE_RMDIR = 11,
254 FUSE_RENAME = 12,
255 FUSE_LINK = 13,
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700256 FUSE_OPEN = 14,
257 FUSE_READ = 15,
258 FUSE_WRITE = 16,
Miklos Szeredie5e55582005-09-09 13:10:28 -0700259 FUSE_STATFS = 17,
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700260 FUSE_RELEASE = 18,
261 FUSE_FSYNC = 20,
Miklos Szeredi92a87802005-09-09 13:10:31 -0700262 FUSE_SETXATTR = 21,
263 FUSE_GETXATTR = 22,
264 FUSE_LISTXATTR = 23,
265 FUSE_REMOVEXATTR = 24,
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700266 FUSE_FLUSH = 25,
Miklos Szeredi04730fe2005-09-09 13:10:36 -0700267 FUSE_INIT = 26,
268 FUSE_OPENDIR = 27,
269 FUSE_READDIR = 28,
Miklos Szeredi82547982005-09-09 13:10:38 -0700270 FUSE_RELEASEDIR = 29,
Miklos Szeredi31d40d72005-11-07 00:59:50 -0800271 FUSE_FSYNCDIR = 30,
Miklos Szeredi71421252006-06-25 05:48:52 -0700272 FUSE_GETLK = 31,
273 FUSE_SETLK = 32,
274 FUSE_SETLKW = 33,
Miklos Szeredifd72faa2005-11-07 00:59:51 -0800275 FUSE_ACCESS = 34,
Miklos Szeredia4d27e72006-06-25 05:48:54 -0700276 FUSE_CREATE = 35,
277 FUSE_INTERRUPT = 36,
Miklos Szeredib2d22722006-12-06 20:35:51 -0800278 FUSE_BMAP = 37,
Miklos Szeredi0ec7ca42006-12-06 20:35:52 -0800279 FUSE_DESTROY = 38,
Tejun Heo59efec72008-11-26 12:03:55 +0100280 FUSE_IOCTL = 39,
Tejun Heo95668a62008-11-26 12:03:55 +0100281 FUSE_POLL = 40,
Miklos Szeredi2d45ba32010-07-12 14:41:40 +0200282 FUSE_NOTIFY_REPLY = 41,
Miklos Szeredi02c048b2010-12-07 20:16:56 +0100283 FUSE_BATCH_FORGET = 42,
Anatol Pomozov05ba1f02012-04-22 18:45:24 -0700284 FUSE_FALLOCATE = 43,
Tejun Heo151060a2009-04-14 10:54:54 +0900285
286 /* CUSE specific operations */
287 CUSE_INIT = 4096,
Miklos Szeredi334f4852005-09-09 13:10:27 -0700288};
289
Tejun Heo85993962008-11-26 12:03:55 +0100290enum fuse_notify_code {
Tejun Heo95668a62008-11-26 12:03:55 +0100291 FUSE_NOTIFY_POLL = 1,
John Muir3b463ae2009-05-31 11:13:57 -0400292 FUSE_NOTIFY_INVAL_INODE = 2,
293 FUSE_NOTIFY_INVAL_ENTRY = 3,
Miklos Szeredia1d75f22010-07-12 14:41:40 +0200294 FUSE_NOTIFY_STORE = 4,
Miklos Szeredi2d45ba32010-07-12 14:41:40 +0200295 FUSE_NOTIFY_RETRIEVE = 5,
John Muir451d0f52011-12-06 21:50:06 +0100296 FUSE_NOTIFY_DELETE = 6,
Tejun Heo85993962008-11-26 12:03:55 +0100297 FUSE_NOTIFY_CODE_MAX,
298};
299
Miklos Szeredi1d3d7522006-01-06 00:19:40 -0800300/* The read buffer is required to be at least 8k, but may be much larger */
301#define FUSE_MIN_READ_BUFFER 8192
Miklos Szeredie5e55582005-09-09 13:10:28 -0700302
Miklos Szeredi0e9663e2007-10-18 03:07:05 -0700303#define FUSE_COMPAT_ENTRY_OUT_SIZE 120
304
Miklos Szeredie5e55582005-09-09 13:10:28 -0700305struct fuse_entry_out {
306 __u64 nodeid; /* Inode ID */
307 __u64 generation; /* Inode generation: nodeid:gen must
308 be unique for the fs's lifetime */
309 __u64 entry_valid; /* Cache timeout for the name */
310 __u64 attr_valid; /* Cache timeout for the attributes */
311 __u32 entry_valid_nsec;
312 __u32 attr_valid_nsec;
313 struct fuse_attr attr;
314};
315
316struct fuse_forget_in {
Miklos Szeredi9e6268d2005-09-09 13:10:29 -0700317 __u64 nlookup;
Miklos Szeredie5e55582005-09-09 13:10:28 -0700318};
319
Miklos Szeredi02c048b2010-12-07 20:16:56 +0100320struct fuse_forget_one {
321 __u64 nodeid;
322 __u64 nlookup;
323};
324
325struct fuse_batch_forget_in {
326 __u32 count;
327 __u32 dummy;
328};
329
Miklos Szeredic79e3222007-10-18 03:06:59 -0700330struct fuse_getattr_in {
331 __u32 getattr_flags;
332 __u32 dummy;
333 __u64 fh;
334};
335
Miklos Szeredi0e9663e2007-10-18 03:07:05 -0700336#define FUSE_COMPAT_ATTR_OUT_SIZE 96
337
Miklos Szeredie5e55582005-09-09 13:10:28 -0700338struct fuse_attr_out {
339 __u64 attr_valid; /* Cache timeout for the attributes */
340 __u32 attr_valid_nsec;
341 __u32 dummy;
342 struct fuse_attr attr;
343};
344
Miklos Szeredie0a43dd2009-06-30 20:12:23 +0200345#define FUSE_COMPAT_MKNOD_IN_SIZE 8
346
Miklos Szeredi9e6268d2005-09-09 13:10:29 -0700347struct fuse_mknod_in {
348 __u32 mode;
349 __u32 rdev;
Miklos Szeredie0a43dd2009-06-30 20:12:23 +0200350 __u32 umask;
351 __u32 padding;
Miklos Szeredi9e6268d2005-09-09 13:10:29 -0700352};
353
354struct fuse_mkdir_in {
355 __u32 mode;
Miklos Szeredie0a43dd2009-06-30 20:12:23 +0200356 __u32 umask;
Miklos Szeredi9e6268d2005-09-09 13:10:29 -0700357};
358
359struct fuse_rename_in {
360 __u64 newdir;
361};
362
363struct fuse_link_in {
364 __u64 oldnodeid;
365};
366
367struct fuse_setattr_in {
368 __u32 valid;
Miklos Szeredi06663262005-09-09 13:10:32 -0700369 __u32 padding;
Miklos Szeredibefc6492005-11-07 00:59:52 -0800370 __u64 fh;
371 __u64 size;
Miklos Szeredif3332112007-10-18 03:07:04 -0700372 __u64 lock_owner;
Miklos Szeredibefc6492005-11-07 00:59:52 -0800373 __u64 atime;
374 __u64 mtime;
375 __u64 unused2;
376 __u32 atimensec;
377 __u32 mtimensec;
378 __u32 unused3;
379 __u32 mode;
380 __u32 unused4;
381 __u32 uid;
382 __u32 gid;
383 __u32 unused5;
Miklos Szeredi9e6268d2005-09-09 13:10:29 -0700384};
385
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700386struct fuse_open_in {
387 __u32 flags;
Miklos Szeredie0a43dd2009-06-30 20:12:23 +0200388 __u32 unused;
389};
390
391struct fuse_create_in {
392 __u32 flags;
Miklos Szeredifd72faa2005-11-07 00:59:51 -0800393 __u32 mode;
Miklos Szeredie0a43dd2009-06-30 20:12:23 +0200394 __u32 umask;
395 __u32 padding;
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700396};
397
398struct fuse_open_out {
399 __u64 fh;
400 __u32 open_flags;
Miklos Szeredi06663262005-09-09 13:10:32 -0700401 __u32 padding;
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700402};
403
404struct fuse_release_in {
405 __u64 fh;
406 __u32 flags;
Miklos Szeredie9168c12006-12-06 20:35:38 -0800407 __u32 release_flags;
408 __u64 lock_owner;
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700409};
410
411struct fuse_flush_in {
412 __u64 fh;
Miklos Szeredie9168c12006-12-06 20:35:38 -0800413 __u32 unused;
Miklos Szeredi06663262005-09-09 13:10:32 -0700414 __u32 padding;
Miklos Szeredi71421252006-06-25 05:48:52 -0700415 __u64 lock_owner;
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700416};
417
418struct fuse_read_in {
419 __u64 fh;
420 __u64 offset;
421 __u32 size;
Miklos Szeredif3332112007-10-18 03:07:04 -0700422 __u32 read_flags;
423 __u64 lock_owner;
Miklos Szeredia6643092007-11-28 16:22:00 -0800424 __u32 flags;
425 __u32 padding;
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700426};
427
Miklos Szeredif3332112007-10-18 03:07:04 -0700428#define FUSE_COMPAT_WRITE_IN_SIZE 24
429
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700430struct fuse_write_in {
431 __u64 fh;
432 __u64 offset;
433 __u32 size;
434 __u32 write_flags;
Miklos Szeredif3332112007-10-18 03:07:04 -0700435 __u64 lock_owner;
Miklos Szeredia6643092007-11-28 16:22:00 -0800436 __u32 flags;
437 __u32 padding;
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700438};
439
440struct fuse_write_out {
441 __u32 size;
Miklos Szeredi06663262005-09-09 13:10:32 -0700442 __u32 padding;
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700443};
444
Miklos Szeredide5f1202006-01-06 00:19:37 -0800445#define FUSE_COMPAT_STATFS_SIZE 48
446
Miklos Szeredie5e55582005-09-09 13:10:28 -0700447struct fuse_statfs_out {
448 struct fuse_kstatfs st;
449};
450
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700451struct fuse_fsync_in {
452 __u64 fh;
453 __u32 fsync_flags;
Miklos Szeredi06663262005-09-09 13:10:32 -0700454 __u32 padding;
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700455};
456
Miklos Szeredi92a87802005-09-09 13:10:31 -0700457struct fuse_setxattr_in {
458 __u32 size;
459 __u32 flags;
460};
461
462struct fuse_getxattr_in {
463 __u32 size;
Miklos Szeredi06663262005-09-09 13:10:32 -0700464 __u32 padding;
Miklos Szeredi92a87802005-09-09 13:10:31 -0700465};
466
467struct fuse_getxattr_out {
468 __u32 size;
Miklos Szeredi06663262005-09-09 13:10:32 -0700469 __u32 padding;
Miklos Szeredi92a87802005-09-09 13:10:31 -0700470};
471
Miklos Szeredi71421252006-06-25 05:48:52 -0700472struct fuse_lk_in {
473 __u64 fh;
474 __u64 owner;
475 struct fuse_file_lock lk;
Miklos Szeredia9ff4f82007-10-18 03:07:02 -0700476 __u32 lk_flags;
477 __u32 padding;
Miklos Szeredi71421252006-06-25 05:48:52 -0700478};
479
480struct fuse_lk_out {
481 struct fuse_file_lock lk;
482};
483
Miklos Szeredi31d40d72005-11-07 00:59:50 -0800484struct fuse_access_in {
485 __u32 mask;
486 __u32 padding;
487};
488
Miklos Szeredi3ec870d2006-01-06 00:19:41 -0800489struct fuse_init_in {
Miklos Szeredi334f4852005-09-09 13:10:27 -0700490 __u32 major;
491 __u32 minor;
Miklos Szeredi9cd68452006-02-01 03:04:40 -0800492 __u32 max_readahead;
493 __u32 flags;
Miklos Szeredi334f4852005-09-09 13:10:27 -0700494};
495
Miklos Szeredi3ec870d2006-01-06 00:19:41 -0800496struct fuse_init_out {
497 __u32 major;
498 __u32 minor;
Miklos Szeredi9cd68452006-02-01 03:04:40 -0800499 __u32 max_readahead;
500 __u32 flags;
Csaba Henk7a6d3c82009-07-01 17:28:41 -0700501 __u16 max_background;
502 __u16 congestion_threshold;
Miklos Szeredi3ec870d2006-01-06 00:19:41 -0800503 __u32 max_write;
504};
505
Tejun Heo151060a2009-04-14 10:54:54 +0900506#define CUSE_INIT_INFO_MAX 4096
507
508struct cuse_init_in {
509 __u32 major;
510 __u32 minor;
511 __u32 unused;
512 __u32 flags;
513};
514
515struct cuse_init_out {
516 __u32 major;
517 __u32 minor;
518 __u32 unused;
519 __u32 flags;
520 __u32 max_read;
521 __u32 max_write;
522 __u32 dev_major; /* chardev major */
523 __u32 dev_minor; /* chardev minor */
524 __u32 spare[10];
525};
526
Miklos Szeredia4d27e72006-06-25 05:48:54 -0700527struct fuse_interrupt_in {
528 __u64 unique;
529};
530
Miklos Szeredib2d22722006-12-06 20:35:51 -0800531struct fuse_bmap_in {
532 __u64 block;
533 __u32 blocksize;
534 __u32 padding;
535};
536
537struct fuse_bmap_out {
538 __u64 block;
539};
540
Tejun Heo59efec72008-11-26 12:03:55 +0100541struct fuse_ioctl_in {
542 __u64 fh;
543 __u32 flags;
544 __u32 cmd;
545 __u64 arg;
546 __u32 in_size;
547 __u32 out_size;
548};
549
Miklos Szeredi1baa26b2010-12-07 20:16:56 +0100550struct fuse_ioctl_iovec {
551 __u64 base;
552 __u64 len;
553};
554
Tejun Heo59efec72008-11-26 12:03:55 +0100555struct fuse_ioctl_out {
556 __s32 result;
557 __u32 flags;
558 __u32 in_iovs;
559 __u32 out_iovs;
560};
561
Tejun Heo95668a62008-11-26 12:03:55 +0100562struct fuse_poll_in {
563 __u64 fh;
564 __u64 kh;
565 __u32 flags;
566 __u32 padding;
567};
568
569struct fuse_poll_out {
570 __u32 revents;
571 __u32 padding;
572};
573
574struct fuse_notify_poll_wakeup_out {
575 __u64 kh;
576};
577
Anatol Pomozov05ba1f02012-04-22 18:45:24 -0700578struct fuse_fallocate_in {
579 __u64 fh;
580 __u64 offset;
581 __u64 length;
582 __u32 mode;
583 __u32 padding;
584};
585
Miklos Szeredi334f4852005-09-09 13:10:27 -0700586struct fuse_in_header {
587 __u32 len;
588 __u32 opcode;
589 __u64 unique;
590 __u64 nodeid;
591 __u32 uid;
592 __u32 gid;
593 __u32 pid;
Miklos Szeredi06663262005-09-09 13:10:32 -0700594 __u32 padding;
Miklos Szeredi334f4852005-09-09 13:10:27 -0700595};
596
597struct fuse_out_header {
598 __u32 len;
599 __s32 error;
600 __u64 unique;
601};
602
Miklos Szeredie5e55582005-09-09 13:10:28 -0700603struct fuse_dirent {
604 __u64 ino;
605 __u64 off;
606 __u32 namelen;
607 __u32 type;
Miklos Szeredic628ee62012-04-12 12:57:08 +0200608 char name[];
Miklos Szeredie5e55582005-09-09 13:10:28 -0700609};
610
Andrew Morton21f3da92007-07-15 23:39:50 -0700611#define FUSE_NAME_OFFSET offsetof(struct fuse_dirent, name)
Miklos Szeredie5e55582005-09-09 13:10:28 -0700612#define FUSE_DIRENT_ALIGN(x) (((x) + sizeof(__u64) - 1) & ~(sizeof(__u64) - 1))
613#define FUSE_DIRENT_SIZE(d) \
614 FUSE_DIRENT_ALIGN(FUSE_NAME_OFFSET + (d)->namelen)
Tejun Heo29d434b2008-10-16 16:08:57 +0200615
John Muir3b463ae2009-05-31 11:13:57 -0400616struct fuse_notify_inval_inode_out {
617 __u64 ino;
618 __s64 off;
619 __s64 len;
620};
621
622struct fuse_notify_inval_entry_out {
623 __u64 parent;
624 __u32 namelen;
625 __u32 padding;
626};
627
John Muir451d0f52011-12-06 21:50:06 +0100628struct fuse_notify_delete_out {
629 __u64 parent;
630 __u64 child;
631 __u32 namelen;
632 __u32 padding;
633};
634
Miklos Szeredia1d75f22010-07-12 14:41:40 +0200635struct fuse_notify_store_out {
636 __u64 nodeid;
637 __u64 offset;
638 __u32 size;
639 __u32 padding;
640};
641
Miklos Szeredi2d45ba32010-07-12 14:41:40 +0200642struct fuse_notify_retrieve_out {
643 __u64 notify_unique;
644 __u64 nodeid;
645 __u64 offset;
646 __u32 size;
647 __u32 padding;
648};
649
650/* Matches the size of fuse_write_in */
651struct fuse_notify_retrieve_in {
652 __u64 dummy1;
653 __u64 offset;
654 __u32 size;
655 __u32 dummy2;
656 __u64 dummy3;
657 __u64 dummy4;
658};
659
Tejun Heo29d434b2008-10-16 16:08:57 +0200660#endif /* _LINUX_FUSE_H */