blob: d464de53db4399c598ec3793f75290856b049255 [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 Szeredic79e3222007-10-18 03:06:59 -070050 */
Miklos Szeredid8a5ba42005-09-09 13:10:26 -070051
Tejun Heo29d434b2008-10-16 16:08:57 +020052#ifndef _LINUX_FUSE_H
53#define _LINUX_FUSE_H
54
Miklos Szeredi1f55ed02008-12-01 19:14:02 +010055#include <linux/types.h>
Miklos Szeredid8a5ba42005-09-09 13:10:26 -070056
Miklos Szeredi37d217f2009-07-08 18:17:58 +020057/*
58 * Version negotiation:
59 *
60 * Both the kernel and userspace send the version they support in the
61 * INIT request and reply respectively.
62 *
63 * If the major versions match then both shall use the smallest
64 * of the two minor versions for communication.
65 *
66 * If the kernel supports a larger major version, then userspace shall
67 * reply with the major version it supports, ignore the rest of the
68 * INIT message and expect a new INIT message from the kernel with a
69 * matching major version.
70 *
71 * If the library supports a larger major version, then it shall fall
72 * back to the major protocol version sent by the kernel for
73 * communication and reply with that major version (and an arbitrary
74 * supported minor version).
75 */
76
Miklos Szeredid8a5ba42005-09-09 13:10:26 -070077/** Version number of this interface */
Miklos Szeredi9e6268d2005-09-09 13:10:29 -070078#define FUSE_KERNEL_VERSION 7
Miklos Szeredid8a5ba42005-09-09 13:10:26 -070079
80/** Minor version number of this interface */
Miklos Szeredi02c048b2010-12-07 20:16:56 +010081#define FUSE_KERNEL_MINOR_VERSION 16
Miklos Szeredid8a5ba42005-09-09 13:10:26 -070082
83/** The node ID of the root inode */
84#define FUSE_ROOT_ID 1
85
Miklos Szeredi06663262005-09-09 13:10:32 -070086/* Make sure all structures are padded to 64bit boundary, so 32bit
87 userspace works under 64bit kernels */
88
Miklos Szeredid8a5ba42005-09-09 13:10:26 -070089struct fuse_attr {
90 __u64 ino;
91 __u64 size;
92 __u64 blocks;
93 __u64 atime;
94 __u64 mtime;
95 __u64 ctime;
96 __u32 atimensec;
97 __u32 mtimensec;
98 __u32 ctimensec;
99 __u32 mode;
100 __u32 nlink;
101 __u32 uid;
102 __u32 gid;
103 __u32 rdev;
Miklos Szeredi0e9663e2007-10-18 03:07:05 -0700104 __u32 blksize;
105 __u32 padding;
Miklos Szeredid8a5ba42005-09-09 13:10:26 -0700106};
107
Miklos Szeredie5e55582005-09-09 13:10:28 -0700108struct fuse_kstatfs {
109 __u64 blocks;
110 __u64 bfree;
111 __u64 bavail;
112 __u64 files;
113 __u64 ffree;
114 __u32 bsize;
115 __u32 namelen;
Miklos Szeredide5f1202006-01-06 00:19:37 -0800116 __u32 frsize;
117 __u32 padding;
118 __u32 spare[6];
Miklos Szeredie5e55582005-09-09 13:10:28 -0700119};
120
Miklos Szeredi71421252006-06-25 05:48:52 -0700121struct fuse_file_lock {
122 __u64 start;
123 __u64 end;
124 __u32 type;
125 __u32 pid; /* tgid */
126};
127
Miklos Szeredi9cd68452006-02-01 03:04:40 -0800128/**
129 * Bitmasks for fuse_setattr_in.valid
130 */
Miklos Szeredi9e6268d2005-09-09 13:10:29 -0700131#define FATTR_MODE (1 << 0)
132#define FATTR_UID (1 << 1)
133#define FATTR_GID (1 << 2)
134#define FATTR_SIZE (1 << 3)
135#define FATTR_ATIME (1 << 4)
136#define FATTR_MTIME (1 << 5)
Miklos Szeredibefc6492005-11-07 00:59:52 -0800137#define FATTR_FH (1 << 6)
Miklos Szeredi17637cb2007-10-18 03:07:01 -0700138#define FATTR_ATIME_NOW (1 << 7)
139#define FATTR_MTIME_NOW (1 << 8)
Miklos Szeredif3332112007-10-18 03:07:04 -0700140#define FATTR_LOCKOWNER (1 << 9)
Miklos Szeredi9e6268d2005-09-09 13:10:29 -0700141
Miklos Szeredi45323fb2005-09-09 13:10:37 -0700142/**
143 * Flags returned by the OPEN request
144 *
145 * FOPEN_DIRECT_IO: bypass page cache for this open file
146 * FOPEN_KEEP_CACHE: don't invalidate the data cache on open
Tejun Heoa7c1b992008-10-16 16:08:57 +0200147 * FOPEN_NONSEEKABLE: the file is not seekable
Miklos Szeredi45323fb2005-09-09 13:10:37 -0700148 */
149#define FOPEN_DIRECT_IO (1 << 0)
150#define FOPEN_KEEP_CACHE (1 << 1)
Tejun Heoa7c1b992008-10-16 16:08:57 +0200151#define FOPEN_NONSEEKABLE (1 << 2)
Miklos Szeredi45323fb2005-09-09 13:10:37 -0700152
Miklos Szeredi9cd68452006-02-01 03:04:40 -0800153/**
154 * INIT request/reply flags
Miklos Szeredi33670fa2008-07-25 01:49:02 -0700155 *
156 * FUSE_EXPORT_SUPPORT: filesystem handles lookups of "." and ".."
Miklos Szeredie0a43dd2009-06-30 20:12:23 +0200157 * FUSE_DONT_MASK: don't apply umask to file mode on create operations
Miklos Szeredi9cd68452006-02-01 03:04:40 -0800158 */
159#define FUSE_ASYNC_READ (1 << 0)
Miklos Szeredi71421252006-06-25 05:48:52 -0700160#define FUSE_POSIX_LOCKS (1 << 1)
Miklos Szeredic79e3222007-10-18 03:06:59 -0700161#define FUSE_FILE_OPS (1 << 2)
Miklos Szeredi6ff958e2007-10-18 03:07:02 -0700162#define FUSE_ATOMIC_O_TRUNC (1 << 3)
Miklos Szeredi33670fa2008-07-25 01:49:02 -0700163#define FUSE_EXPORT_SUPPORT (1 << 4)
Miklos Szeredi78bb6cb2008-05-12 14:02:32 -0700164#define FUSE_BIG_WRITES (1 << 5)
Miklos Szeredie0a43dd2009-06-30 20:12:23 +0200165#define FUSE_DONT_MASK (1 << 6)
Miklos Szeredi9cd68452006-02-01 03:04:40 -0800166
Miklos Szeredie9168c12006-12-06 20:35:38 -0800167/**
Tejun Heo151060a2009-04-14 10:54:54 +0900168 * CUSE INIT request/reply flags
169 *
170 * CUSE_UNRESTRICTED_IOCTL: use unrestricted ioctl
171 */
172#define CUSE_UNRESTRICTED_IOCTL (1 << 0)
173
174/**
Miklos Szeredie9168c12006-12-06 20:35:38 -0800175 * Release flags
176 */
177#define FUSE_RELEASE_FLUSH (1 << 0)
178
Miklos Szeredic79e3222007-10-18 03:06:59 -0700179/**
180 * Getattr flags
181 */
182#define FUSE_GETATTR_FH (1 << 0)
183
Miklos Szeredia9ff4f82007-10-18 03:07:02 -0700184/**
185 * Lock flags
186 */
187#define FUSE_LK_FLOCK (1 << 0)
188
Miklos Szeredib25e82e2007-10-18 03:07:03 -0700189/**
190 * WRITE flags
191 *
192 * FUSE_WRITE_CACHE: delayed write from page cache, file handle is guessed
Miklos Szeredif3332112007-10-18 03:07:04 -0700193 * FUSE_WRITE_LOCKOWNER: lock_owner field is valid
Miklos Szeredib25e82e2007-10-18 03:07:03 -0700194 */
195#define FUSE_WRITE_CACHE (1 << 0)
Miklos Szeredif3332112007-10-18 03:07:04 -0700196#define FUSE_WRITE_LOCKOWNER (1 << 1)
197
198/**
199 * Read flags
200 */
201#define FUSE_READ_LOCKOWNER (1 << 1)
Miklos Szeredib25e82e2007-10-18 03:07:03 -0700202
Tejun Heo59efec72008-11-26 12:03:55 +0100203/**
204 * Ioctl flags
205 *
206 * FUSE_IOCTL_COMPAT: 32bit compat ioctl on 64bit machine
207 * FUSE_IOCTL_UNRESTRICTED: not restricted to well-formed ioctls, retry allowed
208 * FUSE_IOCTL_RETRY: retry with new iovecs
Miklos Szeredi1baa26b2010-12-07 20:16:56 +0100209 * FUSE_IOCTL_32BIT: 32bit ioctl
Tejun Heo59efec72008-11-26 12:03:55 +0100210 *
211 * FUSE_IOCTL_MAX_IOV: maximum of in_iovecs + out_iovecs
212 */
213#define FUSE_IOCTL_COMPAT (1 << 0)
214#define FUSE_IOCTL_UNRESTRICTED (1 << 1)
215#define FUSE_IOCTL_RETRY (1 << 2)
Miklos Szeredi1baa26b2010-12-07 20:16:56 +0100216#define FUSE_IOCTL_32BIT (1 << 3)
Tejun Heo59efec72008-11-26 12:03:55 +0100217
218#define FUSE_IOCTL_MAX_IOV 256
219
Tejun Heo95668a62008-11-26 12:03:55 +0100220/**
221 * Poll flags
222 *
223 * FUSE_POLL_SCHEDULE_NOTIFY: request poll notify
224 */
225#define FUSE_POLL_SCHEDULE_NOTIFY (1 << 0)
226
Miklos Szeredi334f4852005-09-09 13:10:27 -0700227enum fuse_opcode {
Miklos Szeredie5e55582005-09-09 13:10:28 -0700228 FUSE_LOOKUP = 1,
229 FUSE_FORGET = 2, /* no reply */
230 FUSE_GETATTR = 3,
Miklos Szeredi9e6268d2005-09-09 13:10:29 -0700231 FUSE_SETATTR = 4,
Miklos Szeredie5e55582005-09-09 13:10:28 -0700232 FUSE_READLINK = 5,
Miklos Szeredi9e6268d2005-09-09 13:10:29 -0700233 FUSE_SYMLINK = 6,
Miklos Szeredi9e6268d2005-09-09 13:10:29 -0700234 FUSE_MKNOD = 8,
235 FUSE_MKDIR = 9,
236 FUSE_UNLINK = 10,
237 FUSE_RMDIR = 11,
238 FUSE_RENAME = 12,
239 FUSE_LINK = 13,
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700240 FUSE_OPEN = 14,
241 FUSE_READ = 15,
242 FUSE_WRITE = 16,
Miklos Szeredie5e55582005-09-09 13:10:28 -0700243 FUSE_STATFS = 17,
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700244 FUSE_RELEASE = 18,
245 FUSE_FSYNC = 20,
Miklos Szeredi92a87802005-09-09 13:10:31 -0700246 FUSE_SETXATTR = 21,
247 FUSE_GETXATTR = 22,
248 FUSE_LISTXATTR = 23,
249 FUSE_REMOVEXATTR = 24,
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700250 FUSE_FLUSH = 25,
Miklos Szeredi04730fe2005-09-09 13:10:36 -0700251 FUSE_INIT = 26,
252 FUSE_OPENDIR = 27,
253 FUSE_READDIR = 28,
Miklos Szeredi82547982005-09-09 13:10:38 -0700254 FUSE_RELEASEDIR = 29,
Miklos Szeredi31d40d72005-11-07 00:59:50 -0800255 FUSE_FSYNCDIR = 30,
Miklos Szeredi71421252006-06-25 05:48:52 -0700256 FUSE_GETLK = 31,
257 FUSE_SETLK = 32,
258 FUSE_SETLKW = 33,
Miklos Szeredifd72faa2005-11-07 00:59:51 -0800259 FUSE_ACCESS = 34,
Miklos Szeredia4d27e72006-06-25 05:48:54 -0700260 FUSE_CREATE = 35,
261 FUSE_INTERRUPT = 36,
Miklos Szeredib2d22722006-12-06 20:35:51 -0800262 FUSE_BMAP = 37,
Miklos Szeredi0ec7ca42006-12-06 20:35:52 -0800263 FUSE_DESTROY = 38,
Tejun Heo59efec72008-11-26 12:03:55 +0100264 FUSE_IOCTL = 39,
Tejun Heo95668a62008-11-26 12:03:55 +0100265 FUSE_POLL = 40,
Miklos Szeredi2d45ba32010-07-12 14:41:40 +0200266 FUSE_NOTIFY_REPLY = 41,
Miklos Szeredi02c048b2010-12-07 20:16:56 +0100267 FUSE_BATCH_FORGET = 42,
Tejun Heo151060a2009-04-14 10:54:54 +0900268
269 /* CUSE specific operations */
270 CUSE_INIT = 4096,
Miklos Szeredi334f4852005-09-09 13:10:27 -0700271};
272
Tejun Heo85993962008-11-26 12:03:55 +0100273enum fuse_notify_code {
Tejun Heo95668a62008-11-26 12:03:55 +0100274 FUSE_NOTIFY_POLL = 1,
John Muir3b463ae2009-05-31 11:13:57 -0400275 FUSE_NOTIFY_INVAL_INODE = 2,
276 FUSE_NOTIFY_INVAL_ENTRY = 3,
Miklos Szeredia1d75f22010-07-12 14:41:40 +0200277 FUSE_NOTIFY_STORE = 4,
Miklos Szeredi2d45ba32010-07-12 14:41:40 +0200278 FUSE_NOTIFY_RETRIEVE = 5,
Tejun Heo85993962008-11-26 12:03:55 +0100279 FUSE_NOTIFY_CODE_MAX,
280};
281
Miklos Szeredi1d3d7522006-01-06 00:19:40 -0800282/* The read buffer is required to be at least 8k, but may be much larger */
283#define FUSE_MIN_READ_BUFFER 8192
Miklos Szeredie5e55582005-09-09 13:10:28 -0700284
Miklos Szeredi0e9663e2007-10-18 03:07:05 -0700285#define FUSE_COMPAT_ENTRY_OUT_SIZE 120
286
Miklos Szeredie5e55582005-09-09 13:10:28 -0700287struct fuse_entry_out {
288 __u64 nodeid; /* Inode ID */
289 __u64 generation; /* Inode generation: nodeid:gen must
290 be unique for the fs's lifetime */
291 __u64 entry_valid; /* Cache timeout for the name */
292 __u64 attr_valid; /* Cache timeout for the attributes */
293 __u32 entry_valid_nsec;
294 __u32 attr_valid_nsec;
295 struct fuse_attr attr;
296};
297
298struct fuse_forget_in {
Miklos Szeredi9e6268d2005-09-09 13:10:29 -0700299 __u64 nlookup;
Miklos Szeredie5e55582005-09-09 13:10:28 -0700300};
301
Miklos Szeredi02c048b2010-12-07 20:16:56 +0100302struct fuse_forget_one {
303 __u64 nodeid;
304 __u64 nlookup;
305};
306
307struct fuse_batch_forget_in {
308 __u32 count;
309 __u32 dummy;
310};
311
Miklos Szeredic79e3222007-10-18 03:06:59 -0700312struct fuse_getattr_in {
313 __u32 getattr_flags;
314 __u32 dummy;
315 __u64 fh;
316};
317
Miklos Szeredi0e9663e2007-10-18 03:07:05 -0700318#define FUSE_COMPAT_ATTR_OUT_SIZE 96
319
Miklos Szeredie5e55582005-09-09 13:10:28 -0700320struct fuse_attr_out {
321 __u64 attr_valid; /* Cache timeout for the attributes */
322 __u32 attr_valid_nsec;
323 __u32 dummy;
324 struct fuse_attr attr;
325};
326
Miklos Szeredie0a43dd2009-06-30 20:12:23 +0200327#define FUSE_COMPAT_MKNOD_IN_SIZE 8
328
Miklos Szeredi9e6268d2005-09-09 13:10:29 -0700329struct fuse_mknod_in {
330 __u32 mode;
331 __u32 rdev;
Miklos Szeredie0a43dd2009-06-30 20:12:23 +0200332 __u32 umask;
333 __u32 padding;
Miklos Szeredi9e6268d2005-09-09 13:10:29 -0700334};
335
336struct fuse_mkdir_in {
337 __u32 mode;
Miklos Szeredie0a43dd2009-06-30 20:12:23 +0200338 __u32 umask;
Miklos Szeredi9e6268d2005-09-09 13:10:29 -0700339};
340
341struct fuse_rename_in {
342 __u64 newdir;
343};
344
345struct fuse_link_in {
346 __u64 oldnodeid;
347};
348
349struct fuse_setattr_in {
350 __u32 valid;
Miklos Szeredi06663262005-09-09 13:10:32 -0700351 __u32 padding;
Miklos Szeredibefc6492005-11-07 00:59:52 -0800352 __u64 fh;
353 __u64 size;
Miklos Szeredif3332112007-10-18 03:07:04 -0700354 __u64 lock_owner;
Miklos Szeredibefc6492005-11-07 00:59:52 -0800355 __u64 atime;
356 __u64 mtime;
357 __u64 unused2;
358 __u32 atimensec;
359 __u32 mtimensec;
360 __u32 unused3;
361 __u32 mode;
362 __u32 unused4;
363 __u32 uid;
364 __u32 gid;
365 __u32 unused5;
Miklos Szeredi9e6268d2005-09-09 13:10:29 -0700366};
367
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700368struct fuse_open_in {
369 __u32 flags;
Miklos Szeredie0a43dd2009-06-30 20:12:23 +0200370 __u32 unused;
371};
372
373struct fuse_create_in {
374 __u32 flags;
Miklos Szeredifd72faa2005-11-07 00:59:51 -0800375 __u32 mode;
Miklos Szeredie0a43dd2009-06-30 20:12:23 +0200376 __u32 umask;
377 __u32 padding;
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700378};
379
380struct fuse_open_out {
381 __u64 fh;
382 __u32 open_flags;
Miklos Szeredi06663262005-09-09 13:10:32 -0700383 __u32 padding;
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700384};
385
386struct fuse_release_in {
387 __u64 fh;
388 __u32 flags;
Miklos Szeredie9168c12006-12-06 20:35:38 -0800389 __u32 release_flags;
390 __u64 lock_owner;
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700391};
392
393struct fuse_flush_in {
394 __u64 fh;
Miklos Szeredie9168c12006-12-06 20:35:38 -0800395 __u32 unused;
Miklos Szeredi06663262005-09-09 13:10:32 -0700396 __u32 padding;
Miklos Szeredi71421252006-06-25 05:48:52 -0700397 __u64 lock_owner;
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700398};
399
400struct fuse_read_in {
401 __u64 fh;
402 __u64 offset;
403 __u32 size;
Miklos Szeredif3332112007-10-18 03:07:04 -0700404 __u32 read_flags;
405 __u64 lock_owner;
Miklos Szeredia6643092007-11-28 16:22:00 -0800406 __u32 flags;
407 __u32 padding;
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700408};
409
Miklos Szeredif3332112007-10-18 03:07:04 -0700410#define FUSE_COMPAT_WRITE_IN_SIZE 24
411
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700412struct fuse_write_in {
413 __u64 fh;
414 __u64 offset;
415 __u32 size;
416 __u32 write_flags;
Miklos Szeredif3332112007-10-18 03:07:04 -0700417 __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
422struct fuse_write_out {
423 __u32 size;
Miklos Szeredi06663262005-09-09 13:10:32 -0700424 __u32 padding;
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700425};
426
Miklos Szeredide5f1202006-01-06 00:19:37 -0800427#define FUSE_COMPAT_STATFS_SIZE 48
428
Miklos Szeredie5e55582005-09-09 13:10:28 -0700429struct fuse_statfs_out {
430 struct fuse_kstatfs st;
431};
432
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700433struct fuse_fsync_in {
434 __u64 fh;
435 __u32 fsync_flags;
Miklos Szeredi06663262005-09-09 13:10:32 -0700436 __u32 padding;
Miklos Szeredib6aeade2005-09-09 13:10:30 -0700437};
438
Miklos Szeredi92a87802005-09-09 13:10:31 -0700439struct fuse_setxattr_in {
440 __u32 size;
441 __u32 flags;
442};
443
444struct fuse_getxattr_in {
445 __u32 size;
Miklos Szeredi06663262005-09-09 13:10:32 -0700446 __u32 padding;
Miklos Szeredi92a87802005-09-09 13:10:31 -0700447};
448
449struct fuse_getxattr_out {
450 __u32 size;
Miklos Szeredi06663262005-09-09 13:10:32 -0700451 __u32 padding;
Miklos Szeredi92a87802005-09-09 13:10:31 -0700452};
453
Miklos Szeredi71421252006-06-25 05:48:52 -0700454struct fuse_lk_in {
455 __u64 fh;
456 __u64 owner;
457 struct fuse_file_lock lk;
Miklos Szeredia9ff4f82007-10-18 03:07:02 -0700458 __u32 lk_flags;
459 __u32 padding;
Miklos Szeredi71421252006-06-25 05:48:52 -0700460};
461
462struct fuse_lk_out {
463 struct fuse_file_lock lk;
464};
465
Miklos Szeredi31d40d72005-11-07 00:59:50 -0800466struct fuse_access_in {
467 __u32 mask;
468 __u32 padding;
469};
470
Miklos Szeredi3ec870d2006-01-06 00:19:41 -0800471struct fuse_init_in {
Miklos Szeredi334f4852005-09-09 13:10:27 -0700472 __u32 major;
473 __u32 minor;
Miklos Szeredi9cd68452006-02-01 03:04:40 -0800474 __u32 max_readahead;
475 __u32 flags;
Miklos Szeredi334f4852005-09-09 13:10:27 -0700476};
477
Miklos Szeredi3ec870d2006-01-06 00:19:41 -0800478struct fuse_init_out {
479 __u32 major;
480 __u32 minor;
Miklos Szeredi9cd68452006-02-01 03:04:40 -0800481 __u32 max_readahead;
482 __u32 flags;
Csaba Henk7a6d3c82009-07-01 17:28:41 -0700483 __u16 max_background;
484 __u16 congestion_threshold;
Miklos Szeredi3ec870d2006-01-06 00:19:41 -0800485 __u32 max_write;
486};
487
Tejun Heo151060a2009-04-14 10:54:54 +0900488#define CUSE_INIT_INFO_MAX 4096
489
490struct cuse_init_in {
491 __u32 major;
492 __u32 minor;
493 __u32 unused;
494 __u32 flags;
495};
496
497struct cuse_init_out {
498 __u32 major;
499 __u32 minor;
500 __u32 unused;
501 __u32 flags;
502 __u32 max_read;
503 __u32 max_write;
504 __u32 dev_major; /* chardev major */
505 __u32 dev_minor; /* chardev minor */
506 __u32 spare[10];
507};
508
Miklos Szeredia4d27e72006-06-25 05:48:54 -0700509struct fuse_interrupt_in {
510 __u64 unique;
511};
512
Miklos Szeredib2d22722006-12-06 20:35:51 -0800513struct fuse_bmap_in {
514 __u64 block;
515 __u32 blocksize;
516 __u32 padding;
517};
518
519struct fuse_bmap_out {
520 __u64 block;
521};
522
Tejun Heo59efec72008-11-26 12:03:55 +0100523struct fuse_ioctl_in {
524 __u64 fh;
525 __u32 flags;
526 __u32 cmd;
527 __u64 arg;
528 __u32 in_size;
529 __u32 out_size;
530};
531
Miklos Szeredi1baa26b2010-12-07 20:16:56 +0100532struct fuse_ioctl_iovec {
533 __u64 base;
534 __u64 len;
535};
536
Tejun Heo59efec72008-11-26 12:03:55 +0100537struct fuse_ioctl_out {
538 __s32 result;
539 __u32 flags;
540 __u32 in_iovs;
541 __u32 out_iovs;
542};
543
Tejun Heo95668a62008-11-26 12:03:55 +0100544struct fuse_poll_in {
545 __u64 fh;
546 __u64 kh;
547 __u32 flags;
548 __u32 padding;
549};
550
551struct fuse_poll_out {
552 __u32 revents;
553 __u32 padding;
554};
555
556struct fuse_notify_poll_wakeup_out {
557 __u64 kh;
558};
559
Miklos Szeredi334f4852005-09-09 13:10:27 -0700560struct fuse_in_header {
561 __u32 len;
562 __u32 opcode;
563 __u64 unique;
564 __u64 nodeid;
565 __u32 uid;
566 __u32 gid;
567 __u32 pid;
Miklos Szeredi06663262005-09-09 13:10:32 -0700568 __u32 padding;
Miklos Szeredi334f4852005-09-09 13:10:27 -0700569};
570
571struct fuse_out_header {
572 __u32 len;
573 __s32 error;
574 __u64 unique;
575};
576
Miklos Szeredie5e55582005-09-09 13:10:28 -0700577struct fuse_dirent {
578 __u64 ino;
579 __u64 off;
580 __u32 namelen;
581 __u32 type;
582 char name[0];
583};
584
Andrew Morton21f3da92007-07-15 23:39:50 -0700585#define FUSE_NAME_OFFSET offsetof(struct fuse_dirent, name)
Miklos Szeredie5e55582005-09-09 13:10:28 -0700586#define FUSE_DIRENT_ALIGN(x) (((x) + sizeof(__u64) - 1) & ~(sizeof(__u64) - 1))
587#define FUSE_DIRENT_SIZE(d) \
588 FUSE_DIRENT_ALIGN(FUSE_NAME_OFFSET + (d)->namelen)
Tejun Heo29d434b2008-10-16 16:08:57 +0200589
John Muir3b463ae2009-05-31 11:13:57 -0400590struct fuse_notify_inval_inode_out {
591 __u64 ino;
592 __s64 off;
593 __s64 len;
594};
595
596struct fuse_notify_inval_entry_out {
597 __u64 parent;
598 __u32 namelen;
599 __u32 padding;
600};
601
Miklos Szeredia1d75f22010-07-12 14:41:40 +0200602struct fuse_notify_store_out {
603 __u64 nodeid;
604 __u64 offset;
605 __u32 size;
606 __u32 padding;
607};
608
Miklos Szeredi2d45ba32010-07-12 14:41:40 +0200609struct fuse_notify_retrieve_out {
610 __u64 notify_unique;
611 __u64 nodeid;
612 __u64 offset;
613 __u32 size;
614 __u32 padding;
615};
616
617/* Matches the size of fuse_write_in */
618struct fuse_notify_retrieve_in {
619 __u64 dummy1;
620 __u64 offset;
621 __u32 size;
622 __u32 dummy2;
623 __u64 dummy3;
624 __u64 dummy4;
625};
626
Tejun Heo29d434b2008-10-16 16:08:57 +0200627#endif /* _LINUX_FUSE_H */