3232 SUCH DAMAGE.
3333*/
3434
35+ /*
36+ * This file defines the kernel interface of FUSE
37+ *
38+ * Protocol changelog:
39+ *
40+ * 7.9:
41+ * - new fuse_getattr_in input argument of GETATTR
42+ * - add lk_flags in fuse_lk_in
43+ * - add lock_owner field to fuse_setattr_in, fuse_read_in and fuse_write_in
44+ * - add blksize field to fuse_attr
45+ * - add file flags field to fuse_read_in and fuse_write_in
46+ */
47+
3548#ifndef linux
3649#include <sys/types.h>
3750#define __u64 uint64_t
4659#define FUSE_KERNEL_VERSION 7
4760
4861/** Minor version number of this interface */
49- #define FUSE_KERNEL_MINOR_VERSION 8
62+ #define FUSE_KERNEL_MINOR_VERSION 9
5063
5164/** The node ID of the root inode */
5265#define FUSE_ROOT_ID 1
@@ -75,6 +88,8 @@ struct fuse_attr {
7588 __u32 uid ;
7689 __u32 gid ;
7790 __u32 rdev ;
91+ __u32 blksize ;
92+ __u32 padding ;
7893};
7994
8095struct fuse_kstatfs {
@@ -107,6 +122,9 @@ struct fuse_file_lock {
107122#define FATTR_ATIME (1 << 4)
108123#define FATTR_MTIME (1 << 5)
109124#define FATTR_FH (1 << 6)
125+ #define FATTR_ATIME_NOW (1 << 7)
126+ #define FATTR_MTIME_NOW (1 << 8)
127+ #define FATTR_LOCKOWNER (1 << 9)
110128
111129/**
112130 * Flags returned by the OPEN request
@@ -122,12 +140,38 @@ struct fuse_file_lock {
122140 */
123141#define FUSE_ASYNC_READ (1 << 0)
124142#define FUSE_POSIX_LOCKS (1 << 1)
143+ #define FUSE_FILE_OPS (1 << 2)
144+ #define FUSE_ATOMIC_O_TRUNC (1 << 3)
125145
126146/**
127147 * Release flags
128148 */
129149#define FUSE_RELEASE_FLUSH (1 << 0)
130150
151+ /**
152+ * Getattr flags
153+ */
154+ #define FUSE_GETATTR_FH (1 << 0)
155+
156+ /**
157+ * Lock flags
158+ */
159+ #define FUSE_LK_FLOCK (1 << 0)
160+
161+ /**
162+ * WRITE flags
163+ *
164+ * FUSE_WRITE_CACHE: delayed write from page cache, file handle is guessed
165+ * FUSE_WRITE_LOCKOWNER: lock_owner field is valid
166+ */
167+ #define FUSE_WRITE_CACHE (1 << 0)
168+ #define FUSE_WRITE_LOCKOWNER (1 << 1)
169+
170+ /**
171+ * Read flags
172+ */
173+ #define FUSE_READ_LOCKOWNER (1 << 1)
174+
131175enum fuse_opcode {
132176 FUSE_LOOKUP = 1 ,
133177 FUSE_FORGET = 2 , /* no reply */
@@ -170,6 +214,8 @@ enum fuse_opcode {
170214/* The read buffer is required to be at least 8k, but may be much larger */
171215#define FUSE_MIN_READ_BUFFER 8192
172216
217+ #define FUSE_COMPAT_ENTRY_OUT_SIZE 120
218+
173219struct fuse_entry_out {
174220 __u64 nodeid ; /* Inode ID */
175221 __u64 generation ; /* Inode generation: nodeid:gen must
@@ -185,6 +231,14 @@ struct fuse_forget_in {
185231 __u64 nlookup ;
186232};
187233
234+ struct fuse_getattr_in {
235+ __u32 getattr_flags ;
236+ __u32 dummy ;
237+ __u64 fh ;
238+ };
239+
240+ #define FUSE_COMPAT_ATTR_OUT_SIZE 96
241+
188242struct fuse_attr_out {
189243 __u64 attr_valid ; /* Cache timeout for the attributes */
190244 __u32 attr_valid_nsec ;
@@ -215,7 +269,7 @@ struct fuse_setattr_in {
215269 __u32 padding ;
216270 __u64 fh ;
217271 __u64 size ;
218- __u64 unused1 ;
272+ __u64 lock_owner ;
219273 __u64 atime ;
220274 __u64 mtime ;
221275 __u64 unused2 ;
@@ -258,14 +312,22 @@ struct fuse_read_in {
258312 __u64 fh ;
259313 __u64 offset ;
260314 __u32 size ;
315+ __u32 read_flags ;
316+ __u64 lock_owner ;
317+ __u32 flags ;
261318 __u32 padding ;
262319};
263320
321+ #define FUSE_COMPAT_WRITE_IN_SIZE 24
322+
264323struct fuse_write_in {
265324 __u64 fh ;
266325 __u64 offset ;
267326 __u32 size ;
268327 __u32 write_flags ;
328+ __u64 lock_owner ;
329+ __u32 flags ;
330+ __u32 padding ;
269331};
270332
271333struct fuse_write_out {
@@ -304,6 +366,8 @@ struct fuse_lk_in {
304366 __u64 fh ;
305367 __u64 owner ;
306368 struct fuse_file_lock lk ;
369+ __u32 lk_flags ;
370+ __u32 padding ;
307371};
308372
309373struct fuse_lk_out {
0 commit comments