blob: 88e0eb5969196e6a14e0932fb75ad1174381493f [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 Szeredic79e3222007-10-18 03:06:59 -070040 */
Miklos Szeredid8a5ba42005-09-09 13:10:26 -070041
Tejun Heo29d434b2008-10-16 16:08:57 +020042#ifndef _LINUX_FUSE_H
43#define _LINUX_FUSE_H
44
Miklos Szeredi1f55ed02008-12-01 19:14:02 +010045#include <linux/types.h>
Miklos Szeredid8a5ba42005-09-09 13:10:26 -070046
Miklos Szeredi37d217f2009-07-08 18:17:58 +020047/*
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 Szeredid8a5ba42005-09-09 13:10:26 -070067/** Version number of this interface */
Miklos Szeredi9e6268d2005-09-09 13:10:29 -070068#define FUSE_KERNEL_VERSION 7
Miklos Szeredid8a5ba42005-09-09 13:10:26 -070069
70/** Minor version number of this interface */
Miklos Szeredidd3bb142010-05-25 15:06:06 +020071#define FUSE_KERNEL_MINOR_VERSION 14
Miklos Szeredid8a5ba42005-09-09 13:10:26 -070072
73/** The node ID of the root inode */
74#define FUSE_ROOT_ID 1
75
Miklos Szeredi06663262005-09-09 13:10:32 -070076/* Make sure all structures are padded to 64bit boundary, so 32bit
77 userspace works under 64bit kernels */
78
Miklos Szeredid8a5ba42005-09-09 13:10:26 -070079struct 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 Szeredi0e9663e2007-10-18 03:07:05 -070094 __u32 blksize;
95 __u32 padding;
Miklos Szeredid8a5ba42005-09-09 13:10:26 -070096};
97
Miklos Szeredie5e55582005-09-09 13:10:28 -070098struct fuse_kstatfs {
99 __u64 blocks;
100 __u64 bfree;
101 __u64 bavail;
102 __u64 files;
103 __u64 ffree;
104 __u32 bsize;
105 __u32 namelen;
Miklos Szeredide5f1202006-01-06 00:19:37 -0800106 __u32 frsize;
107 __u32 padding;
108 __u32 spare[6];
Miklos Szeredie5e55582005-09-09 13:10:28 -0700109};
110
Miklos Szeredi71421252006-06-25 05:48:52 -0700111struct fuse_file_lock {
112 __u64 start;
113 __u64 end;
114 __u32 type;
115 __u32 pid; /* tgid */
116};
117
Miklos Szeredi9cd68452006-02-01 03:04:40 -0800118/**
119 * Bitmasks for fuse_setattr_in.valid
120 */
Miklos Szeredi9e6268d2005-09-09 13:10:29 -0700121#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 Szeredibefc6492005-11-07 00:59:52 -0800127#define FATTR_FH (1 << 6)
Miklos Szeredi17637cb2007-10-18 03:07:01 -0700128#define FATTR_ATIME_NOW (1 << 7)
129#define FATTR_MTIME_NOW (1 << 8)
Miklos Szeredif3332112007-10-18 03:07:04 -0700130#define FATTR_LOCKOWNER (1 << 9)
Miklos Szeredi9e6268d2005-09-09 13:10:29 -0700131
Miklos Szeredi45323fb2005-09-09 13:10:37 -0700132/**
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 Heoa7c1b992008-10-16 16:08:57 +0200137 * FOPEN_NONSEEKABLE: the file is not seekable
Miklos Szeredi45323fb2005-09-09 13:10:37 -0700138 */
139#define FOPEN_DIRECT_IO (1 << 0)
140#define FOPEN_KEEP_CACHE (1 << 1)
Tejun Heoa7c1b992008-10-16 16:08:57 +0200141#define FOPEN_NONSEEKABLE (1 << 2)
Miklos Szeredi45323fb2005-09-09 13:10:37 -0700142
Miklos Szeredi9cd68452006-02-01 03:04:40 -0800143/**
144 * INIT request/reply flags
Miklos Szeredi33670fa2008-07-25 01:49:02 -0700145 *
146 * FUSE_EXPORT_SUPPORT: filesystem handles lookups of "." and ".."
Miklos Szeredie0a43dd2009-06-30 20:12:23 +0200147 * FUSE_DONT_MASK: don't apply umask to file mode on create operations
Miklos Szeredi9cd68452006-02-01 03:04:40 -0800148 */
149#define FUSE_ASYNC_READ (1 << 0)
Miklos Szeredi71421252006-06-25 05:48:52 -0700150#define FUSE_POSIX_LOCKS (1 << 1)
Miklos Szeredic79e3222007-10-18 03:06:59 -0700151#define FUSE_FILE_OPS (1 << 2)
Miklos Szeredi6ff958e2007-10-18 03:07:02 -0700152#define FUSE_ATOMIC_O_TRUNC (1 << 3)
Miklos Szeredi33670fa2008-07-25 01:49:02 -0700153#define FUSE_EXPORT_SUPPORT (1 << 4)
Miklos Szeredi78bb6cb2008-05-12 14:02:32 -0700154#define FUSE_BIG_WRITES (1 << 5)
Miklos Szeredie0a43dd2009-06-30 20:12:23 +0200155#define FUSE_DONT_MASK (1 << 6)
Miklos Szeredi9cd68452006-02-01 03:04:40 -0800156
Miklos Szeredie9168c12006-12-06 20:35:38 -0800157/**
Tejun Heo151060a2009-04-14 10:54:54 +0900158 * CUSE INIT request/reply flags
159 *
160 * CUSE_UNRESTRICTED_IOCTL: use unrestricted ioctl
161 */
162#define CUSE_UNRESTRICTED_IOCTL (1 << 0)
163
164/**
Miklos Szeredie9168c12006-12-06 20:35:38 -0800165 * Release flags
166 */
167#define FUSE_RELEASE_FLUSH (1 << 0)
168
Miklos Szeredic79e3222007-10-18 03:06:59 -0700169/**
170 * Getattr flags
171 */
172#define FUSE_GETATTR_FH (1 << 0)
173
Miklos Szeredia9ff4f82007-10-18 03:07:02 -0700174/**
175 * Lock flags
176 */
177#define FUSE_LK_FLOCK (1 << 0)
178
Miklos Szeredib25e82e2007-10-18 03:07:03 -0700179/**
180 * WRITE flags
181 *
182 * FUSE_WRITE_CACHE: delayed write from page cache, file handle is guessed
Miklos Szeredif3332112007-10-18 03:07:04 -0700183 * FUSE_WRITE_LOCKOWNER: lock_owner field is valid
Miklos Szeredib25e82e2007-10-18 03:07:03 -0700184 */
185#define FUSE_WRITE_CACHE (1 << 0)
Miklos Szeredif3332112007-10-18 03:07:04 -0700186#define FUSE_WRITE_LOCKOWNER (1 << 1)
187
188/**
189 * Read flags
190 */
191#define FUSE_READ_LOCKOWNER (1 << 1)
Miklos Szeredib25e82e2007-10-18 03:07:03 -0700192
Tejun Heo59efec72008-11-26 12:03:55 +0100193/**
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 Heo95668a62008-11-26 12:03:55 +0100208/**
209 * Poll flags
210 *
211 * FUSE_POLL_SCHEDULE_NOTIFY: request poll notify
212 */
213#define FUSE_POLL_SCHEDULE_NOTIFY (1 << 0)
214
Miklos Szeredi334f4852005-09-09 13:10:27 -0700215enum fuse_opcode {
Miklos Szeredie5e55582005-09-09 13:10:28 -0700216 FUSE_LOOKUP = 1,
217 FUSE_FORGET = 2, /* no reply */
218 FUSE_GETATTR = 3,
Miklos Szeredi9e6268d2005-09-09 13:10:29 -0700219 FUSE_SETATTR = 4,
Miklos Szeredie5e55582005-09-09 13:10:28 -0700220 FUSE_READLINK = 5,
Miklos Szeredi9e6268d2005-09-09 13:10:29 -0700221 FUSE_SYMLINK = 6,
Miklos Szeredi9e6268d2005-09-09 13:10:29 -0700222 FUSE_MKNOD = 8,
223 FUSE_MKDIR = 9,
224 FUSE_UNLINK = 10,
225 FUSE_RMDIR = 11,
226 FUSE_RENAME = 12,
227 FUSE_LINK = 13,
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700228 FUSE_OPEN = 14,
229 FUSE_READ = 15,
230 FUSE_WRITE = 16,
Miklos Szeredie5e55582005-09-09 13:10:28 -0700231 FUSE_STATFS = 17,
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700232 FUSE_RELEASE = 18,
233 FUSE_FSYNC = 20,
Miklos Szeredi92a87802005-09-09 13:10:31 -0700234 FUSE_SETXATTR = 21,
235 FUSE_GETXATTR = 22,
236 FUSE_LISTXATTR = 23,
237 FUSE_REMOVEXATTR = 24,
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700238 FUSE_FLUSH = 25,
Miklos Szeredi04730fe2005-09-09 13:10:36 -0700239 FUSE_INIT = 26,
240 FUSE_OPENDIR = 27,
241 FUSE_READDIR = 28,
Miklos Szeredi82547982005-09-09 13:10:38 -0700242 FUSE_RELEASEDIR = 29,
Miklos Szeredi31d40d72005-11-07 00:59:50 -0800243 FUSE_FSYNCDIR = 30,
Miklos Szeredi71421252006-06-25 05:48:52 -0700244 FUSE_GETLK = 31,
245 FUSE_SETLK = 32,
246 FUSE_SETLKW = 33,
Miklos Szeredifd72faa2005-11-07 00:59:51 -0800247 FUSE_ACCESS = 34,
Miklos Szeredia4d27e72006-06-25 05:48:54 -0700248 FUSE_CREATE = 35,
249 FUSE_INTERRUPT = 36,
Miklos Szeredib2d22722006-12-06 20:35:51 -0800250 FUSE_BMAP = 37,
Miklos Szeredi0ec7ca42006-12-06 20:35:52 -0800251 FUSE_DESTROY = 38,
Tejun Heo59efec72008-11-26 12:03:55 +0100252 FUSE_IOCTL = 39,
Tejun Heo95668a62008-11-26 12:03:55 +0100253 FUSE_POLL = 40,
Tejun Heo151060a2009-04-14 10:54:54 +0900254
255 /* CUSE specific operations */
256 CUSE_INIT = 4096,
Miklos Szeredi334f4852005-09-09 13:10:27 -0700257};
258
Tejun Heo85993962008-11-26 12:03:55 +0100259enum fuse_notify_code {
Tejun Heo95668a62008-11-26 12:03:55 +0100260 FUSE_NOTIFY_POLL = 1,
John Muir3b463ae2009-05-31 11:13:57 -0400261 FUSE_NOTIFY_INVAL_INODE = 2,
262 FUSE_NOTIFY_INVAL_ENTRY = 3,
Tejun Heo85993962008-11-26 12:03:55 +0100263 FUSE_NOTIFY_CODE_MAX,
264};
265
Miklos Szeredi1d3d7522006-01-06 00:19:40 -0800266/* The read buffer is required to be at least 8k, but may be much larger */
267#define FUSE_MIN_READ_BUFFER 8192
Miklos Szeredie5e55582005-09-09 13:10:28 -0700268
Miklos Szeredi0e9663e2007-10-18 03:07:05 -0700269#define FUSE_COMPAT_ENTRY_OUT_SIZE 120
270
Miklos Szeredie5e55582005-09-09 13:10:28 -0700271struct 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
282struct fuse_forget_in {
Miklos Szeredi9e6268d2005-09-09 13:10:29 -0700283 __u64 nlookup;
Miklos Szeredie5e55582005-09-09 13:10:28 -0700284};
285
Miklos Szeredic79e3222007-10-18 03:06:59 -0700286struct fuse_getattr_in {
287 __u32 getattr_flags;
288 __u32 dummy;
289 __u64 fh;
290};
291
Miklos Szeredi0e9663e2007-10-18 03:07:05 -0700292#define FUSE_COMPAT_ATTR_OUT_SIZE 96
293
Miklos Szeredie5e55582005-09-09 13:10:28 -0700294struct 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 Szeredie0a43dd2009-06-30 20:12:23 +0200301#define FUSE_COMPAT_MKNOD_IN_SIZE 8
302
Miklos Szeredi9e6268d2005-09-09 13:10:29 -0700303struct fuse_mknod_in {
304 __u32 mode;
305 __u32 rdev;
Miklos Szeredie0a43dd2009-06-30 20:12:23 +0200306 __u32 umask;
307 __u32 padding;
Miklos Szeredi9e6268d2005-09-09 13:10:29 -0700308};
309
310struct fuse_mkdir_in {
311 __u32 mode;
Miklos Szeredie0a43dd2009-06-30 20:12:23 +0200312 __u32 umask;
Miklos Szeredi9e6268d2005-09-09 13:10:29 -0700313};
314
315struct fuse_rename_in {
316 __u64 newdir;
317};
318
319struct fuse_link_in {
320 __u64 oldnodeid;
321};
322
323struct fuse_setattr_in {
324 __u32 valid;
Miklos Szeredi06663262005-09-09 13:10:32 -0700325 __u32 padding;
Miklos Szeredibefc6492005-11-07 00:59:52 -0800326 __u64 fh;
327 __u64 size;
Miklos Szeredif3332112007-10-18 03:07:04 -0700328 __u64 lock_owner;
Miklos Szeredibefc6492005-11-07 00:59:52 -0800329 __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 Szeredi9e6268d2005-09-09 13:10:29 -0700340};
341
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700342struct fuse_open_in {
343 __u32 flags;
Miklos Szeredie0a43dd2009-06-30 20:12:23 +0200344 __u32 unused;
345};
346
347struct fuse_create_in {
348 __u32 flags;
Miklos Szeredifd72faa2005-11-07 00:59:51 -0800349 __u32 mode;
Miklos Szeredie0a43dd2009-06-30 20:12:23 +0200350 __u32 umask;
351 __u32 padding;
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700352};
353
354struct fuse_open_out {
355 __u64 fh;
356 __u32 open_flags;
Miklos Szeredi06663262005-09-09 13:10:32 -0700357 __u32 padding;
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700358};
359
360struct fuse_release_in {
361 __u64 fh;
362 __u32 flags;
Miklos Szeredie9168c12006-12-06 20:35:38 -0800363 __u32 release_flags;
364 __u64 lock_owner;
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700365};
366
367struct fuse_flush_in {
368 __u64 fh;
Miklos Szeredie9168c12006-12-06 20:35:38 -0800369 __u32 unused;
Miklos Szeredi06663262005-09-09 13:10:32 -0700370 __u32 padding;
Miklos Szeredi71421252006-06-25 05:48:52 -0700371 __u64 lock_owner;
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700372};
373
374struct fuse_read_in {
375 __u64 fh;
376 __u64 offset;
377 __u32 size;
Miklos Szeredif3332112007-10-18 03:07:04 -0700378 __u32 read_flags;
379 __u64 lock_owner;
Miklos Szeredia6643092007-11-28 16:22:00 -0800380 __u32 flags;
381 __u32 padding;
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700382};
383
Miklos Szeredif3332112007-10-18 03:07:04 -0700384#define FUSE_COMPAT_WRITE_IN_SIZE 24
385
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700386struct fuse_write_in {
387 __u64 fh;
388 __u64 offset;
389 __u32 size;
390 __u32 write_flags;
Miklos Szeredif3332112007-10-18 03:07:04 -0700391 __u64 lock_owner;
Miklos Szeredia6643092007-11-28 16:22:00 -0800392 __u32 flags;
393 __u32 padding;
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700394};
395
396struct fuse_write_out {
397 __u32 size;
Miklos Szeredi06663262005-09-09 13:10:32 -0700398 __u32 padding;
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700399};
400
Miklos Szeredide5f1202006-01-06 00:19:37 -0800401#define FUSE_COMPAT_STATFS_SIZE 48
402
Miklos Szeredie5e55582005-09-09 13:10:28 -0700403struct fuse_statfs_out {
404 struct fuse_kstatfs st;
405};
406
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700407struct fuse_fsync_in {
408 __u64 fh;
409 __u32 fsync_flags;
Miklos Szeredi06663262005-09-09 13:10:32 -0700410 __u32 padding;
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700411};
412
Miklos Szeredi92a87802005-09-09 13:10:31 -0700413struct fuse_setxattr_in {
414 __u32 size;
415 __u32 flags;
416};
417
418struct fuse_getxattr_in {
419 __u32 size;
Miklos Szeredi06663262005-09-09 13:10:32 -0700420 __u32 padding;
Miklos Szeredi92a87802005-09-09 13:10:31 -0700421};
422
423struct fuse_getxattr_out {
424 __u32 size;
Miklos Szeredi06663262005-09-09 13:10:32 -0700425 __u32 padding;
Miklos Szeredi92a87802005-09-09 13:10:31 -0700426};
427
Miklos Szeredi71421252006-06-25 05:48:52 -0700428struct fuse_lk_in {
429 __u64 fh;
430 __u64 owner;
431 struct fuse_file_lock lk;
Miklos Szeredia9ff4f82007-10-18 03:07:02 -0700432 __u32 lk_flags;
433 __u32 padding;
Miklos Szeredi71421252006-06-25 05:48:52 -0700434};
435
436struct fuse_lk_out {
437 struct fuse_file_lock lk;
438};
439
Miklos Szeredi31d40d72005-11-07 00:59:50 -0800440struct fuse_access_in {
441 __u32 mask;
442 __u32 padding;
443};
444
Miklos Szeredi3ec870d2006-01-06 00:19:41 -0800445struct fuse_init_in {
Miklos Szeredi334f4852005-09-09 13:10:27 -0700446 __u32 major;
447 __u32 minor;
Miklos Szeredi9cd68452006-02-01 03:04:40 -0800448 __u32 max_readahead;
449 __u32 flags;
Miklos Szeredi334f4852005-09-09 13:10:27 -0700450};
451
Miklos Szeredi3ec870d2006-01-06 00:19:41 -0800452struct fuse_init_out {
453 __u32 major;
454 __u32 minor;
Miklos Szeredi9cd68452006-02-01 03:04:40 -0800455 __u32 max_readahead;
456 __u32 flags;
Csaba Henk7a6d3c82009-07-01 17:28:41 -0700457 __u16 max_background;
458 __u16 congestion_threshold;
Miklos Szeredi3ec870d2006-01-06 00:19:41 -0800459 __u32 max_write;
460};
461
Tejun Heo151060a2009-04-14 10:54:54 +0900462#define CUSE_INIT_INFO_MAX 4096
463
464struct cuse_init_in {
465 __u32 major;
466 __u32 minor;
467 __u32 unused;
468 __u32 flags;
469};
470
471struct 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 Szeredia4d27e72006-06-25 05:48:54 -0700483struct fuse_interrupt_in {
484 __u64 unique;
485};
486
Miklos Szeredib2d22722006-12-06 20:35:51 -0800487struct fuse_bmap_in {
488 __u64 block;
489 __u32 blocksize;
490 __u32 padding;
491};
492
493struct fuse_bmap_out {
494 __u64 block;
495};
496
Tejun Heo59efec72008-11-26 12:03:55 +0100497struct 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
506struct fuse_ioctl_out {
507 __s32 result;
508 __u32 flags;
509 __u32 in_iovs;
510 __u32 out_iovs;
511};
512
Tejun Heo95668a62008-11-26 12:03:55 +0100513struct fuse_poll_in {
514 __u64 fh;
515 __u64 kh;
516 __u32 flags;
517 __u32 padding;
518};
519
520struct fuse_poll_out {
521 __u32 revents;
522 __u32 padding;
523};
524
525struct fuse_notify_poll_wakeup_out {
526 __u64 kh;
527};
528
Miklos Szeredi334f4852005-09-09 13:10:27 -0700529struct 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 Szeredi06663262005-09-09 13:10:32 -0700537 __u32 padding;
Miklos Szeredi334f4852005-09-09 13:10:27 -0700538};
539
540struct fuse_out_header {
541 __u32 len;
542 __s32 error;
543 __u64 unique;
544};
545
Miklos Szeredie5e55582005-09-09 13:10:28 -0700546struct fuse_dirent {
547 __u64 ino;
548 __u64 off;
549 __u32 namelen;
550 __u32 type;
551 char name[0];
552};
553
Andrew Morton21f3da92007-07-15 23:39:50 -0700554#define FUSE_NAME_OFFSET offsetof(struct fuse_dirent, name)
Miklos Szeredie5e55582005-09-09 13:10:28 -0700555#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 Heo29d434b2008-10-16 16:08:57 +0200558
John Muir3b463ae2009-05-31 11:13:57 -0400559struct fuse_notify_inval_inode_out {
560 __u64 ino;
561 __s64 off;
562 __s64 len;
563};
564
565struct fuse_notify_inval_entry_out {
566 __u64 parent;
567 __u32 namelen;
568 __u32 padding;
569};
570
Tejun Heo29d434b2008-10-16 16:08:57 +0200571#endif /* _LINUX_FUSE_H */