blob: cf11881f4938c98d3fa485fc0db2100594e39bbb [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 Szeredic79e3222007-10-18 03:06:59 -070047 */
Miklos Szeredid8a5ba42005-09-09 13:10:26 -070048
Tejun Heo29d434b2008-10-16 16:08:57 +020049#ifndef _LINUX_FUSE_H
50#define _LINUX_FUSE_H
51
Miklos Szeredi1f55ed02008-12-01 19:14:02 +010052#include <linux/types.h>
Miklos Szeredid8a5ba42005-09-09 13:10:26 -070053
Miklos Szeredi37d217f2009-07-08 18:17:58 +020054/*
55 * Version negotiation:
56 *
57 * Both the kernel and userspace send the version they support in the
58 * INIT request and reply respectively.
59 *
60 * If the major versions match then both shall use the smallest
61 * of the two minor versions for communication.
62 *
63 * If the kernel supports a larger major version, then userspace shall
64 * reply with the major version it supports, ignore the rest of the
65 * INIT message and expect a new INIT message from the kernel with a
66 * matching major version.
67 *
68 * If the library supports a larger major version, then it shall fall
69 * back to the major protocol version sent by the kernel for
70 * communication and reply with that major version (and an arbitrary
71 * supported minor version).
72 */
73
Miklos Szeredid8a5ba42005-09-09 13:10:26 -070074/** Version number of this interface */
Miklos Szeredi9e6268d2005-09-09 13:10:29 -070075#define FUSE_KERNEL_VERSION 7
Miklos Szeredid8a5ba42005-09-09 13:10:26 -070076
77/** Minor version number of this interface */
Miklos Szeredi02c048b2010-12-07 20:16:56 +010078#define FUSE_KERNEL_MINOR_VERSION 16
Miklos Szeredid8a5ba42005-09-09 13:10:26 -070079
80/** The node ID of the root inode */
81#define FUSE_ROOT_ID 1
82
Miklos Szeredi06663262005-09-09 13:10:32 -070083/* Make sure all structures are padded to 64bit boundary, so 32bit
84 userspace works under 64bit kernels */
85
Miklos Szeredid8a5ba42005-09-09 13:10:26 -070086struct fuse_attr {
87 __u64 ino;
88 __u64 size;
89 __u64 blocks;
90 __u64 atime;
91 __u64 mtime;
92 __u64 ctime;
93 __u32 atimensec;
94 __u32 mtimensec;
95 __u32 ctimensec;
96 __u32 mode;
97 __u32 nlink;
98 __u32 uid;
99 __u32 gid;
100 __u32 rdev;
Miklos Szeredi0e9663e2007-10-18 03:07:05 -0700101 __u32 blksize;
102 __u32 padding;
Miklos Szeredid8a5ba42005-09-09 13:10:26 -0700103};
104
Miklos Szeredie5e55582005-09-09 13:10:28 -0700105struct fuse_kstatfs {
106 __u64 blocks;
107 __u64 bfree;
108 __u64 bavail;
109 __u64 files;
110 __u64 ffree;
111 __u32 bsize;
112 __u32 namelen;
Miklos Szeredide5f1202006-01-06 00:19:37 -0800113 __u32 frsize;
114 __u32 padding;
115 __u32 spare[6];
Miklos Szeredie5e55582005-09-09 13:10:28 -0700116};
117
Miklos Szeredi71421252006-06-25 05:48:52 -0700118struct fuse_file_lock {
119 __u64 start;
120 __u64 end;
121 __u32 type;
122 __u32 pid; /* tgid */
123};
124
Miklos Szeredi9cd68452006-02-01 03:04:40 -0800125/**
126 * Bitmasks for fuse_setattr_in.valid
127 */
Miklos Szeredi9e6268d2005-09-09 13:10:29 -0700128#define FATTR_MODE (1 << 0)
129#define FATTR_UID (1 << 1)
130#define FATTR_GID (1 << 2)
131#define FATTR_SIZE (1 << 3)
132#define FATTR_ATIME (1 << 4)
133#define FATTR_MTIME (1 << 5)
Miklos Szeredibefc6492005-11-07 00:59:52 -0800134#define FATTR_FH (1 << 6)
Miklos Szeredi17637cba2007-10-18 03:07:01 -0700135#define FATTR_ATIME_NOW (1 << 7)
136#define FATTR_MTIME_NOW (1 << 8)
Miklos Szeredif3332112007-10-18 03:07:04 -0700137#define FATTR_LOCKOWNER (1 << 9)
Miklos Szeredi9e6268d2005-09-09 13:10:29 -0700138
Miklos Szeredi45323fb2005-09-09 13:10:37 -0700139/**
140 * Flags returned by the OPEN request
141 *
142 * FOPEN_DIRECT_IO: bypass page cache for this open file
143 * FOPEN_KEEP_CACHE: don't invalidate the data cache on open
Tejun Heoa7c1b992008-10-16 16:08:57 +0200144 * FOPEN_NONSEEKABLE: the file is not seekable
Miklos Szeredi45323fb2005-09-09 13:10:37 -0700145 */
146#define FOPEN_DIRECT_IO (1 << 0)
147#define FOPEN_KEEP_CACHE (1 << 1)
Tejun Heoa7c1b992008-10-16 16:08:57 +0200148#define FOPEN_NONSEEKABLE (1 << 2)
Miklos Szeredi45323fb2005-09-09 13:10:37 -0700149
Miklos Szeredi9cd68452006-02-01 03:04:40 -0800150/**
151 * INIT request/reply flags
Miklos Szeredi33670fa2008-07-25 01:49:02 -0700152 *
153 * FUSE_EXPORT_SUPPORT: filesystem handles lookups of "." and ".."
Miklos Szeredie0a43dd2009-06-30 20:12:23 +0200154 * FUSE_DONT_MASK: don't apply umask to file mode on create operations
Miklos Szeredi9cd68452006-02-01 03:04:40 -0800155 */
156#define FUSE_ASYNC_READ (1 << 0)
Miklos Szeredi71421252006-06-25 05:48:52 -0700157#define FUSE_POSIX_LOCKS (1 << 1)
Miklos Szeredic79e3222007-10-18 03:06:59 -0700158#define FUSE_FILE_OPS (1 << 2)
Miklos Szeredi6ff958e2007-10-18 03:07:02 -0700159#define FUSE_ATOMIC_O_TRUNC (1 << 3)
Miklos Szeredi33670fa2008-07-25 01:49:02 -0700160#define FUSE_EXPORT_SUPPORT (1 << 4)
Miklos Szeredi78bb6cb2008-05-12 14:02:32 -0700161#define FUSE_BIG_WRITES (1 << 5)
Miklos Szeredie0a43dd2009-06-30 20:12:23 +0200162#define FUSE_DONT_MASK (1 << 6)
Miklos Szeredi9cd68452006-02-01 03:04:40 -0800163
Miklos Szeredie9168c12006-12-06 20:35:38 -0800164/**
Tejun Heo151060a2009-04-14 10:54:54 +0900165 * CUSE INIT request/reply flags
166 *
167 * CUSE_UNRESTRICTED_IOCTL: use unrestricted ioctl
168 */
169#define CUSE_UNRESTRICTED_IOCTL (1 << 0)
170
171/**
Miklos Szeredie9168c12006-12-06 20:35:38 -0800172 * Release flags
173 */
174#define FUSE_RELEASE_FLUSH (1 << 0)
175
Miklos Szeredic79e3222007-10-18 03:06:59 -0700176/**
177 * Getattr flags
178 */
179#define FUSE_GETATTR_FH (1 << 0)
180
Miklos Szeredia9ff4f82007-10-18 03:07:02 -0700181/**
182 * Lock flags
183 */
184#define FUSE_LK_FLOCK (1 << 0)
185
Miklos Szeredib25e82e2007-10-18 03:07:03 -0700186/**
187 * WRITE flags
188 *
189 * FUSE_WRITE_CACHE: delayed write from page cache, file handle is guessed
Miklos Szeredif3332112007-10-18 03:07:04 -0700190 * FUSE_WRITE_LOCKOWNER: lock_owner field is valid
Miklos Szeredib25e82e2007-10-18 03:07:03 -0700191 */
192#define FUSE_WRITE_CACHE (1 << 0)
Miklos Szeredif3332112007-10-18 03:07:04 -0700193#define FUSE_WRITE_LOCKOWNER (1 << 1)
194
195/**
196 * Read flags
197 */
198#define FUSE_READ_LOCKOWNER (1 << 1)
Miklos Szeredib25e82e2007-10-18 03:07:03 -0700199
Tejun Heo59efec72008-11-26 12:03:55 +0100200/**
201 * Ioctl flags
202 *
203 * FUSE_IOCTL_COMPAT: 32bit compat ioctl on 64bit machine
204 * FUSE_IOCTL_UNRESTRICTED: not restricted to well-formed ioctls, retry allowed
205 * FUSE_IOCTL_RETRY: retry with new iovecs
206 *
207 * FUSE_IOCTL_MAX_IOV: maximum of in_iovecs + out_iovecs
208 */
209#define FUSE_IOCTL_COMPAT (1 << 0)
210#define FUSE_IOCTL_UNRESTRICTED (1 << 1)
211#define FUSE_IOCTL_RETRY (1 << 2)
212
213#define FUSE_IOCTL_MAX_IOV 256
214
Tejun Heo95668a62008-11-26 12:03:55 +0100215/**
216 * Poll flags
217 *
218 * FUSE_POLL_SCHEDULE_NOTIFY: request poll notify
219 */
220#define FUSE_POLL_SCHEDULE_NOTIFY (1 << 0)
221
Miklos Szeredi334f4852005-09-09 13:10:27 -0700222enum fuse_opcode {
Miklos Szeredie5e55582005-09-09 13:10:28 -0700223 FUSE_LOOKUP = 1,
224 FUSE_FORGET = 2, /* no reply */
225 FUSE_GETATTR = 3,
Miklos Szeredi9e6268d2005-09-09 13:10:29 -0700226 FUSE_SETATTR = 4,
Miklos Szeredie5e55582005-09-09 13:10:28 -0700227 FUSE_READLINK = 5,
Miklos Szeredi9e6268d2005-09-09 13:10:29 -0700228 FUSE_SYMLINK = 6,
Miklos Szeredi9e6268d2005-09-09 13:10:29 -0700229 FUSE_MKNOD = 8,
230 FUSE_MKDIR = 9,
231 FUSE_UNLINK = 10,
232 FUSE_RMDIR = 11,
233 FUSE_RENAME = 12,
234 FUSE_LINK = 13,
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700235 FUSE_OPEN = 14,
236 FUSE_READ = 15,
237 FUSE_WRITE = 16,
Miklos Szeredie5e55582005-09-09 13:10:28 -0700238 FUSE_STATFS = 17,
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700239 FUSE_RELEASE = 18,
240 FUSE_FSYNC = 20,
Miklos Szeredi92a87802005-09-09 13:10:31 -0700241 FUSE_SETXATTR = 21,
242 FUSE_GETXATTR = 22,
243 FUSE_LISTXATTR = 23,
244 FUSE_REMOVEXATTR = 24,
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700245 FUSE_FLUSH = 25,
Miklos Szeredi04730fe2005-09-09 13:10:36 -0700246 FUSE_INIT = 26,
247 FUSE_OPENDIR = 27,
248 FUSE_READDIR = 28,
Miklos Szeredi82547982005-09-09 13:10:38 -0700249 FUSE_RELEASEDIR = 29,
Miklos Szeredi31d40d72005-11-07 00:59:50 -0800250 FUSE_FSYNCDIR = 30,
Miklos Szeredi71421252006-06-25 05:48:52 -0700251 FUSE_GETLK = 31,
252 FUSE_SETLK = 32,
253 FUSE_SETLKW = 33,
Miklos Szeredifd72faa2005-11-07 00:59:51 -0800254 FUSE_ACCESS = 34,
Miklos Szeredia4d27e72006-06-25 05:48:54 -0700255 FUSE_CREATE = 35,
256 FUSE_INTERRUPT = 36,
Miklos Szeredib2d22722006-12-06 20:35:51 -0800257 FUSE_BMAP = 37,
Miklos Szeredi0ec7ca42006-12-06 20:35:52 -0800258 FUSE_DESTROY = 38,
Tejun Heo59efec72008-11-26 12:03:55 +0100259 FUSE_IOCTL = 39,
Tejun Heo95668a62008-11-26 12:03:55 +0100260 FUSE_POLL = 40,
Miklos Szeredi2d45ba32010-07-12 14:41:40 +0200261 FUSE_NOTIFY_REPLY = 41,
Miklos Szeredi02c048b2010-12-07 20:16:56 +0100262 FUSE_BATCH_FORGET = 42,
Tejun Heo151060a2009-04-14 10:54:54 +0900263
264 /* CUSE specific operations */
265 CUSE_INIT = 4096,
Miklos Szeredi334f4852005-09-09 13:10:27 -0700266};
267
Tejun Heo85993962008-11-26 12:03:55 +0100268enum fuse_notify_code {
Tejun Heo95668a62008-11-26 12:03:55 +0100269 FUSE_NOTIFY_POLL = 1,
John Muir3b463ae2009-05-31 11:13:57 -0400270 FUSE_NOTIFY_INVAL_INODE = 2,
271 FUSE_NOTIFY_INVAL_ENTRY = 3,
Miklos Szeredia1d75f22010-07-12 14:41:40 +0200272 FUSE_NOTIFY_STORE = 4,
Miklos Szeredi2d45ba32010-07-12 14:41:40 +0200273 FUSE_NOTIFY_RETRIEVE = 5,
Tejun Heo85993962008-11-26 12:03:55 +0100274 FUSE_NOTIFY_CODE_MAX,
275};
276
Miklos Szeredi1d3d7522006-01-06 00:19:40 -0800277/* The read buffer is required to be at least 8k, but may be much larger */
278#define FUSE_MIN_READ_BUFFER 8192
Miklos Szeredie5e55582005-09-09 13:10:28 -0700279
Miklos Szeredi0e9663e2007-10-18 03:07:05 -0700280#define FUSE_COMPAT_ENTRY_OUT_SIZE 120
281
Miklos Szeredie5e55582005-09-09 13:10:28 -0700282struct fuse_entry_out {
283 __u64 nodeid; /* Inode ID */
284 __u64 generation; /* Inode generation: nodeid:gen must
285 be unique for the fs's lifetime */
286 __u64 entry_valid; /* Cache timeout for the name */
287 __u64 attr_valid; /* Cache timeout for the attributes */
288 __u32 entry_valid_nsec;
289 __u32 attr_valid_nsec;
290 struct fuse_attr attr;
291};
292
293struct fuse_forget_in {
Miklos Szeredi9e6268d2005-09-09 13:10:29 -0700294 __u64 nlookup;
Miklos Szeredie5e55582005-09-09 13:10:28 -0700295};
296
Miklos Szeredi02c048b2010-12-07 20:16:56 +0100297struct fuse_forget_one {
298 __u64 nodeid;
299 __u64 nlookup;
300};
301
302struct fuse_batch_forget_in {
303 __u32 count;
304 __u32 dummy;
305};
306
Miklos Szeredic79e3222007-10-18 03:06:59 -0700307struct fuse_getattr_in {
308 __u32 getattr_flags;
309 __u32 dummy;
310 __u64 fh;
311};
312
Miklos Szeredi0e9663e2007-10-18 03:07:05 -0700313#define FUSE_COMPAT_ATTR_OUT_SIZE 96
314
Miklos Szeredie5e55582005-09-09 13:10:28 -0700315struct fuse_attr_out {
316 __u64 attr_valid; /* Cache timeout for the attributes */
317 __u32 attr_valid_nsec;
318 __u32 dummy;
319 struct fuse_attr attr;
320};
321
Miklos Szeredie0a43dd2009-06-30 20:12:23 +0200322#define FUSE_COMPAT_MKNOD_IN_SIZE 8
323
Miklos Szeredi9e6268d2005-09-09 13:10:29 -0700324struct fuse_mknod_in {
325 __u32 mode;
326 __u32 rdev;
Miklos Szeredie0a43dd2009-06-30 20:12:23 +0200327 __u32 umask;
328 __u32 padding;
Miklos Szeredi9e6268d2005-09-09 13:10:29 -0700329};
330
331struct fuse_mkdir_in {
332 __u32 mode;
Miklos Szeredie0a43dd2009-06-30 20:12:23 +0200333 __u32 umask;
Miklos Szeredi9e6268d2005-09-09 13:10:29 -0700334};
335
336struct fuse_rename_in {
337 __u64 newdir;
338};
339
340struct fuse_link_in {
341 __u64 oldnodeid;
342};
343
344struct fuse_setattr_in {
345 __u32 valid;
Miklos Szeredi06663262005-09-09 13:10:32 -0700346 __u32 padding;
Miklos Szeredibefc6492005-11-07 00:59:52 -0800347 __u64 fh;
348 __u64 size;
Miklos Szeredif3332112007-10-18 03:07:04 -0700349 __u64 lock_owner;
Miklos Szeredibefc6492005-11-07 00:59:52 -0800350 __u64 atime;
351 __u64 mtime;
352 __u64 unused2;
353 __u32 atimensec;
354 __u32 mtimensec;
355 __u32 unused3;
356 __u32 mode;
357 __u32 unused4;
358 __u32 uid;
359 __u32 gid;
360 __u32 unused5;
Miklos Szeredi9e6268d2005-09-09 13:10:29 -0700361};
362
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700363struct fuse_open_in {
364 __u32 flags;
Miklos Szeredie0a43dd2009-06-30 20:12:23 +0200365 __u32 unused;
366};
367
368struct fuse_create_in {
369 __u32 flags;
Miklos Szeredifd72faa2005-11-07 00:59:51 -0800370 __u32 mode;
Miklos Szeredie0a43dd2009-06-30 20:12:23 +0200371 __u32 umask;
372 __u32 padding;
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700373};
374
375struct fuse_open_out {
376 __u64 fh;
377 __u32 open_flags;
Miklos Szeredi06663262005-09-09 13:10:32 -0700378 __u32 padding;
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700379};
380
381struct fuse_release_in {
382 __u64 fh;
383 __u32 flags;
Miklos Szeredie9168c12006-12-06 20:35:38 -0800384 __u32 release_flags;
385 __u64 lock_owner;
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700386};
387
388struct fuse_flush_in {
389 __u64 fh;
Miklos Szeredie9168c12006-12-06 20:35:38 -0800390 __u32 unused;
Miklos Szeredi06663262005-09-09 13:10:32 -0700391 __u32 padding;
Miklos Szeredi71421252006-06-25 05:48:52 -0700392 __u64 lock_owner;
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700393};
394
395struct fuse_read_in {
396 __u64 fh;
397 __u64 offset;
398 __u32 size;
Miklos Szeredif3332112007-10-18 03:07:04 -0700399 __u32 read_flags;
400 __u64 lock_owner;
Miklos Szeredia6643092007-11-28 16:22:00 -0800401 __u32 flags;
402 __u32 padding;
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700403};
404
Miklos Szeredif3332112007-10-18 03:07:04 -0700405#define FUSE_COMPAT_WRITE_IN_SIZE 24
406
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700407struct fuse_write_in {
408 __u64 fh;
409 __u64 offset;
410 __u32 size;
411 __u32 write_flags;
Miklos Szeredif3332112007-10-18 03:07:04 -0700412 __u64 lock_owner;
Miklos Szeredia6643092007-11-28 16:22:00 -0800413 __u32 flags;
414 __u32 padding;
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700415};
416
417struct fuse_write_out {
418 __u32 size;
Miklos Szeredi06663262005-09-09 13:10:32 -0700419 __u32 padding;
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700420};
421
Miklos Szeredide5f1202006-01-06 00:19:37 -0800422#define FUSE_COMPAT_STATFS_SIZE 48
423
Miklos Szeredie5e55582005-09-09 13:10:28 -0700424struct fuse_statfs_out {
425 struct fuse_kstatfs st;
426};
427
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700428struct fuse_fsync_in {
429 __u64 fh;
430 __u32 fsync_flags;
Miklos Szeredi06663262005-09-09 13:10:32 -0700431 __u32 padding;
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700432};
433
Miklos Szeredi92a87802005-09-09 13:10:31 -0700434struct fuse_setxattr_in {
435 __u32 size;
436 __u32 flags;
437};
438
439struct fuse_getxattr_in {
440 __u32 size;
Miklos Szeredi06663262005-09-09 13:10:32 -0700441 __u32 padding;
Miklos Szeredi92a87802005-09-09 13:10:31 -0700442};
443
444struct fuse_getxattr_out {
445 __u32 size;
Miklos Szeredi06663262005-09-09 13:10:32 -0700446 __u32 padding;
Miklos Szeredi92a87802005-09-09 13:10:31 -0700447};
448
Miklos Szeredi71421252006-06-25 05:48:52 -0700449struct fuse_lk_in {
450 __u64 fh;
451 __u64 owner;
452 struct fuse_file_lock lk;
Miklos Szeredia9ff4f82007-10-18 03:07:02 -0700453 __u32 lk_flags;
454 __u32 padding;
Miklos Szeredi71421252006-06-25 05:48:52 -0700455};
456
457struct fuse_lk_out {
458 struct fuse_file_lock lk;
459};
460
Miklos Szeredi31d40d72005-11-07 00:59:50 -0800461struct fuse_access_in {
462 __u32 mask;
463 __u32 padding;
464};
465
Miklos Szeredi3ec870d2006-01-06 00:19:41 -0800466struct fuse_init_in {
Miklos Szeredi334f4852005-09-09 13:10:27 -0700467 __u32 major;
468 __u32 minor;
Miklos Szeredi9cd68452006-02-01 03:04:40 -0800469 __u32 max_readahead;
470 __u32 flags;
Miklos Szeredi334f4852005-09-09 13:10:27 -0700471};
472
Miklos Szeredi3ec870d2006-01-06 00:19:41 -0800473struct fuse_init_out {
474 __u32 major;
475 __u32 minor;
Miklos Szeredi9cd68452006-02-01 03:04:40 -0800476 __u32 max_readahead;
477 __u32 flags;
Csaba Henk7a6d3c82009-07-01 17:28:41 -0700478 __u16 max_background;
479 __u16 congestion_threshold;
Miklos Szeredi3ec870d2006-01-06 00:19:41 -0800480 __u32 max_write;
481};
482
Tejun Heo151060a2009-04-14 10:54:54 +0900483#define CUSE_INIT_INFO_MAX 4096
484
485struct cuse_init_in {
486 __u32 major;
487 __u32 minor;
488 __u32 unused;
489 __u32 flags;
490};
491
492struct cuse_init_out {
493 __u32 major;
494 __u32 minor;
495 __u32 unused;
496 __u32 flags;
497 __u32 max_read;
498 __u32 max_write;
499 __u32 dev_major; /* chardev major */
500 __u32 dev_minor; /* chardev minor */
501 __u32 spare[10];
502};
503
Miklos Szeredia4d27e72006-06-25 05:48:54 -0700504struct fuse_interrupt_in {
505 __u64 unique;
506};
507
Miklos Szeredib2d22722006-12-06 20:35:51 -0800508struct fuse_bmap_in {
509 __u64 block;
510 __u32 blocksize;
511 __u32 padding;
512};
513
514struct fuse_bmap_out {
515 __u64 block;
516};
517
Tejun Heo59efec72008-11-26 12:03:55 +0100518struct fuse_ioctl_in {
519 __u64 fh;
520 __u32 flags;
521 __u32 cmd;
522 __u64 arg;
523 __u32 in_size;
524 __u32 out_size;
525};
526
527struct fuse_ioctl_out {
528 __s32 result;
529 __u32 flags;
530 __u32 in_iovs;
531 __u32 out_iovs;
532};
533
Tejun Heo95668a62008-11-26 12:03:55 +0100534struct fuse_poll_in {
535 __u64 fh;
536 __u64 kh;
537 __u32 flags;
538 __u32 padding;
539};
540
541struct fuse_poll_out {
542 __u32 revents;
543 __u32 padding;
544};
545
546struct fuse_notify_poll_wakeup_out {
547 __u64 kh;
548};
549
Miklos Szeredi334f4852005-09-09 13:10:27 -0700550struct fuse_in_header {
551 __u32 len;
552 __u32 opcode;
553 __u64 unique;
554 __u64 nodeid;
555 __u32 uid;
556 __u32 gid;
557 __u32 pid;
Miklos Szeredi06663262005-09-09 13:10:32 -0700558 __u32 padding;
Miklos Szeredi334f4852005-09-09 13:10:27 -0700559};
560
561struct fuse_out_header {
562 __u32 len;
563 __s32 error;
564 __u64 unique;
565};
566
Miklos Szeredie5e55582005-09-09 13:10:28 -0700567struct fuse_dirent {
568 __u64 ino;
569 __u64 off;
570 __u32 namelen;
571 __u32 type;
572 char name[0];
573};
574
Andrew Morton21f3da92007-07-15 23:39:50 -0700575#define FUSE_NAME_OFFSET offsetof(struct fuse_dirent, name)
Miklos Szeredie5e55582005-09-09 13:10:28 -0700576#define FUSE_DIRENT_ALIGN(x) (((x) + sizeof(__u64) - 1) & ~(sizeof(__u64) - 1))
577#define FUSE_DIRENT_SIZE(d) \
578 FUSE_DIRENT_ALIGN(FUSE_NAME_OFFSET + (d)->namelen)
Tejun Heo29d434b2008-10-16 16:08:57 +0200579
John Muir3b463ae2009-05-31 11:13:57 -0400580struct fuse_notify_inval_inode_out {
581 __u64 ino;
582 __s64 off;
583 __s64 len;
584};
585
586struct fuse_notify_inval_entry_out {
587 __u64 parent;
588 __u32 namelen;
589 __u32 padding;
590};
591
Miklos Szeredia1d75f22010-07-12 14:41:40 +0200592struct fuse_notify_store_out {
593 __u64 nodeid;
594 __u64 offset;
595 __u32 size;
596 __u32 padding;
597};
598
Miklos Szeredi2d45ba32010-07-12 14:41:40 +0200599struct fuse_notify_retrieve_out {
600 __u64 notify_unique;
601 __u64 nodeid;
602 __u64 offset;
603 __u32 size;
604 __u32 padding;
605};
606
607/* Matches the size of fuse_write_in */
608struct fuse_notify_retrieve_in {
609 __u64 dummy1;
610 __u64 offset;
611 __u32 size;
612 __u32 dummy2;
613 __u64 dummy3;
614 __u64 dummy4;
615};
616
Tejun Heo29d434b2008-10-16 16:08:57 +0200617#endif /* _LINUX_FUSE_H */