aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/fuse.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/fuse.h')
-rw-r--r--include/linux/fuse.h65
1 files changed, 61 insertions, 4 deletions
diff --git a/include/linux/fuse.h b/include/linux/fuse.h
index 9fbe9d258e22..d0c437028c80 100644
--- a/include/linux/fuse.h
+++ b/include/linux/fuse.h
@@ -6,7 +6,17 @@
6 See the file COPYING. 6 See the file COPYING.
7*/ 7*/
8 8
9/* This file defines the kernel interface of FUSE */ 9/*
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
16 * - add lk_flags in fuse_lk_in
17 * - add lock_owner field to fuse_setattr_in, fuse_read_in and fuse_write_in
18 * - add blksize field to fuse_attr
19 */
10 20
11#include <asm/types.h> 21#include <asm/types.h>
12#include <linux/major.h> 22#include <linux/major.h>
@@ -15,7 +25,7 @@
15#define FUSE_KERNEL_VERSION 7 25#define FUSE_KERNEL_VERSION 7
16 26
17/** Minor version number of this interface */ 27/** Minor version number of this interface */
18#define FUSE_KERNEL_MINOR_VERSION 8 28#define FUSE_KERNEL_MINOR_VERSION 9
19 29
20/** The node ID of the root inode */ 30/** The node ID of the root inode */
21#define FUSE_ROOT_ID 1 31#define FUSE_ROOT_ID 1
@@ -44,6 +54,8 @@ struct fuse_attr {
44 __u32 uid; 54 __u32 uid;
45 __u32 gid; 55 __u32 gid;
46 __u32 rdev; 56 __u32 rdev;
57 __u32 blksize;
58 __u32 padding;
47}; 59};
48 60
49struct fuse_kstatfs { 61struct fuse_kstatfs {
@@ -76,6 +88,9 @@ struct fuse_file_lock {
76#define FATTR_ATIME (1 << 4) 88#define FATTR_ATIME (1 << 4)
77#define FATTR_MTIME (1 << 5) 89#define FATTR_MTIME (1 << 5)
78#define FATTR_FH (1 << 6) 90#define FATTR_FH (1 << 6)
91#define FATTR_ATIME_NOW (1 << 7)
92#define FATTR_MTIME_NOW (1 << 8)
93#define FATTR_LOCKOWNER (1 << 9)
79 94
80/** 95/**
81 * Flags returned by the OPEN request 96 * Flags returned by the OPEN request
@@ -91,12 +106,38 @@ struct fuse_file_lock {
91 */ 106 */
92#define FUSE_ASYNC_READ (1 << 0) 107#define FUSE_ASYNC_READ (1 << 0)
93#define FUSE_POSIX_LOCKS (1 << 1) 108#define FUSE_POSIX_LOCKS (1 << 1)
109#define FUSE_FILE_OPS (1 << 2)
110#define FUSE_ATOMIC_O_TRUNC (1 << 3)
94 111
95/** 112/**
96 * Release flags 113 * Release flags
97 */ 114 */
98#define FUSE_RELEASE_FLUSH (1 << 0) 115#define FUSE_RELEASE_FLUSH (1 << 0)
99 116
117/**
118 * Getattr flags
119 */
120#define FUSE_GETATTR_FH (1 << 0)
121
122/**
123 * Lock flags
124 */
125#define FUSE_LK_FLOCK (1 << 0)
126
127/**
128 * WRITE flags
129 *
130 * FUSE_WRITE_CACHE: delayed write from page cache, file handle is guessed
131 * FUSE_WRITE_LOCKOWNER: lock_owner field is valid
132 */
133#define FUSE_WRITE_CACHE (1 << 0)
134#define FUSE_WRITE_LOCKOWNER (1 << 1)
135
136/**
137 * Read flags
138 */
139#define FUSE_READ_LOCKOWNER (1 << 1)
140
100enum fuse_opcode { 141enum fuse_opcode {
101 FUSE_LOOKUP = 1, 142 FUSE_LOOKUP = 1,
102 FUSE_FORGET = 2, /* no reply */ 143 FUSE_FORGET = 2, /* no reply */
@@ -139,6 +180,8 @@ enum fuse_opcode {
139/* The read buffer is required to be at least 8k, but may be much larger */ 180/* The read buffer is required to be at least 8k, but may be much larger */
140#define FUSE_MIN_READ_BUFFER 8192 181#define FUSE_MIN_READ_BUFFER 8192
141 182
183#define FUSE_COMPAT_ENTRY_OUT_SIZE 120
184
142struct fuse_entry_out { 185struct fuse_entry_out {
143 __u64 nodeid; /* Inode ID */ 186 __u64 nodeid; /* Inode ID */
144 __u64 generation; /* Inode generation: nodeid:gen must 187 __u64 generation; /* Inode generation: nodeid:gen must
@@ -154,6 +197,14 @@ struct fuse_forget_in {
154 __u64 nlookup; 197 __u64 nlookup;
155}; 198};
156 199
200struct fuse_getattr_in {
201 __u32 getattr_flags;
202 __u32 dummy;
203 __u64 fh;
204};
205
206#define FUSE_COMPAT_ATTR_OUT_SIZE 96
207
157struct fuse_attr_out { 208struct fuse_attr_out {
158 __u64 attr_valid; /* Cache timeout for the attributes */ 209 __u64 attr_valid; /* Cache timeout for the attributes */
159 __u32 attr_valid_nsec; 210 __u32 attr_valid_nsec;
@@ -184,7 +235,7 @@ struct fuse_setattr_in {
184 __u32 padding; 235 __u32 padding;
185 __u64 fh; 236 __u64 fh;
186 __u64 size; 237 __u64 size;
187 __u64 unused1; 238 __u64 lock_owner;
188 __u64 atime; 239 __u64 atime;
189 __u64 mtime; 240 __u64 mtime;
190 __u64 unused2; 241 __u64 unused2;
@@ -227,14 +278,18 @@ struct fuse_read_in {
227 __u64 fh; 278 __u64 fh;
228 __u64 offset; 279 __u64 offset;
229 __u32 size; 280 __u32 size;
230 __u32 padding; 281 __u32 read_flags;
282 __u64 lock_owner;
231}; 283};
232 284
285#define FUSE_COMPAT_WRITE_IN_SIZE 24
286
233struct fuse_write_in { 287struct fuse_write_in {
234 __u64 fh; 288 __u64 fh;
235 __u64 offset; 289 __u64 offset;
236 __u32 size; 290 __u32 size;
237 __u32 write_flags; 291 __u32 write_flags;
292 __u64 lock_owner;
238}; 293};
239 294
240struct fuse_write_out { 295struct fuse_write_out {
@@ -273,6 +328,8 @@ struct fuse_lk_in {
273 __u64 fh; 328 __u64 fh;
274 __u64 owner; 329 __u64 owner;
275 struct fuse_file_lock lk; 330 struct fuse_file_lock lk;
331 __u32 lk_flags;
332 __u32 padding;
276}; 333};
277 334
278struct fuse_lk_out { 335struct fuse_lk_out {