blob: 8f2ab8fef929f42b81f3d9a75c564b42455dc06e [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
Miklos Szeredic79e3222007-10-18 03:06:59 -070057 */
Miklos Szeredid8a5ba42005-09-09 13:10:26 -070058
Tejun Heo29d434b2008-10-16 16:08:57 +020059#ifndef _LINUX_FUSE_H
60#define _LINUX_FUSE_H
61
Miklos Szeredi1f55ed02008-12-01 19:14:02 +010062#include <linux/types.h>
Miklos Szeredid8a5ba42005-09-09 13:10:26 -070063
Miklos Szeredi37d217f2009-07-08 18:17:58 +020064/*
65 * Version negotiation:
66 *
67 * Both the kernel and userspace send the version they support in the
68 * INIT request and reply respectively.
69 *
70 * If the major versions match then both shall use the smallest
71 * of the two minor versions for communication.
72 *
73 * If the kernel supports a larger major version, then userspace shall
74 * reply with the major version it supports, ignore the rest of the
75 * INIT message and expect a new INIT message from the kernel with a
76 * matching major version.
77 *
78 * If the library supports a larger major version, then it shall fall
79 * back to the major protocol version sent by the kernel for
80 * communication and reply with that major version (and an arbitrary
81 * supported minor version).
82 */
83
Miklos Szeredid8a5ba42005-09-09 13:10:26 -070084/** Version number of this interface */
Miklos Szeredi9e6268d2005-09-09 13:10:29 -070085#define FUSE_KERNEL_VERSION 7
Miklos Szeredid8a5ba42005-09-09 13:10:26 -070086
87/** Minor version number of this interface */
Miklos Szeredib18da0c2011-12-13 11:58:49 +010088#define FUSE_KERNEL_MINOR_VERSION 18
Miklos Szeredid8a5ba42005-09-09 13:10:26 -070089
90/** The node ID of the root inode */
91#define FUSE_ROOT_ID 1
92
Miklos Szeredi06663262005-09-09 13:10:32 -070093/* Make sure all structures are padded to 64bit boundary, so 32bit
94 userspace works under 64bit kernels */
95
Miklos Szeredid8a5ba42005-09-09 13:10:26 -070096struct fuse_attr {
97 __u64 ino;
98 __u64 size;
99 __u64 blocks;
100 __u64 atime;
101 __u64 mtime;
102 __u64 ctime;
103 __u32 atimensec;
104 __u32 mtimensec;
105 __u32 ctimensec;
106 __u32 mode;
107 __u32 nlink;
108 __u32 uid;
109 __u32 gid;
110 __u32 rdev;
Miklos Szeredi0e9663e2007-10-18 03:07:05 -0700111 __u32 blksize;
112 __u32 padding;
Miklos Szeredid8a5ba42005-09-09 13:10:26 -0700113};
114
Miklos Szeredie5e55582005-09-09 13:10:28 -0700115struct fuse_kstatfs {
116 __u64 blocks;
117 __u64 bfree;
118 __u64 bavail;
119 __u64 files;
120 __u64 ffree;
121 __u32 bsize;
122 __u32 namelen;
Miklos Szeredide5f1202006-01-06 00:19:37 -0800123 __u32 frsize;
124 __u32 padding;
125 __u32 spare[6];
Miklos Szeredie5e55582005-09-09 13:10:28 -0700126};
127
Miklos Szeredi71421252006-06-25 05:48:52 -0700128struct fuse_file_lock {
129 __u64 start;
130 __u64 end;
131 __u32 type;
132 __u32 pid; /* tgid */
133};
134
Miklos Szeredi9cd68452006-02-01 03:04:40 -0800135/**
136 * Bitmasks for fuse_setattr_in.valid
137 */
Miklos Szeredi9e6268d2005-09-09 13:10:29 -0700138#define FATTR_MODE (1 << 0)
139#define FATTR_UID (1 << 1)
140#define FATTR_GID (1 << 2)
141#define FATTR_SIZE (1 << 3)
142#define FATTR_ATIME (1 << 4)
143#define FATTR_MTIME (1 << 5)
Miklos Szeredibefc6492005-11-07 00:59:52 -0800144#define FATTR_FH (1 << 6)
Miklos Szeredi17637cb2007-10-18 03:07:01 -0700145#define FATTR_ATIME_NOW (1 << 7)
146#define FATTR_MTIME_NOW (1 << 8)
Miklos Szeredif3332112007-10-18 03:07:04 -0700147#define FATTR_LOCKOWNER (1 << 9)
Miklos Szeredi9e6268d2005-09-09 13:10:29 -0700148
Miklos Szeredi45323fb2005-09-09 13:10:37 -0700149/**
150 * Flags returned by the OPEN request
151 *
152 * FOPEN_DIRECT_IO: bypass page cache for this open file
153 * FOPEN_KEEP_CACHE: don't invalidate the data cache on open
Tejun Heoa7c1b992008-10-16 16:08:57 +0200154 * FOPEN_NONSEEKABLE: the file is not seekable
Miklos Szeredi45323fb2005-09-09 13:10:37 -0700155 */
156#define FOPEN_DIRECT_IO (1 << 0)
157#define FOPEN_KEEP_CACHE (1 << 1)
Tejun Heoa7c1b992008-10-16 16:08:57 +0200158#define FOPEN_NONSEEKABLE (1 << 2)
Miklos Szeredi45323fb2005-09-09 13:10:37 -0700159
Miklos Szeredi9cd68452006-02-01 03:04:40 -0800160/**
161 * INIT request/reply flags
Miklos Szeredi33670fa2008-07-25 01:49:02 -0700162 *
Miklos Szeredi37fb3a32011-08-08 16:08:08 +0200163 * FUSE_POSIX_LOCKS: remote locking for POSIX file locks
Miklos Szeredi33670fa2008-07-25 01:49:02 -0700164 * FUSE_EXPORT_SUPPORT: filesystem handles lookups of "." and ".."
Miklos Szeredie0a43dd2009-06-30 20:12:23 +0200165 * FUSE_DONT_MASK: don't apply umask to file mode on create operations
Miklos Szeredi37fb3a32011-08-08 16:08:08 +0200166 * FUSE_FLOCK_LOCKS: remote locking for BSD style file locks
Miklos Szeredi9cd68452006-02-01 03:04:40 -0800167 */
168#define FUSE_ASYNC_READ (1 << 0)
Miklos Szeredi71421252006-06-25 05:48:52 -0700169#define FUSE_POSIX_LOCKS (1 << 1)
Miklos Szeredic79e3222007-10-18 03:06:59 -0700170#define FUSE_FILE_OPS (1 << 2)
Miklos Szeredi6ff958e2007-10-18 03:07:02 -0700171#define FUSE_ATOMIC_O_TRUNC (1 << 3)
Miklos Szeredi33670fa2008-07-25 01:49:02 -0700172#define FUSE_EXPORT_SUPPORT (1 << 4)
Miklos Szeredi78bb6cb2008-05-12 14:02:32 -0700173#define FUSE_BIG_WRITES (1 << 5)
Miklos Szeredie0a43dd2009-06-30 20:12:23 +0200174#define FUSE_DONT_MASK (1 << 6)
Miklos Szeredi37fb3a32011-08-08 16:08:08 +0200175#define FUSE_FLOCK_LOCKS (1 << 10)
Miklos Szeredi9cd68452006-02-01 03:04:40 -0800176
Miklos Szeredie9168c12006-12-06 20:35:38 -0800177/**
Tejun Heo151060a2009-04-14 10:54:54 +0900178 * CUSE INIT request/reply flags
179 *
180 * CUSE_UNRESTRICTED_IOCTL: use unrestricted ioctl
181 */
182#define CUSE_UNRESTRICTED_IOCTL (1 << 0)
183
184/**
Miklos Szeredie9168c12006-12-06 20:35:38 -0800185 * Release flags
186 */
187#define FUSE_RELEASE_FLUSH (1 << 0)
Miklos Szeredi37fb3a32011-08-08 16:08:08 +0200188#define FUSE_RELEASE_FLOCK_UNLOCK (1 << 1)
Miklos Szeredie9168c12006-12-06 20:35:38 -0800189
Miklos Szeredic79e3222007-10-18 03:06:59 -0700190/**
191 * Getattr flags
192 */
193#define FUSE_GETATTR_FH (1 << 0)
194
Miklos Szeredia9ff4f82007-10-18 03:07:02 -0700195/**
196 * Lock flags
197 */
198#define FUSE_LK_FLOCK (1 << 0)
199
Miklos Szeredib25e82e2007-10-18 03:07:03 -0700200/**
201 * WRITE flags
202 *
203 * FUSE_WRITE_CACHE: delayed write from page cache, file handle is guessed
Miklos Szeredif3332112007-10-18 03:07:04 -0700204 * FUSE_WRITE_LOCKOWNER: lock_owner field is valid
Miklos Szeredib25e82e2007-10-18 03:07:03 -0700205 */
206#define FUSE_WRITE_CACHE (1 << 0)
Miklos Szeredif3332112007-10-18 03:07:04 -0700207#define FUSE_WRITE_LOCKOWNER (1 << 1)
208
209/**
210 * Read flags
211 */
212#define FUSE_READ_LOCKOWNER (1 << 1)
Miklos Szeredib25e82e2007-10-18 03:07:03 -0700213
Tejun Heo59efec72008-11-26 12:03:55 +0100214/**
215 * Ioctl flags
216 *
217 * FUSE_IOCTL_COMPAT: 32bit compat ioctl on 64bit machine
218 * FUSE_IOCTL_UNRESTRICTED: not restricted to well-formed ioctls, retry allowed
219 * FUSE_IOCTL_RETRY: retry with new iovecs
Miklos Szeredi1baa26b2010-12-07 20:16:56 +0100220 * FUSE_IOCTL_32BIT: 32bit ioctl
Miklos Szeredib18da0c2011-12-13 11:58:49 +0100221 * FUSE_IOCTL_DIR: is a directory
Tejun Heo59efec72008-11-26 12:03:55 +0100222 *
223 * FUSE_IOCTL_MAX_IOV: maximum of in_iovecs + out_iovecs
224 */
225#define FUSE_IOCTL_COMPAT (1 << 0)
226#define FUSE_IOCTL_UNRESTRICTED (1 << 1)
227#define FUSE_IOCTL_RETRY (1 << 2)
Miklos Szeredi1baa26b2010-12-07 20:16:56 +0100228#define FUSE_IOCTL_32BIT (1 << 3)
Miklos Szeredib18da0c2011-12-13 11:58:49 +0100229#define FUSE_IOCTL_DIR (1 << 4)
Tejun Heo59efec72008-11-26 12:03:55 +0100230
231#define FUSE_IOCTL_MAX_IOV 256
232
Tejun Heo95668a62008-11-26 12:03:55 +0100233/**
234 * Poll flags
235 *
236 * FUSE_POLL_SCHEDULE_NOTIFY: request poll notify
237 */
238#define FUSE_POLL_SCHEDULE_NOTIFY (1 << 0)
239
Miklos Szeredi334f4852005-09-09 13:10:27 -0700240enum fuse_opcode {
Miklos Szeredie5e55582005-09-09 13:10:28 -0700241 FUSE_LOOKUP = 1,
242 FUSE_FORGET = 2, /* no reply */
243 FUSE_GETATTR = 3,
Miklos Szeredi9e6268d2005-09-09 13:10:29 -0700244 FUSE_SETATTR = 4,
Miklos Szeredie5e55582005-09-09 13:10:28 -0700245 FUSE_READLINK = 5,
Miklos Szeredi9e6268d2005-09-09 13:10:29 -0700246 FUSE_SYMLINK = 6,
Miklos Szeredi9e6268d2005-09-09 13:10:29 -0700247 FUSE_MKNOD = 8,
248 FUSE_MKDIR = 9,
249 FUSE_UNLINK = 10,
250 FUSE_RMDIR = 11,
251 FUSE_RENAME = 12,
252 FUSE_LINK = 13,
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700253 FUSE_OPEN = 14,
254 FUSE_READ = 15,
255 FUSE_WRITE = 16,
Miklos Szeredie5e55582005-09-09 13:10:28 -0700256 FUSE_STATFS = 17,
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700257 FUSE_RELEASE = 18,
258 FUSE_FSYNC = 20,
Miklos Szeredi92a87802005-09-09 13:10:31 -0700259 FUSE_SETXATTR = 21,
260 FUSE_GETXATTR = 22,
261 FUSE_LISTXATTR = 23,
262 FUSE_REMOVEXATTR = 24,
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700263 FUSE_FLUSH = 25,
Miklos Szeredi04730fe2005-09-09 13:10:36 -0700264 FUSE_INIT = 26,
265 FUSE_OPENDIR = 27,
266 FUSE_READDIR = 28,
Miklos Szeredi82547982005-09-09 13:10:38 -0700267 FUSE_RELEASEDIR = 29,
Miklos Szeredi31d40d72005-11-07 00:59:50 -0800268 FUSE_FSYNCDIR = 30,
Miklos Szeredi71421252006-06-25 05:48:52 -0700269 FUSE_GETLK = 31,
270 FUSE_SETLK = 32,
271 FUSE_SETLKW = 33,
Miklos Szeredifd72faa2005-11-07 00:59:51 -0800272 FUSE_ACCESS = 34,
Miklos Szeredia4d27e72006-06-25 05:48:54 -0700273 FUSE_CREATE = 35,
274 FUSE_INTERRUPT = 36,
Miklos Szeredib2d22722006-12-06 20:35:51 -0800275 FUSE_BMAP = 37,
Miklos Szeredi0ec7ca42006-12-06 20:35:52 -0800276 FUSE_DESTROY = 38,
Tejun Heo59efec72008-11-26 12:03:55 +0100277 FUSE_IOCTL = 39,
Tejun Heo95668a62008-11-26 12:03:55 +0100278 FUSE_POLL = 40,
Miklos Szeredi2d45ba32010-07-12 14:41:40 +0200279 FUSE_NOTIFY_REPLY = 41,
Miklos Szeredi02c048b2010-12-07 20:16:56 +0100280 FUSE_BATCH_FORGET = 42,
Tejun Heo151060a2009-04-14 10:54:54 +0900281
282 /* CUSE specific operations */
283 CUSE_INIT = 4096,
Miklos Szeredi334f4852005-09-09 13:10:27 -0700284};
285
Tejun Heo85993962008-11-26 12:03:55 +0100286enum fuse_notify_code {
Tejun Heo95668a62008-11-26 12:03:55 +0100287 FUSE_NOTIFY_POLL = 1,
John Muir3b463ae2009-05-31 11:13:57 -0400288 FUSE_NOTIFY_INVAL_INODE = 2,
289 FUSE_NOTIFY_INVAL_ENTRY = 3,
Miklos Szeredia1d75f22010-07-12 14:41:40 +0200290 FUSE_NOTIFY_STORE = 4,
Miklos Szeredi2d45ba32010-07-12 14:41:40 +0200291 FUSE_NOTIFY_RETRIEVE = 5,
John Muir451d0f52011-12-06 21:50:06 +0100292 FUSE_NOTIFY_DELETE = 6,
Tejun Heo85993962008-11-26 12:03:55 +0100293 FUSE_NOTIFY_CODE_MAX,
294};
295
Miklos Szeredi1d3d7522006-01-06 00:19:40 -0800296/* The read buffer is required to be at least 8k, but may be much larger */
297#define FUSE_MIN_READ_BUFFER 8192
Miklos Szeredie5e55582005-09-09 13:10:28 -0700298
Miklos Szeredi0e9663e2007-10-18 03:07:05 -0700299#define FUSE_COMPAT_ENTRY_OUT_SIZE 120
300
Miklos Szeredie5e55582005-09-09 13:10:28 -0700301struct fuse_entry_out {
302 __u64 nodeid; /* Inode ID */
303 __u64 generation; /* Inode generation: nodeid:gen must
304 be unique for the fs's lifetime */
305 __u64 entry_valid; /* Cache timeout for the name */
306 __u64 attr_valid; /* Cache timeout for the attributes */
307 __u32 entry_valid_nsec;
308 __u32 attr_valid_nsec;
309 struct fuse_attr attr;
310};
311
312struct fuse_forget_in {
Miklos Szeredi9e6268d2005-09-09 13:10:29 -0700313 __u64 nlookup;
Miklos Szeredie5e55582005-09-09 13:10:28 -0700314};
315
Miklos Szeredi02c048b2010-12-07 20:16:56 +0100316struct fuse_forget_one {
317 __u64 nodeid;
318 __u64 nlookup;
319};
320
321struct fuse_batch_forget_in {
322 __u32 count;
323 __u32 dummy;
324};
325
Miklos Szeredic79e3222007-10-18 03:06:59 -0700326struct fuse_getattr_in {
327 __u32 getattr_flags;
328 __u32 dummy;
329 __u64 fh;
330};
331
Miklos Szeredi0e9663e2007-10-18 03:07:05 -0700332#define FUSE_COMPAT_ATTR_OUT_SIZE 96
333
Miklos Szeredie5e55582005-09-09 13:10:28 -0700334struct fuse_attr_out {
335 __u64 attr_valid; /* Cache timeout for the attributes */
336 __u32 attr_valid_nsec;
337 __u32 dummy;
338 struct fuse_attr attr;
339};
340
Miklos Szeredie0a43dd2009-06-30 20:12:23 +0200341#define FUSE_COMPAT_MKNOD_IN_SIZE 8
342
Miklos Szeredi9e6268d2005-09-09 13:10:29 -0700343struct fuse_mknod_in {
344 __u32 mode;
345 __u32 rdev;
Miklos Szeredie0a43dd2009-06-30 20:12:23 +0200346 __u32 umask;
347 __u32 padding;
Miklos Szeredi9e6268d2005-09-09 13:10:29 -0700348};
349
350struct fuse_mkdir_in {
351 __u32 mode;
Miklos Szeredie0a43dd2009-06-30 20:12:23 +0200352 __u32 umask;
Miklos Szeredi9e6268d2005-09-09 13:10:29 -0700353};
354
355struct fuse_rename_in {
356 __u64 newdir;
357};
358
359struct fuse_link_in {
360 __u64 oldnodeid;
361};
362
363struct fuse_setattr_in {
364 __u32 valid;
Miklos Szeredi06663262005-09-09 13:10:32 -0700365 __u32 padding;
Miklos Szeredibefc6492005-11-07 00:59:52 -0800366 __u64 fh;
367 __u64 size;
Miklos Szeredif3332112007-10-18 03:07:04 -0700368 __u64 lock_owner;
Miklos Szeredibefc6492005-11-07 00:59:52 -0800369 __u64 atime;
370 __u64 mtime;
371 __u64 unused2;
372 __u32 atimensec;
373 __u32 mtimensec;
374 __u32 unused3;
375 __u32 mode;
376 __u32 unused4;
377 __u32 uid;
378 __u32 gid;
379 __u32 unused5;
Miklos Szeredi9e6268d2005-09-09 13:10:29 -0700380};
381
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700382struct fuse_open_in {
383 __u32 flags;
Miklos Szeredie0a43dd2009-06-30 20:12:23 +0200384 __u32 unused;
385};
386
387struct fuse_create_in {
388 __u32 flags;
Miklos Szeredifd72faa2005-11-07 00:59:51 -0800389 __u32 mode;
Miklos Szeredie0a43dd2009-06-30 20:12:23 +0200390 __u32 umask;
391 __u32 padding;
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700392};
393
394struct fuse_open_out {
395 __u64 fh;
396 __u32 open_flags;
Miklos Szeredi06663262005-09-09 13:10:32 -0700397 __u32 padding;
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700398};
399
400struct fuse_release_in {
401 __u64 fh;
402 __u32 flags;
Miklos Szeredie9168c12006-12-06 20:35:38 -0800403 __u32 release_flags;
404 __u64 lock_owner;
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700405};
406
407struct fuse_flush_in {
408 __u64 fh;
Miklos Szeredie9168c12006-12-06 20:35:38 -0800409 __u32 unused;
Miklos Szeredi06663262005-09-09 13:10:32 -0700410 __u32 padding;
Miklos Szeredi71421252006-06-25 05:48:52 -0700411 __u64 lock_owner;
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700412};
413
414struct fuse_read_in {
415 __u64 fh;
416 __u64 offset;
417 __u32 size;
Miklos Szeredif3332112007-10-18 03:07:04 -0700418 __u32 read_flags;
419 __u64 lock_owner;
Miklos Szeredia6643092007-11-28 16:22:00 -0800420 __u32 flags;
421 __u32 padding;
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700422};
423
Miklos Szeredif3332112007-10-18 03:07:04 -0700424#define FUSE_COMPAT_WRITE_IN_SIZE 24
425
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700426struct fuse_write_in {
427 __u64 fh;
428 __u64 offset;
429 __u32 size;
430 __u32 write_flags;
Miklos Szeredif3332112007-10-18 03:07:04 -0700431 __u64 lock_owner;
Miklos Szeredia6643092007-11-28 16:22:00 -0800432 __u32 flags;
433 __u32 padding;
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700434};
435
436struct fuse_write_out {
437 __u32 size;
Miklos Szeredi06663262005-09-09 13:10:32 -0700438 __u32 padding;
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700439};
440
Miklos Szeredide5f1202006-01-06 00:19:37 -0800441#define FUSE_COMPAT_STATFS_SIZE 48
442
Miklos Szeredie5e55582005-09-09 13:10:28 -0700443struct fuse_statfs_out {
444 struct fuse_kstatfs st;
445};
446
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700447struct fuse_fsync_in {
448 __u64 fh;
449 __u32 fsync_flags;
Miklos Szeredi06663262005-09-09 13:10:32 -0700450 __u32 padding;
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700451};
452
Miklos Szeredi92a87802005-09-09 13:10:31 -0700453struct fuse_setxattr_in {
454 __u32 size;
455 __u32 flags;
456};
457
458struct fuse_getxattr_in {
459 __u32 size;
Miklos Szeredi06663262005-09-09 13:10:32 -0700460 __u32 padding;
Miklos Szeredi92a87802005-09-09 13:10:31 -0700461};
462
463struct fuse_getxattr_out {
464 __u32 size;
Miklos Szeredi06663262005-09-09 13:10:32 -0700465 __u32 padding;
Miklos Szeredi92a87802005-09-09 13:10:31 -0700466};
467
Miklos Szeredi71421252006-06-25 05:48:52 -0700468struct fuse_lk_in {
469 __u64 fh;
470 __u64 owner;
471 struct fuse_file_lock lk;
Miklos Szeredia9ff4f82007-10-18 03:07:02 -0700472 __u32 lk_flags;
473 __u32 padding;
Miklos Szeredi71421252006-06-25 05:48:52 -0700474};
475
476struct fuse_lk_out {
477 struct fuse_file_lock lk;
478};
479
Miklos Szeredi31d40d72005-11-07 00:59:50 -0800480struct fuse_access_in {
481 __u32 mask;
482 __u32 padding;
483};
484
Miklos Szeredi3ec870d2006-01-06 00:19:41 -0800485struct fuse_init_in {
Miklos Szeredi334f4852005-09-09 13:10:27 -0700486 __u32 major;
487 __u32 minor;
Miklos Szeredi9cd68452006-02-01 03:04:40 -0800488 __u32 max_readahead;
489 __u32 flags;
Miklos Szeredi334f4852005-09-09 13:10:27 -0700490};
491
Miklos Szeredi3ec870d2006-01-06 00:19:41 -0800492struct fuse_init_out {
493 __u32 major;
494 __u32 minor;
Miklos Szeredi9cd68452006-02-01 03:04:40 -0800495 __u32 max_readahead;
496 __u32 flags;
Csaba Henk7a6d3c82009-07-01 17:28:41 -0700497 __u16 max_background;
498 __u16 congestion_threshold;
Miklos Szeredi3ec870d2006-01-06 00:19:41 -0800499 __u32 max_write;
500};
501
Tejun Heo151060a2009-04-14 10:54:54 +0900502#define CUSE_INIT_INFO_MAX 4096
503
504struct cuse_init_in {
505 __u32 major;
506 __u32 minor;
507 __u32 unused;
508 __u32 flags;
509};
510
511struct cuse_init_out {
512 __u32 major;
513 __u32 minor;
514 __u32 unused;
515 __u32 flags;
516 __u32 max_read;
517 __u32 max_write;
518 __u32 dev_major; /* chardev major */
519 __u32 dev_minor; /* chardev minor */
520 __u32 spare[10];
521};
522
Miklos Szeredia4d27e72006-06-25 05:48:54 -0700523struct fuse_interrupt_in {
524 __u64 unique;
525};
526
Miklos Szeredib2d22722006-12-06 20:35:51 -0800527struct fuse_bmap_in {
528 __u64 block;
529 __u32 blocksize;
530 __u32 padding;
531};
532
533struct fuse_bmap_out {
534 __u64 block;
535};
536
Tejun Heo59efec72008-11-26 12:03:55 +0100537struct fuse_ioctl_in {
538 __u64 fh;
539 __u32 flags;
540 __u32 cmd;
541 __u64 arg;
542 __u32 in_size;
543 __u32 out_size;
544};
545
Miklos Szeredi1baa26b2010-12-07 20:16:56 +0100546struct fuse_ioctl_iovec {
547 __u64 base;
548 __u64 len;
549};
550
Tejun Heo59efec72008-11-26 12:03:55 +0100551struct fuse_ioctl_out {
552 __s32 result;
553 __u32 flags;
554 __u32 in_iovs;
555 __u32 out_iovs;
556};
557
Tejun Heo95668a62008-11-26 12:03:55 +0100558struct fuse_poll_in {
559 __u64 fh;
560 __u64 kh;
561 __u32 flags;
562 __u32 padding;
563};
564
565struct fuse_poll_out {
566 __u32 revents;
567 __u32 padding;
568};
569
570struct fuse_notify_poll_wakeup_out {
571 __u64 kh;
572};
573
Miklos Szeredi334f4852005-09-09 13:10:27 -0700574struct fuse_in_header {
575 __u32 len;
576 __u32 opcode;
577 __u64 unique;
578 __u64 nodeid;
579 __u32 uid;
580 __u32 gid;
581 __u32 pid;
Miklos Szeredi06663262005-09-09 13:10:32 -0700582 __u32 padding;
Miklos Szeredi334f4852005-09-09 13:10:27 -0700583};
584
585struct fuse_out_header {
586 __u32 len;
587 __s32 error;
588 __u64 unique;
589};
590
Miklos Szeredie5e55582005-09-09 13:10:28 -0700591struct fuse_dirent {
592 __u64 ino;
593 __u64 off;
594 __u32 namelen;
595 __u32 type;
Miklos Szeredic628ee62012-04-12 12:57:08 +0200596 char name[];
Miklos Szeredie5e55582005-09-09 13:10:28 -0700597};
598
Andrew Morton21f3da92007-07-15 23:39:50 -0700599#define FUSE_NAME_OFFSET offsetof(struct fuse_dirent, name)
Miklos Szeredie5e55582005-09-09 13:10:28 -0700600#define FUSE_DIRENT_ALIGN(x) (((x) + sizeof(__u64) - 1) & ~(sizeof(__u64) - 1))
601#define FUSE_DIRENT_SIZE(d) \
602 FUSE_DIRENT_ALIGN(FUSE_NAME_OFFSET + (d)->namelen)
Tejun Heo29d434b2008-10-16 16:08:57 +0200603
John Muir3b463ae2009-05-31 11:13:57 -0400604struct fuse_notify_inval_inode_out {
605 __u64 ino;
606 __s64 off;
607 __s64 len;
608};
609
610struct fuse_notify_inval_entry_out {
611 __u64 parent;
612 __u32 namelen;
613 __u32 padding;
614};
615
John Muir451d0f52011-12-06 21:50:06 +0100616struct fuse_notify_delete_out {
617 __u64 parent;
618 __u64 child;
619 __u32 namelen;
620 __u32 padding;
621};
622
Miklos Szeredia1d75f22010-07-12 14:41:40 +0200623struct fuse_notify_store_out {
624 __u64 nodeid;
625 __u64 offset;
626 __u32 size;
627 __u32 padding;
628};
629
Miklos Szeredi2d45ba32010-07-12 14:41:40 +0200630struct fuse_notify_retrieve_out {
631 __u64 notify_unique;
632 __u64 nodeid;
633 __u64 offset;
634 __u32 size;
635 __u32 padding;
636};
637
638/* Matches the size of fuse_write_in */
639struct fuse_notify_retrieve_in {
640 __u64 dummy1;
641 __u64 offset;
642 __u32 size;
643 __u32 dummy2;
644 __u64 dummy3;
645 __u64 dummy4;
646};
647
Tejun Heo29d434b2008-10-16 16:08:57 +0200648#endif /* _LINUX_FUSE_H */