blob: 3e2925a34bf0e86b09e0be7ac2c9995b3c63c1da [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 Szeredic79e3222007-10-18 03:06:59 -070037 */
Miklos Szeredid8a5ba42005-09-09 13:10:26 -070038
Tejun Heo29d434b2008-10-16 16:08:57 +020039#ifndef _LINUX_FUSE_H
40#define _LINUX_FUSE_H
41
Miklos Szeredi1f55ed02008-12-01 19:14:02 +010042#include <linux/types.h>
Miklos Szeredid8a5ba42005-09-09 13:10:26 -070043
Miklos Szeredi37d217f2009-07-08 18:17:58 +020044/*
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 Szeredid8a5ba42005-09-09 13:10:26 -070064/** Version number of this interface */
Miklos Szeredi9e6268d2005-09-09 13:10:29 -070065#define FUSE_KERNEL_VERSION 7
Miklos Szeredid8a5ba42005-09-09 13:10:26 -070066
67/** Minor version number of this interface */
Csaba Henk7a6d3c82009-07-01 17:28:41 -070068#define FUSE_KERNEL_MINOR_VERSION 13
Miklos Szeredid8a5ba42005-09-09 13:10:26 -070069
70/** The node ID of the root inode */
71#define FUSE_ROOT_ID 1
72
Miklos Szeredi06663262005-09-09 13:10:32 -070073/* Make sure all structures are padded to 64bit boundary, so 32bit
74 userspace works under 64bit kernels */
75
Miklos Szeredid8a5ba42005-09-09 13:10:26 -070076struct 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 Szeredi0e9663e2007-10-18 03:07:05 -070091 __u32 blksize;
92 __u32 padding;
Miklos Szeredid8a5ba42005-09-09 13:10:26 -070093};
94
Miklos Szeredie5e55582005-09-09 13:10:28 -070095struct fuse_kstatfs {
96 __u64 blocks;
97 __u64 bfree;
98 __u64 bavail;
99 __u64 files;
100 __u64 ffree;
101 __u32 bsize;
102 __u32 namelen;
Miklos Szeredide5f1202006-01-06 00:19:37 -0800103 __u32 frsize;
104 __u32 padding;
105 __u32 spare[6];
Miklos Szeredie5e55582005-09-09 13:10:28 -0700106};
107
Miklos Szeredi71421252006-06-25 05:48:52 -0700108struct fuse_file_lock {
109 __u64 start;
110 __u64 end;
111 __u32 type;
112 __u32 pid; /* tgid */
113};
114
Miklos Szeredi9cd68452006-02-01 03:04:40 -0800115/**
116 * Bitmasks for fuse_setattr_in.valid
117 */
Miklos Szeredi9e6268d2005-09-09 13:10:29 -0700118#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 Szeredibefc6492005-11-07 00:59:52 -0800124#define FATTR_FH (1 << 6)
Miklos Szeredi17637cb2007-10-18 03:07:01 -0700125#define FATTR_ATIME_NOW (1 << 7)
126#define FATTR_MTIME_NOW (1 << 8)
Miklos Szeredif3332112007-10-18 03:07:04 -0700127#define FATTR_LOCKOWNER (1 << 9)
Miklos Szeredi9e6268d2005-09-09 13:10:29 -0700128
Miklos Szeredi45323fb2005-09-09 13:10:37 -0700129/**
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 Heoa7c1b992008-10-16 16:08:57 +0200134 * FOPEN_NONSEEKABLE: the file is not seekable
Miklos Szeredi45323fb2005-09-09 13:10:37 -0700135 */
136#define FOPEN_DIRECT_IO (1 << 0)
137#define FOPEN_KEEP_CACHE (1 << 1)
Tejun Heoa7c1b992008-10-16 16:08:57 +0200138#define FOPEN_NONSEEKABLE (1 << 2)
Miklos Szeredi45323fb2005-09-09 13:10:37 -0700139
Miklos Szeredi9cd68452006-02-01 03:04:40 -0800140/**
141 * INIT request/reply flags
Miklos Szeredi33670fa2008-07-25 01:49:02 -0700142 *
143 * FUSE_EXPORT_SUPPORT: filesystem handles lookups of "." and ".."
Miklos Szeredie0a43dd2009-06-30 20:12:23 +0200144 * FUSE_DONT_MASK: don't apply umask to file mode on create operations
Miklos Szeredi9cd68452006-02-01 03:04:40 -0800145 */
146#define FUSE_ASYNC_READ (1 << 0)
Miklos Szeredi71421252006-06-25 05:48:52 -0700147#define FUSE_POSIX_LOCKS (1 << 1)
Miklos Szeredic79e3222007-10-18 03:06:59 -0700148#define FUSE_FILE_OPS (1 << 2)
Miklos Szeredi6ff958e2007-10-18 03:07:02 -0700149#define FUSE_ATOMIC_O_TRUNC (1 << 3)
Miklos Szeredi33670fa2008-07-25 01:49:02 -0700150#define FUSE_EXPORT_SUPPORT (1 << 4)
Miklos Szeredi78bb6cb2008-05-12 14:02:32 -0700151#define FUSE_BIG_WRITES (1 << 5)
Miklos Szeredie0a43dd2009-06-30 20:12:23 +0200152#define FUSE_DONT_MASK (1 << 6)
Miklos Szeredi9cd68452006-02-01 03:04:40 -0800153
Miklos Szeredie9168c12006-12-06 20:35:38 -0800154/**
Tejun Heo151060a2009-04-14 10:54:54 +0900155 * CUSE INIT request/reply flags
156 *
157 * CUSE_UNRESTRICTED_IOCTL: use unrestricted ioctl
158 */
159#define CUSE_UNRESTRICTED_IOCTL (1 << 0)
160
161/**
Miklos Szeredie9168c12006-12-06 20:35:38 -0800162 * Release flags
163 */
164#define FUSE_RELEASE_FLUSH (1 << 0)
165
Miklos Szeredic79e3222007-10-18 03:06:59 -0700166/**
167 * Getattr flags
168 */
169#define FUSE_GETATTR_FH (1 << 0)
170
Miklos Szeredia9ff4f82007-10-18 03:07:02 -0700171/**
172 * Lock flags
173 */
174#define FUSE_LK_FLOCK (1 << 0)
175
Miklos Szeredib25e82e2007-10-18 03:07:03 -0700176/**
177 * WRITE flags
178 *
179 * FUSE_WRITE_CACHE: delayed write from page cache, file handle is guessed
Miklos Szeredif3332112007-10-18 03:07:04 -0700180 * FUSE_WRITE_LOCKOWNER: lock_owner field is valid
Miklos Szeredib25e82e2007-10-18 03:07:03 -0700181 */
182#define FUSE_WRITE_CACHE (1 << 0)
Miklos Szeredif3332112007-10-18 03:07:04 -0700183#define FUSE_WRITE_LOCKOWNER (1 << 1)
184
185/**
186 * Read flags
187 */
188#define FUSE_READ_LOCKOWNER (1 << 1)
Miklos Szeredib25e82e2007-10-18 03:07:03 -0700189
Tejun Heo59efec72008-11-26 12:03:55 +0100190/**
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 Heo95668a62008-11-26 12:03:55 +0100205/**
206 * Poll flags
207 *
208 * FUSE_POLL_SCHEDULE_NOTIFY: request poll notify
209 */
210#define FUSE_POLL_SCHEDULE_NOTIFY (1 << 0)
211
Miklos Szeredi334f4852005-09-09 13:10:27 -0700212enum fuse_opcode {
Miklos Szeredie5e55582005-09-09 13:10:28 -0700213 FUSE_LOOKUP = 1,
214 FUSE_FORGET = 2, /* no reply */
215 FUSE_GETATTR = 3,
Miklos Szeredi9e6268d2005-09-09 13:10:29 -0700216 FUSE_SETATTR = 4,
Miklos Szeredie5e55582005-09-09 13:10:28 -0700217 FUSE_READLINK = 5,
Miklos Szeredi9e6268d2005-09-09 13:10:29 -0700218 FUSE_SYMLINK = 6,
Miklos Szeredi9e6268d2005-09-09 13:10:29 -0700219 FUSE_MKNOD = 8,
220 FUSE_MKDIR = 9,
221 FUSE_UNLINK = 10,
222 FUSE_RMDIR = 11,
223 FUSE_RENAME = 12,
224 FUSE_LINK = 13,
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700225 FUSE_OPEN = 14,
226 FUSE_READ = 15,
227 FUSE_WRITE = 16,
Miklos Szeredie5e55582005-09-09 13:10:28 -0700228 FUSE_STATFS = 17,
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700229 FUSE_RELEASE = 18,
230 FUSE_FSYNC = 20,
Miklos Szeredi92a87802005-09-09 13:10:31 -0700231 FUSE_SETXATTR = 21,
232 FUSE_GETXATTR = 22,
233 FUSE_LISTXATTR = 23,
234 FUSE_REMOVEXATTR = 24,
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700235 FUSE_FLUSH = 25,
Miklos Szeredi04730fe2005-09-09 13:10:36 -0700236 FUSE_INIT = 26,
237 FUSE_OPENDIR = 27,
238 FUSE_READDIR = 28,
Miklos Szeredi82547982005-09-09 13:10:38 -0700239 FUSE_RELEASEDIR = 29,
Miklos Szeredi31d40d72005-11-07 00:59:50 -0800240 FUSE_FSYNCDIR = 30,
Miklos Szeredi71421252006-06-25 05:48:52 -0700241 FUSE_GETLK = 31,
242 FUSE_SETLK = 32,
243 FUSE_SETLKW = 33,
Miklos Szeredifd72faa2005-11-07 00:59:51 -0800244 FUSE_ACCESS = 34,
Miklos Szeredia4d27e72006-06-25 05:48:54 -0700245 FUSE_CREATE = 35,
246 FUSE_INTERRUPT = 36,
Miklos Szeredib2d22722006-12-06 20:35:51 -0800247 FUSE_BMAP = 37,
Miklos Szeredi0ec7ca42006-12-06 20:35:52 -0800248 FUSE_DESTROY = 38,
Tejun Heo59efec72008-11-26 12:03:55 +0100249 FUSE_IOCTL = 39,
Tejun Heo95668a62008-11-26 12:03:55 +0100250 FUSE_POLL = 40,
Tejun Heo151060a2009-04-14 10:54:54 +0900251
252 /* CUSE specific operations */
253 CUSE_INIT = 4096,
Miklos Szeredi334f4852005-09-09 13:10:27 -0700254};
255
Tejun Heo85993962008-11-26 12:03:55 +0100256enum fuse_notify_code {
Tejun Heo95668a62008-11-26 12:03:55 +0100257 FUSE_NOTIFY_POLL = 1,
John Muir3b463ae2009-05-31 11:13:57 -0400258 FUSE_NOTIFY_INVAL_INODE = 2,
259 FUSE_NOTIFY_INVAL_ENTRY = 3,
Tejun Heo85993962008-11-26 12:03:55 +0100260 FUSE_NOTIFY_CODE_MAX,
261};
262
Miklos Szeredi1d3d7522006-01-06 00:19:40 -0800263/* The read buffer is required to be at least 8k, but may be much larger */
264#define FUSE_MIN_READ_BUFFER 8192
Miklos Szeredie5e55582005-09-09 13:10:28 -0700265
Miklos Szeredi0e9663e2007-10-18 03:07:05 -0700266#define FUSE_COMPAT_ENTRY_OUT_SIZE 120
267
Miklos Szeredie5e55582005-09-09 13:10:28 -0700268struct 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
279struct fuse_forget_in {
Miklos Szeredi9e6268d2005-09-09 13:10:29 -0700280 __u64 nlookup;
Miklos Szeredie5e55582005-09-09 13:10:28 -0700281};
282
Miklos Szeredic79e3222007-10-18 03:06:59 -0700283struct fuse_getattr_in {
284 __u32 getattr_flags;
285 __u32 dummy;
286 __u64 fh;
287};
288
Miklos Szeredi0e9663e2007-10-18 03:07:05 -0700289#define FUSE_COMPAT_ATTR_OUT_SIZE 96
290
Miklos Szeredie5e55582005-09-09 13:10:28 -0700291struct 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 Szeredie0a43dd2009-06-30 20:12:23 +0200298#define FUSE_COMPAT_MKNOD_IN_SIZE 8
299
Miklos Szeredi9e6268d2005-09-09 13:10:29 -0700300struct fuse_mknod_in {
301 __u32 mode;
302 __u32 rdev;
Miklos Szeredie0a43dd2009-06-30 20:12:23 +0200303 __u32 umask;
304 __u32 padding;
Miklos Szeredi9e6268d2005-09-09 13:10:29 -0700305};
306
307struct fuse_mkdir_in {
308 __u32 mode;
Miklos Szeredie0a43dd2009-06-30 20:12:23 +0200309 __u32 umask;
Miklos Szeredi9e6268d2005-09-09 13:10:29 -0700310};
311
312struct fuse_rename_in {
313 __u64 newdir;
314};
315
316struct fuse_link_in {
317 __u64 oldnodeid;
318};
319
320struct fuse_setattr_in {
321 __u32 valid;
Miklos Szeredi06663262005-09-09 13:10:32 -0700322 __u32 padding;
Miklos Szeredibefc6492005-11-07 00:59:52 -0800323 __u64 fh;
324 __u64 size;
Miklos Szeredif3332112007-10-18 03:07:04 -0700325 __u64 lock_owner;
Miklos Szeredibefc6492005-11-07 00:59:52 -0800326 __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 Szeredi9e6268d2005-09-09 13:10:29 -0700337};
338
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700339struct fuse_open_in {
340 __u32 flags;
Miklos Szeredie0a43dd2009-06-30 20:12:23 +0200341 __u32 unused;
342};
343
344struct fuse_create_in {
345 __u32 flags;
Miklos Szeredifd72faa2005-11-07 00:59:51 -0800346 __u32 mode;
Miklos Szeredie0a43dd2009-06-30 20:12:23 +0200347 __u32 umask;
348 __u32 padding;
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700349};
350
351struct fuse_open_out {
352 __u64 fh;
353 __u32 open_flags;
Miklos Szeredi06663262005-09-09 13:10:32 -0700354 __u32 padding;
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700355};
356
357struct fuse_release_in {
358 __u64 fh;
359 __u32 flags;
Miklos Szeredie9168c12006-12-06 20:35:38 -0800360 __u32 release_flags;
361 __u64 lock_owner;
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700362};
363
364struct fuse_flush_in {
365 __u64 fh;
Miklos Szeredie9168c12006-12-06 20:35:38 -0800366 __u32 unused;
Miklos Szeredi06663262005-09-09 13:10:32 -0700367 __u32 padding;
Miklos Szeredi71421252006-06-25 05:48:52 -0700368 __u64 lock_owner;
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700369};
370
371struct fuse_read_in {
372 __u64 fh;
373 __u64 offset;
374 __u32 size;
Miklos Szeredif3332112007-10-18 03:07:04 -0700375 __u32 read_flags;
376 __u64 lock_owner;
Miklos Szeredia6643092007-11-28 16:22:00 -0800377 __u32 flags;
378 __u32 padding;
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700379};
380
Miklos Szeredif3332112007-10-18 03:07:04 -0700381#define FUSE_COMPAT_WRITE_IN_SIZE 24
382
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700383struct fuse_write_in {
384 __u64 fh;
385 __u64 offset;
386 __u32 size;
387 __u32 write_flags;
Miklos Szeredif3332112007-10-18 03:07:04 -0700388 __u64 lock_owner;
Miklos Szeredia6643092007-11-28 16:22:00 -0800389 __u32 flags;
390 __u32 padding;
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700391};
392
393struct fuse_write_out {
394 __u32 size;
Miklos Szeredi06663262005-09-09 13:10:32 -0700395 __u32 padding;
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700396};
397
Miklos Szeredide5f1202006-01-06 00:19:37 -0800398#define FUSE_COMPAT_STATFS_SIZE 48
399
Miklos Szeredie5e55582005-09-09 13:10:28 -0700400struct fuse_statfs_out {
401 struct fuse_kstatfs st;
402};
403
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700404struct fuse_fsync_in {
405 __u64 fh;
406 __u32 fsync_flags;
Miklos Szeredi06663262005-09-09 13:10:32 -0700407 __u32 padding;
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700408};
409
Miklos Szeredi92a87802005-09-09 13:10:31 -0700410struct fuse_setxattr_in {
411 __u32 size;
412 __u32 flags;
413};
414
415struct fuse_getxattr_in {
416 __u32 size;
Miklos Szeredi06663262005-09-09 13:10:32 -0700417 __u32 padding;
Miklos Szeredi92a87802005-09-09 13:10:31 -0700418};
419
420struct fuse_getxattr_out {
421 __u32 size;
Miklos Szeredi06663262005-09-09 13:10:32 -0700422 __u32 padding;
Miklos Szeredi92a87802005-09-09 13:10:31 -0700423};
424
Miklos Szeredi71421252006-06-25 05:48:52 -0700425struct fuse_lk_in {
426 __u64 fh;
427 __u64 owner;
428 struct fuse_file_lock lk;
Miklos Szeredia9ff4f82007-10-18 03:07:02 -0700429 __u32 lk_flags;
430 __u32 padding;
Miklos Szeredi71421252006-06-25 05:48:52 -0700431};
432
433struct fuse_lk_out {
434 struct fuse_file_lock lk;
435};
436
Miklos Szeredi31d40d72005-11-07 00:59:50 -0800437struct fuse_access_in {
438 __u32 mask;
439 __u32 padding;
440};
441
Miklos Szeredi3ec870d2006-01-06 00:19:41 -0800442struct fuse_init_in {
Miklos Szeredi334f4852005-09-09 13:10:27 -0700443 __u32 major;
444 __u32 minor;
Miklos Szeredi9cd68452006-02-01 03:04:40 -0800445 __u32 max_readahead;
446 __u32 flags;
Miklos Szeredi334f4852005-09-09 13:10:27 -0700447};
448
Miklos Szeredi3ec870d2006-01-06 00:19:41 -0800449struct fuse_init_out {
450 __u32 major;
451 __u32 minor;
Miklos Szeredi9cd68452006-02-01 03:04:40 -0800452 __u32 max_readahead;
453 __u32 flags;
Csaba Henk7a6d3c82009-07-01 17:28:41 -0700454 __u16 max_background;
455 __u16 congestion_threshold;
Miklos Szeredi3ec870d2006-01-06 00:19:41 -0800456 __u32 max_write;
457};
458
Tejun Heo151060a2009-04-14 10:54:54 +0900459#define CUSE_INIT_INFO_MAX 4096
460
461struct cuse_init_in {
462 __u32 major;
463 __u32 minor;
464 __u32 unused;
465 __u32 flags;
466};
467
468struct 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 Szeredia4d27e72006-06-25 05:48:54 -0700480struct fuse_interrupt_in {
481 __u64 unique;
482};
483
Miklos Szeredib2d22722006-12-06 20:35:51 -0800484struct fuse_bmap_in {
485 __u64 block;
486 __u32 blocksize;
487 __u32 padding;
488};
489
490struct fuse_bmap_out {
491 __u64 block;
492};
493
Tejun Heo59efec72008-11-26 12:03:55 +0100494struct 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
503struct fuse_ioctl_out {
504 __s32 result;
505 __u32 flags;
506 __u32 in_iovs;
507 __u32 out_iovs;
508};
509
Tejun Heo95668a62008-11-26 12:03:55 +0100510struct fuse_poll_in {
511 __u64 fh;
512 __u64 kh;
513 __u32 flags;
514 __u32 padding;
515};
516
517struct fuse_poll_out {
518 __u32 revents;
519 __u32 padding;
520};
521
522struct fuse_notify_poll_wakeup_out {
523 __u64 kh;
524};
525
Miklos Szeredi334f4852005-09-09 13:10:27 -0700526struct 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 Szeredi06663262005-09-09 13:10:32 -0700534 __u32 padding;
Miklos Szeredi334f4852005-09-09 13:10:27 -0700535};
536
537struct fuse_out_header {
538 __u32 len;
539 __s32 error;
540 __u64 unique;
541};
542
Miklos Szeredie5e55582005-09-09 13:10:28 -0700543struct fuse_dirent {
544 __u64 ino;
545 __u64 off;
546 __u32 namelen;
547 __u32 type;
548 char name[0];
549};
550
Andrew Morton21f3da92007-07-15 23:39:50 -0700551#define FUSE_NAME_OFFSET offsetof(struct fuse_dirent, name)
Miklos Szeredie5e55582005-09-09 13:10:28 -0700552#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 Heo29d434b2008-10-16 16:08:57 +0200555
John Muir3b463ae2009-05-31 11:13:57 -0400556struct fuse_notify_inval_inode_out {
557 __u64 ino;
558 __s64 off;
559 __s64 len;
560};
561
562struct fuse_notify_inval_entry_out {
563 __u64 parent;
564 __u32 namelen;
565 __u32 padding;
566};
567
Tejun Heo29d434b2008-10-16 16:08:57 +0200568#endif /* _LINUX_FUSE_H */