blob: 446c89718b9cdb986f80feaba08ab4593d865607 [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
Miklos Szeredic79e3222007-10-18 03:06:59 -070056 */
Miklos Szeredid8a5ba42005-09-09 13:10:26 -070057
Tejun Heo29d434b2008-10-16 16:08:57 +020058#ifndef _LINUX_FUSE_H
59#define _LINUX_FUSE_H
60
Miklos Szeredi1f55ed02008-12-01 19:14:02 +010061#include <linux/types.h>
Miklos Szeredid8a5ba42005-09-09 13:10:26 -070062
Miklos Szeredi37d217f2009-07-08 18:17:58 +020063/*
64 * Version negotiation:
65 *
66 * Both the kernel and userspace send the version they support in the
67 * INIT request and reply respectively.
68 *
69 * If the major versions match then both shall use the smallest
70 * of the two minor versions for communication.
71 *
72 * If the kernel supports a larger major version, then userspace shall
73 * reply with the major version it supports, ignore the rest of the
74 * INIT message and expect a new INIT message from the kernel with a
75 * matching major version.
76 *
77 * If the library supports a larger major version, then it shall fall
78 * back to the major protocol version sent by the kernel for
79 * communication and reply with that major version (and an arbitrary
80 * supported minor version).
81 */
82
Miklos Szeredid8a5ba42005-09-09 13:10:26 -070083/** Version number of this interface */
Miklos Szeredi9e6268d2005-09-09 13:10:29 -070084#define FUSE_KERNEL_VERSION 7
Miklos Szeredid8a5ba42005-09-09 13:10:26 -070085
86/** Minor version number of this interface */
Miklos Szeredib18da0c2011-12-13 11:58:49 +010087#define FUSE_KERNEL_MINOR_VERSION 18
Miklos Szeredid8a5ba42005-09-09 13:10:26 -070088
89/** The node ID of the root inode */
90#define FUSE_ROOT_ID 1
91
Miklos Szeredi06663262005-09-09 13:10:32 -070092/* Make sure all structures are padded to 64bit boundary, so 32bit
93 userspace works under 64bit kernels */
94
Miklos Szeredid8a5ba42005-09-09 13:10:26 -070095struct fuse_attr {
96 __u64 ino;
97 __u64 size;
98 __u64 blocks;
99 __u64 atime;
100 __u64 mtime;
101 __u64 ctime;
102 __u32 atimensec;
103 __u32 mtimensec;
104 __u32 ctimensec;
105 __u32 mode;
106 __u32 nlink;
107 __u32 uid;
108 __u32 gid;
109 __u32 rdev;
Miklos Szeredi0e9663e2007-10-18 03:07:05 -0700110 __u32 blksize;
111 __u32 padding;
Miklos Szeredid8a5ba42005-09-09 13:10:26 -0700112};
113
Miklos Szeredie5e55582005-09-09 13:10:28 -0700114struct fuse_kstatfs {
115 __u64 blocks;
116 __u64 bfree;
117 __u64 bavail;
118 __u64 files;
119 __u64 ffree;
120 __u32 bsize;
121 __u32 namelen;
Miklos Szeredide5f1202006-01-06 00:19:37 -0800122 __u32 frsize;
123 __u32 padding;
124 __u32 spare[6];
Miklos Szeredie5e55582005-09-09 13:10:28 -0700125};
126
Miklos Szeredi71421252006-06-25 05:48:52 -0700127struct fuse_file_lock {
128 __u64 start;
129 __u64 end;
130 __u32 type;
131 __u32 pid; /* tgid */
132};
133
Miklos Szeredi9cd68452006-02-01 03:04:40 -0800134/**
135 * Bitmasks for fuse_setattr_in.valid
136 */
Miklos Szeredi9e6268d2005-09-09 13:10:29 -0700137#define FATTR_MODE (1 << 0)
138#define FATTR_UID (1 << 1)
139#define FATTR_GID (1 << 2)
140#define FATTR_SIZE (1 << 3)
141#define FATTR_ATIME (1 << 4)
142#define FATTR_MTIME (1 << 5)
Miklos Szeredibefc6492005-11-07 00:59:52 -0800143#define FATTR_FH (1 << 6)
Miklos Szeredi17637cb2007-10-18 03:07:01 -0700144#define FATTR_ATIME_NOW (1 << 7)
145#define FATTR_MTIME_NOW (1 << 8)
Miklos Szeredif3332112007-10-18 03:07:04 -0700146#define FATTR_LOCKOWNER (1 << 9)
Miklos Szeredi9e6268d2005-09-09 13:10:29 -0700147
Miklos Szeredi45323fb2005-09-09 13:10:37 -0700148/**
149 * Flags returned by the OPEN request
150 *
151 * FOPEN_DIRECT_IO: bypass page cache for this open file
152 * FOPEN_KEEP_CACHE: don't invalidate the data cache on open
Tejun Heoa7c1b992008-10-16 16:08:57 +0200153 * FOPEN_NONSEEKABLE: the file is not seekable
Miklos Szeredi45323fb2005-09-09 13:10:37 -0700154 */
155#define FOPEN_DIRECT_IO (1 << 0)
156#define FOPEN_KEEP_CACHE (1 << 1)
Tejun Heoa7c1b992008-10-16 16:08:57 +0200157#define FOPEN_NONSEEKABLE (1 << 2)
Miklos Szeredi45323fb2005-09-09 13:10:37 -0700158
Miklos Szeredi9cd68452006-02-01 03:04:40 -0800159/**
160 * INIT request/reply flags
Miklos Szeredi33670fa2008-07-25 01:49:02 -0700161 *
Miklos Szeredi37fb3a32011-08-08 16:08:08 +0200162 * FUSE_POSIX_LOCKS: remote locking for POSIX file locks
Miklos Szeredi33670fa2008-07-25 01:49:02 -0700163 * FUSE_EXPORT_SUPPORT: filesystem handles lookups of "." and ".."
Miklos Szeredie0a43dd2009-06-30 20:12:23 +0200164 * FUSE_DONT_MASK: don't apply umask to file mode on create operations
Miklos Szeredi37fb3a32011-08-08 16:08:08 +0200165 * FUSE_FLOCK_LOCKS: remote locking for BSD style file locks
Miklos Szeredi9cd68452006-02-01 03:04:40 -0800166 */
167#define FUSE_ASYNC_READ (1 << 0)
Miklos Szeredi71421252006-06-25 05:48:52 -0700168#define FUSE_POSIX_LOCKS (1 << 1)
Miklos Szeredic79e3222007-10-18 03:06:59 -0700169#define FUSE_FILE_OPS (1 << 2)
Miklos Szeredi6ff958e2007-10-18 03:07:02 -0700170#define FUSE_ATOMIC_O_TRUNC (1 << 3)
Miklos Szeredi33670fa2008-07-25 01:49:02 -0700171#define FUSE_EXPORT_SUPPORT (1 << 4)
Miklos Szeredi78bb6cb2008-05-12 14:02:32 -0700172#define FUSE_BIG_WRITES (1 << 5)
Miklos Szeredie0a43dd2009-06-30 20:12:23 +0200173#define FUSE_DONT_MASK (1 << 6)
Miklos Szeredi37fb3a32011-08-08 16:08:08 +0200174#define FUSE_FLOCK_LOCKS (1 << 10)
Miklos Szeredi9cd68452006-02-01 03:04:40 -0800175
Miklos Szeredie9168c12006-12-06 20:35:38 -0800176/**
Tejun Heo151060a2009-04-14 10:54:54 +0900177 * CUSE INIT request/reply flags
178 *
179 * CUSE_UNRESTRICTED_IOCTL: use unrestricted ioctl
180 */
181#define CUSE_UNRESTRICTED_IOCTL (1 << 0)
182
183/**
Miklos Szeredie9168c12006-12-06 20:35:38 -0800184 * Release flags
185 */
186#define FUSE_RELEASE_FLUSH (1 << 0)
Miklos Szeredi37fb3a32011-08-08 16:08:08 +0200187#define FUSE_RELEASE_FLOCK_UNLOCK (1 << 1)
Miklos Szeredie9168c12006-12-06 20:35:38 -0800188
Miklos Szeredic79e3222007-10-18 03:06:59 -0700189/**
190 * Getattr flags
191 */
192#define FUSE_GETATTR_FH (1 << 0)
193
Miklos Szeredia9ff4f82007-10-18 03:07:02 -0700194/**
195 * Lock flags
196 */
197#define FUSE_LK_FLOCK (1 << 0)
198
Miklos Szeredib25e82e2007-10-18 03:07:03 -0700199/**
200 * WRITE flags
201 *
202 * FUSE_WRITE_CACHE: delayed write from page cache, file handle is guessed
Miklos Szeredif3332112007-10-18 03:07:04 -0700203 * FUSE_WRITE_LOCKOWNER: lock_owner field is valid
Miklos Szeredib25e82e2007-10-18 03:07:03 -0700204 */
205#define FUSE_WRITE_CACHE (1 << 0)
Miklos Szeredif3332112007-10-18 03:07:04 -0700206#define FUSE_WRITE_LOCKOWNER (1 << 1)
207
208/**
209 * Read flags
210 */
211#define FUSE_READ_LOCKOWNER (1 << 1)
Miklos Szeredib25e82e2007-10-18 03:07:03 -0700212
Tejun Heo59efec72008-11-26 12:03:55 +0100213/**
214 * Ioctl flags
215 *
216 * FUSE_IOCTL_COMPAT: 32bit compat ioctl on 64bit machine
217 * FUSE_IOCTL_UNRESTRICTED: not restricted to well-formed ioctls, retry allowed
218 * FUSE_IOCTL_RETRY: retry with new iovecs
Miklos Szeredi1baa26b2010-12-07 20:16:56 +0100219 * FUSE_IOCTL_32BIT: 32bit ioctl
Miklos Szeredib18da0c2011-12-13 11:58:49 +0100220 * FUSE_IOCTL_DIR: is a directory
Tejun Heo59efec72008-11-26 12:03:55 +0100221 *
222 * FUSE_IOCTL_MAX_IOV: maximum of in_iovecs + out_iovecs
223 */
224#define FUSE_IOCTL_COMPAT (1 << 0)
225#define FUSE_IOCTL_UNRESTRICTED (1 << 1)
226#define FUSE_IOCTL_RETRY (1 << 2)
Miklos Szeredi1baa26b2010-12-07 20:16:56 +0100227#define FUSE_IOCTL_32BIT (1 << 3)
Miklos Szeredib18da0c2011-12-13 11:58:49 +0100228#define FUSE_IOCTL_DIR (1 << 4)
Tejun Heo59efec72008-11-26 12:03:55 +0100229
230#define FUSE_IOCTL_MAX_IOV 256
231
Tejun Heo95668a62008-11-26 12:03:55 +0100232/**
233 * Poll flags
234 *
235 * FUSE_POLL_SCHEDULE_NOTIFY: request poll notify
236 */
237#define FUSE_POLL_SCHEDULE_NOTIFY (1 << 0)
238
Miklos Szeredi334f4852005-09-09 13:10:27 -0700239enum fuse_opcode {
Miklos Szeredie5e55582005-09-09 13:10:28 -0700240 FUSE_LOOKUP = 1,
241 FUSE_FORGET = 2, /* no reply */
242 FUSE_GETATTR = 3,
Miklos Szeredi9e6268d2005-09-09 13:10:29 -0700243 FUSE_SETATTR = 4,
Miklos Szeredie5e55582005-09-09 13:10:28 -0700244 FUSE_READLINK = 5,
Miklos Szeredi9e6268d2005-09-09 13:10:29 -0700245 FUSE_SYMLINK = 6,
Miklos Szeredi9e6268d2005-09-09 13:10:29 -0700246 FUSE_MKNOD = 8,
247 FUSE_MKDIR = 9,
248 FUSE_UNLINK = 10,
249 FUSE_RMDIR = 11,
250 FUSE_RENAME = 12,
251 FUSE_LINK = 13,
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700252 FUSE_OPEN = 14,
253 FUSE_READ = 15,
254 FUSE_WRITE = 16,
Miklos Szeredie5e55582005-09-09 13:10:28 -0700255 FUSE_STATFS = 17,
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700256 FUSE_RELEASE = 18,
257 FUSE_FSYNC = 20,
Miklos Szeredi92a87802005-09-09 13:10:31 -0700258 FUSE_SETXATTR = 21,
259 FUSE_GETXATTR = 22,
260 FUSE_LISTXATTR = 23,
261 FUSE_REMOVEXATTR = 24,
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700262 FUSE_FLUSH = 25,
Miklos Szeredi04730fe2005-09-09 13:10:36 -0700263 FUSE_INIT = 26,
264 FUSE_OPENDIR = 27,
265 FUSE_READDIR = 28,
Miklos Szeredi82547982005-09-09 13:10:38 -0700266 FUSE_RELEASEDIR = 29,
Miklos Szeredi31d40d72005-11-07 00:59:50 -0800267 FUSE_FSYNCDIR = 30,
Miklos Szeredi71421252006-06-25 05:48:52 -0700268 FUSE_GETLK = 31,
269 FUSE_SETLK = 32,
270 FUSE_SETLKW = 33,
Miklos Szeredifd72faa2005-11-07 00:59:51 -0800271 FUSE_ACCESS = 34,
Miklos Szeredia4d27e72006-06-25 05:48:54 -0700272 FUSE_CREATE = 35,
273 FUSE_INTERRUPT = 36,
Miklos Szeredib2d22722006-12-06 20:35:51 -0800274 FUSE_BMAP = 37,
Miklos Szeredi0ec7ca42006-12-06 20:35:52 -0800275 FUSE_DESTROY = 38,
Tejun Heo59efec72008-11-26 12:03:55 +0100276 FUSE_IOCTL = 39,
Tejun Heo95668a62008-11-26 12:03:55 +0100277 FUSE_POLL = 40,
Miklos Szeredi2d45ba32010-07-12 14:41:40 +0200278 FUSE_NOTIFY_REPLY = 41,
Miklos Szeredi02c048b2010-12-07 20:16:56 +0100279 FUSE_BATCH_FORGET = 42,
Tejun Heo151060a2009-04-14 10:54:54 +0900280
281 /* CUSE specific operations */
282 CUSE_INIT = 4096,
Miklos Szeredi334f4852005-09-09 13:10:27 -0700283};
284
Tejun Heo85993962008-11-26 12:03:55 +0100285enum fuse_notify_code {
Tejun Heo95668a62008-11-26 12:03:55 +0100286 FUSE_NOTIFY_POLL = 1,
John Muir3b463ae2009-05-31 11:13:57 -0400287 FUSE_NOTIFY_INVAL_INODE = 2,
288 FUSE_NOTIFY_INVAL_ENTRY = 3,
Miklos Szeredia1d75f22010-07-12 14:41:40 +0200289 FUSE_NOTIFY_STORE = 4,
Miklos Szeredi2d45ba32010-07-12 14:41:40 +0200290 FUSE_NOTIFY_RETRIEVE = 5,
Tejun Heo85993962008-11-26 12:03:55 +0100291 FUSE_NOTIFY_CODE_MAX,
292};
293
Miklos Szeredi1d3d7522006-01-06 00:19:40 -0800294/* The read buffer is required to be at least 8k, but may be much larger */
295#define FUSE_MIN_READ_BUFFER 8192
Miklos Szeredie5e55582005-09-09 13:10:28 -0700296
Miklos Szeredi0e9663e2007-10-18 03:07:05 -0700297#define FUSE_COMPAT_ENTRY_OUT_SIZE 120
298
Miklos Szeredie5e55582005-09-09 13:10:28 -0700299struct fuse_entry_out {
300 __u64 nodeid; /* Inode ID */
301 __u64 generation; /* Inode generation: nodeid:gen must
302 be unique for the fs's lifetime */
303 __u64 entry_valid; /* Cache timeout for the name */
304 __u64 attr_valid; /* Cache timeout for the attributes */
305 __u32 entry_valid_nsec;
306 __u32 attr_valid_nsec;
307 struct fuse_attr attr;
308};
309
310struct fuse_forget_in {
Miklos Szeredi9e6268d2005-09-09 13:10:29 -0700311 __u64 nlookup;
Miklos Szeredie5e55582005-09-09 13:10:28 -0700312};
313
Miklos Szeredi02c048b2010-12-07 20:16:56 +0100314struct fuse_forget_one {
315 __u64 nodeid;
316 __u64 nlookup;
317};
318
319struct fuse_batch_forget_in {
320 __u32 count;
321 __u32 dummy;
322};
323
Miklos Szeredic79e3222007-10-18 03:06:59 -0700324struct fuse_getattr_in {
325 __u32 getattr_flags;
326 __u32 dummy;
327 __u64 fh;
328};
329
Miklos Szeredi0e9663e2007-10-18 03:07:05 -0700330#define FUSE_COMPAT_ATTR_OUT_SIZE 96
331
Miklos Szeredie5e55582005-09-09 13:10:28 -0700332struct fuse_attr_out {
333 __u64 attr_valid; /* Cache timeout for the attributes */
334 __u32 attr_valid_nsec;
335 __u32 dummy;
336 struct fuse_attr attr;
337};
338
Miklos Szeredie0a43dd2009-06-30 20:12:23 +0200339#define FUSE_COMPAT_MKNOD_IN_SIZE 8
340
Miklos Szeredi9e6268d2005-09-09 13:10:29 -0700341struct fuse_mknod_in {
342 __u32 mode;
343 __u32 rdev;
Miklos Szeredie0a43dd2009-06-30 20:12:23 +0200344 __u32 umask;
345 __u32 padding;
Miklos Szeredi9e6268d2005-09-09 13:10:29 -0700346};
347
348struct fuse_mkdir_in {
349 __u32 mode;
Miklos Szeredie0a43dd2009-06-30 20:12:23 +0200350 __u32 umask;
Miklos Szeredi9e6268d2005-09-09 13:10:29 -0700351};
352
353struct fuse_rename_in {
354 __u64 newdir;
355};
356
357struct fuse_link_in {
358 __u64 oldnodeid;
359};
360
361struct fuse_setattr_in {
362 __u32 valid;
Miklos Szeredi06663262005-09-09 13:10:32 -0700363 __u32 padding;
Miklos Szeredibefc6492005-11-07 00:59:52 -0800364 __u64 fh;
365 __u64 size;
Miklos Szeredif3332112007-10-18 03:07:04 -0700366 __u64 lock_owner;
Miklos Szeredibefc6492005-11-07 00:59:52 -0800367 __u64 atime;
368 __u64 mtime;
369 __u64 unused2;
370 __u32 atimensec;
371 __u32 mtimensec;
372 __u32 unused3;
373 __u32 mode;
374 __u32 unused4;
375 __u32 uid;
376 __u32 gid;
377 __u32 unused5;
Miklos Szeredi9e6268d2005-09-09 13:10:29 -0700378};
379
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700380struct fuse_open_in {
381 __u32 flags;
Miklos Szeredie0a43dd2009-06-30 20:12:23 +0200382 __u32 unused;
383};
384
385struct fuse_create_in {
386 __u32 flags;
Miklos Szeredifd72faa2005-11-07 00:59:51 -0800387 __u32 mode;
Miklos Szeredie0a43dd2009-06-30 20:12:23 +0200388 __u32 umask;
389 __u32 padding;
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700390};
391
392struct fuse_open_out {
393 __u64 fh;
394 __u32 open_flags;
Miklos Szeredi06663262005-09-09 13:10:32 -0700395 __u32 padding;
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700396};
397
398struct fuse_release_in {
399 __u64 fh;
400 __u32 flags;
Miklos Szeredie9168c12006-12-06 20:35:38 -0800401 __u32 release_flags;
402 __u64 lock_owner;
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700403};
404
405struct fuse_flush_in {
406 __u64 fh;
Miklos Szeredie9168c12006-12-06 20:35:38 -0800407 __u32 unused;
Miklos Szeredi06663262005-09-09 13:10:32 -0700408 __u32 padding;
Miklos Szeredi71421252006-06-25 05:48:52 -0700409 __u64 lock_owner;
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700410};
411
412struct fuse_read_in {
413 __u64 fh;
414 __u64 offset;
415 __u32 size;
Miklos Szeredif3332112007-10-18 03:07:04 -0700416 __u32 read_flags;
417 __u64 lock_owner;
Miklos Szeredia6643092007-11-28 16:22:00 -0800418 __u32 flags;
419 __u32 padding;
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700420};
421
Miklos Szeredif3332112007-10-18 03:07:04 -0700422#define FUSE_COMPAT_WRITE_IN_SIZE 24
423
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700424struct fuse_write_in {
425 __u64 fh;
426 __u64 offset;
427 __u32 size;
428 __u32 write_flags;
Miklos Szeredif3332112007-10-18 03:07:04 -0700429 __u64 lock_owner;
Miklos Szeredia6643092007-11-28 16:22:00 -0800430 __u32 flags;
431 __u32 padding;
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700432};
433
434struct fuse_write_out {
435 __u32 size;
Miklos Szeredi06663262005-09-09 13:10:32 -0700436 __u32 padding;
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700437};
438
Miklos Szeredide5f1202006-01-06 00:19:37 -0800439#define FUSE_COMPAT_STATFS_SIZE 48
440
Miklos Szeredie5e55582005-09-09 13:10:28 -0700441struct fuse_statfs_out {
442 struct fuse_kstatfs st;
443};
444
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700445struct fuse_fsync_in {
446 __u64 fh;
447 __u32 fsync_flags;
Miklos Szeredi06663262005-09-09 13:10:32 -0700448 __u32 padding;
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700449};
450
Miklos Szeredi92a87802005-09-09 13:10:31 -0700451struct fuse_setxattr_in {
452 __u32 size;
453 __u32 flags;
454};
455
456struct fuse_getxattr_in {
457 __u32 size;
Miklos Szeredi06663262005-09-09 13:10:32 -0700458 __u32 padding;
Miklos Szeredi92a87802005-09-09 13:10:31 -0700459};
460
461struct fuse_getxattr_out {
462 __u32 size;
Miklos Szeredi06663262005-09-09 13:10:32 -0700463 __u32 padding;
Miklos Szeredi92a87802005-09-09 13:10:31 -0700464};
465
Miklos Szeredi71421252006-06-25 05:48:52 -0700466struct fuse_lk_in {
467 __u64 fh;
468 __u64 owner;
469 struct fuse_file_lock lk;
Miklos Szeredia9ff4f82007-10-18 03:07:02 -0700470 __u32 lk_flags;
471 __u32 padding;
Miklos Szeredi71421252006-06-25 05:48:52 -0700472};
473
474struct fuse_lk_out {
475 struct fuse_file_lock lk;
476};
477
Miklos Szeredi31d40d72005-11-07 00:59:50 -0800478struct fuse_access_in {
479 __u32 mask;
480 __u32 padding;
481};
482
Miklos Szeredi3ec870d2006-01-06 00:19:41 -0800483struct fuse_init_in {
Miklos Szeredi334f4852005-09-09 13:10:27 -0700484 __u32 major;
485 __u32 minor;
Miklos Szeredi9cd68452006-02-01 03:04:40 -0800486 __u32 max_readahead;
487 __u32 flags;
Miklos Szeredi334f4852005-09-09 13:10:27 -0700488};
489
Miklos Szeredi3ec870d2006-01-06 00:19:41 -0800490struct fuse_init_out {
491 __u32 major;
492 __u32 minor;
Miklos Szeredi9cd68452006-02-01 03:04:40 -0800493 __u32 max_readahead;
494 __u32 flags;
Csaba Henk7a6d3c82009-07-01 17:28:41 -0700495 __u16 max_background;
496 __u16 congestion_threshold;
Miklos Szeredi3ec870d2006-01-06 00:19:41 -0800497 __u32 max_write;
498};
499
Tejun Heo151060a2009-04-14 10:54:54 +0900500#define CUSE_INIT_INFO_MAX 4096
501
502struct cuse_init_in {
503 __u32 major;
504 __u32 minor;
505 __u32 unused;
506 __u32 flags;
507};
508
509struct cuse_init_out {
510 __u32 major;
511 __u32 minor;
512 __u32 unused;
513 __u32 flags;
514 __u32 max_read;
515 __u32 max_write;
516 __u32 dev_major; /* chardev major */
517 __u32 dev_minor; /* chardev minor */
518 __u32 spare[10];
519};
520
Miklos Szeredia4d27e72006-06-25 05:48:54 -0700521struct fuse_interrupt_in {
522 __u64 unique;
523};
524
Miklos Szeredib2d22722006-12-06 20:35:51 -0800525struct fuse_bmap_in {
526 __u64 block;
527 __u32 blocksize;
528 __u32 padding;
529};
530
531struct fuse_bmap_out {
532 __u64 block;
533};
534
Tejun Heo59efec72008-11-26 12:03:55 +0100535struct fuse_ioctl_in {
536 __u64 fh;
537 __u32 flags;
538 __u32 cmd;
539 __u64 arg;
540 __u32 in_size;
541 __u32 out_size;
542};
543
Miklos Szeredi1baa26b2010-12-07 20:16:56 +0100544struct fuse_ioctl_iovec {
545 __u64 base;
546 __u64 len;
547};
548
Tejun Heo59efec72008-11-26 12:03:55 +0100549struct fuse_ioctl_out {
550 __s32 result;
551 __u32 flags;
552 __u32 in_iovs;
553 __u32 out_iovs;
554};
555
Tejun Heo95668a62008-11-26 12:03:55 +0100556struct fuse_poll_in {
557 __u64 fh;
558 __u64 kh;
559 __u32 flags;
560 __u32 padding;
561};
562
563struct fuse_poll_out {
564 __u32 revents;
565 __u32 padding;
566};
567
568struct fuse_notify_poll_wakeup_out {
569 __u64 kh;
570};
571
Miklos Szeredi334f4852005-09-09 13:10:27 -0700572struct fuse_in_header {
573 __u32 len;
574 __u32 opcode;
575 __u64 unique;
576 __u64 nodeid;
577 __u32 uid;
578 __u32 gid;
579 __u32 pid;
Miklos Szeredi06663262005-09-09 13:10:32 -0700580 __u32 padding;
Miklos Szeredi334f4852005-09-09 13:10:27 -0700581};
582
583struct fuse_out_header {
584 __u32 len;
585 __s32 error;
586 __u64 unique;
587};
588
Miklos Szeredie5e55582005-09-09 13:10:28 -0700589struct fuse_dirent {
590 __u64 ino;
591 __u64 off;
592 __u32 namelen;
593 __u32 type;
594 char name[0];
595};
596
Andrew Morton21f3da92007-07-15 23:39:50 -0700597#define FUSE_NAME_OFFSET offsetof(struct fuse_dirent, name)
Miklos Szeredie5e55582005-09-09 13:10:28 -0700598#define FUSE_DIRENT_ALIGN(x) (((x) + sizeof(__u64) - 1) & ~(sizeof(__u64) - 1))
599#define FUSE_DIRENT_SIZE(d) \
600 FUSE_DIRENT_ALIGN(FUSE_NAME_OFFSET + (d)->namelen)
Tejun Heo29d434b2008-10-16 16:08:57 +0200601
John Muir3b463ae2009-05-31 11:13:57 -0400602struct fuse_notify_inval_inode_out {
603 __u64 ino;
604 __s64 off;
605 __s64 len;
606};
607
608struct fuse_notify_inval_entry_out {
609 __u64 parent;
610 __u32 namelen;
611 __u32 padding;
612};
613
Miklos Szeredia1d75f22010-07-12 14:41:40 +0200614struct fuse_notify_store_out {
615 __u64 nodeid;
616 __u64 offset;
617 __u32 size;
618 __u32 padding;
619};
620
Miklos Szeredi2d45ba32010-07-12 14:41:40 +0200621struct fuse_notify_retrieve_out {
622 __u64 notify_unique;
623 __u64 nodeid;
624 __u64 offset;
625 __u32 size;
626 __u32 padding;
627};
628
629/* Matches the size of fuse_write_in */
630struct fuse_notify_retrieve_in {
631 __u64 dummy1;
632 __u64 offset;
633 __u32 size;
634 __u32 dummy2;
635 __u64 dummy3;
636 __u64 dummy4;
637};
638
Tejun Heo29d434b2008-10-16 16:08:57 +0200639#endif /* _LINUX_FUSE_H */