151369649SPedro F. Giffuni /*-- 25fe58019SAttilio Rao * This file defines the kernel interface of FUSE 35fe58019SAttilio Rao * Copyright (C) 2001-2007 Miklos Szeredi <miklos@szeredi.hu> 45fe58019SAttilio Rao * 55fe58019SAttilio Rao * This program can be distributed under the terms of the GNU GPL. 65fe58019SAttilio Rao * See the file COPYING. 75fe58019SAttilio Rao * 85fe58019SAttilio Rao * This -- and only this -- header file may also be distributed under 95fe58019SAttilio Rao * the terms of the BSD Licence as follows: 105fe58019SAttilio Rao * 115fe58019SAttilio Rao * Copyright (C) 2001-2007 Miklos Szeredi. All rights reserved. 125fe58019SAttilio Rao * 135fe58019SAttilio Rao * Redistribution and use in source and binary forms, with or without 145fe58019SAttilio Rao * modification, are permitted provided that the following conditions 155fe58019SAttilio Rao * are met: 165fe58019SAttilio Rao * 1. Redistributions of source code must retain the above copyright 175fe58019SAttilio Rao * notice, this list of conditions and the following disclaimer. 185fe58019SAttilio Rao * 2. Redistributions in binary form must reproduce the above copyright 195fe58019SAttilio Rao * notice, this list of conditions and the following disclaimer in the 205fe58019SAttilio Rao * documentation and/or other materials provided with the distribution. 215fe58019SAttilio Rao * 225fe58019SAttilio Rao * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND 235fe58019SAttilio Rao * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 245fe58019SAttilio Rao * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 255fe58019SAttilio Rao * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE 265fe58019SAttilio Rao * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 275fe58019SAttilio Rao * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 285fe58019SAttilio Rao * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 295fe58019SAttilio Rao * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 305fe58019SAttilio Rao * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 315fe58019SAttilio Rao * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 325fe58019SAttilio Rao * SUCH DAMAGE. 335fe58019SAttilio Rao * 345fe58019SAttilio Rao * $FreeBSD$ 355fe58019SAttilio Rao */ 365fe58019SAttilio Rao 3716bd2d47SAlan Somers /* 3816bd2d47SAlan Somers * This file defines the kernel interface of FUSE 3916bd2d47SAlan Somers * 4016bd2d47SAlan Somers * Protocol changelog: 4116bd2d47SAlan Somers * 4216bd2d47SAlan Somers * 7.9: 4316bd2d47SAlan Somers * - new fuse_getattr_in input argument of GETATTR 4416bd2d47SAlan Somers * - add lk_flags in fuse_lk_in 4516bd2d47SAlan Somers * - add lock_owner field to fuse_setattr_in, fuse_read_in and fuse_write_in 4616bd2d47SAlan Somers * - add blksize field to fuse_attr 4716bd2d47SAlan Somers * - add file flags field to fuse_read_in and fuse_write_in 48*3f105d16SAlan Somers * 49*3f105d16SAlan Somers * 7.10 50*3f105d16SAlan Somers * - add nonseekable open flag 5116bd2d47SAlan Somers */ 5216bd2d47SAlan Somers 5316bd2d47SAlan Somers #ifndef _FUSE_FUSE_KERNEL_H 5416bd2d47SAlan Somers #define _FUSE_FUSE_KERNEL_H 5516bd2d47SAlan Somers 565fe58019SAttilio Rao #ifndef linux 575fe58019SAttilio Rao #include <sys/types.h> 585fe58019SAttilio Rao #define __u64 uint64_t 595fe58019SAttilio Rao #define __u32 uint32_t 605fe58019SAttilio Rao #define __s32 int32_t 615fe58019SAttilio Rao #else 627d20a270SPedro F. Giffuni #include <asm/types.h> 637d20a270SPedro F. Giffuni #include <linux/major.h> 645fe58019SAttilio Rao #endif 655fe58019SAttilio Rao 665fe58019SAttilio Rao /** Version number of this interface */ 675fe58019SAttilio Rao #define FUSE_KERNEL_VERSION 7 685fe58019SAttilio Rao 695fe58019SAttilio Rao /** Minor version number of this interface */ 70*3f105d16SAlan Somers #define FUSE_KERNEL_MINOR_VERSION 10 715fe58019SAttilio Rao 725fe58019SAttilio Rao /** The node ID of the root inode */ 735fe58019SAttilio Rao #define FUSE_ROOT_ID 1 745fe58019SAttilio Rao 757d20a270SPedro F. Giffuni /** The major number of the fuse character device */ 767d20a270SPedro F. Giffuni #define FUSE_MAJOR MISC_MAJOR 777d20a270SPedro F. Giffuni 785fe58019SAttilio Rao /* Make sure all structures are padded to 64bit boundary, so 32bit 795fe58019SAttilio Rao userspace works under 64bit kernels */ 805fe58019SAttilio Rao 815fe58019SAttilio Rao struct fuse_attr { 825fe58019SAttilio Rao __u64 ino; 835fe58019SAttilio Rao __u64 size; 845fe58019SAttilio Rao __u64 blocks; 855fe58019SAttilio Rao __u64 atime; 865fe58019SAttilio Rao __u64 mtime; 875fe58019SAttilio Rao __u64 ctime; 885fe58019SAttilio Rao __u32 atimensec; 895fe58019SAttilio Rao __u32 mtimensec; 905fe58019SAttilio Rao __u32 ctimensec; 915fe58019SAttilio Rao __u32 mode; 925fe58019SAttilio Rao __u32 nlink; 935fe58019SAttilio Rao __u32 uid; 945fe58019SAttilio Rao __u32 gid; 955fe58019SAttilio Rao __u32 rdev; 9616bd2d47SAlan Somers __u32 blksize; 9716bd2d47SAlan Somers __u32 padding; 985fe58019SAttilio Rao }; 995fe58019SAttilio Rao 1005fe58019SAttilio Rao struct fuse_kstatfs { 1015fe58019SAttilio Rao __u64 blocks; 1025fe58019SAttilio Rao __u64 bfree; 1035fe58019SAttilio Rao __u64 bavail; 1045fe58019SAttilio Rao __u64 files; 1055fe58019SAttilio Rao __u64 ffree; 1065fe58019SAttilio Rao __u32 bsize; 1075fe58019SAttilio Rao __u32 namelen; 1085fe58019SAttilio Rao __u32 frsize; 1095fe58019SAttilio Rao __u32 padding; 1105fe58019SAttilio Rao __u32 spare[6]; 1115fe58019SAttilio Rao }; 1125fe58019SAttilio Rao 1135fe58019SAttilio Rao struct fuse_file_lock { 1145fe58019SAttilio Rao __u64 start; 1155fe58019SAttilio Rao __u64 end; 1165fe58019SAttilio Rao __u32 type; 1175fe58019SAttilio Rao __u32 pid; /* tgid */ 1185fe58019SAttilio Rao }; 1195fe58019SAttilio Rao 1205fe58019SAttilio Rao /** 1215fe58019SAttilio Rao * Bitmasks for fuse_setattr_in.valid 1225fe58019SAttilio Rao */ 1235fe58019SAttilio Rao #define FATTR_MODE (1 << 0) 1245fe58019SAttilio Rao #define FATTR_UID (1 << 1) 1255fe58019SAttilio Rao #define FATTR_GID (1 << 2) 1265fe58019SAttilio Rao #define FATTR_SIZE (1 << 3) 1275fe58019SAttilio Rao #define FATTR_ATIME (1 << 4) 1285fe58019SAttilio Rao #define FATTR_MTIME (1 << 5) 1295fe58019SAttilio Rao #define FATTR_FH (1 << 6) 13016bd2d47SAlan Somers #define FATTR_ATIME_NOW (1 << 7) 13116bd2d47SAlan Somers #define FATTR_MTIME_NOW (1 << 8) 13216bd2d47SAlan Somers #define FATTR_LOCKOWNER (1 << 9) 1335fe58019SAttilio Rao 1345fe58019SAttilio Rao /** 1355fe58019SAttilio Rao * Flags returned by the OPEN request 1365fe58019SAttilio Rao * 1375fe58019SAttilio Rao * FOPEN_DIRECT_IO: bypass page cache for this open file 1385fe58019SAttilio Rao * FOPEN_KEEP_CACHE: don't invalidate the data cache on open 139*3f105d16SAlan Somers * FOPEN_NONSEEKABLE: the file is not seekable 1405fe58019SAttilio Rao */ 1415fe58019SAttilio Rao #define FOPEN_DIRECT_IO (1 << 0) 1425fe58019SAttilio Rao #define FOPEN_KEEP_CACHE (1 << 1) 143*3f105d16SAlan Somers #define FOPEN_NONSEEKABLE (1 << 2) 1445fe58019SAttilio Rao 1455fe58019SAttilio Rao /** 1465fe58019SAttilio Rao * INIT request/reply flags 14716bd2d47SAlan Somers * 14816bd2d47SAlan Somers * FUSE_EXPORT_SUPPORT: filesystem handles lookups of "." and ".." 1495fe58019SAttilio Rao */ 1505fe58019SAttilio Rao #define FUSE_ASYNC_READ (1 << 0) 1515fe58019SAttilio Rao #define FUSE_POSIX_LOCKS (1 << 1) 15216bd2d47SAlan Somers #define FUSE_FILE_OPS (1 << 2) 15316bd2d47SAlan Somers #define FUSE_ATOMIC_O_TRUNC (1 << 3) 15416bd2d47SAlan Somers #define FUSE_EXPORT_SUPPORT (1 << 4) 15516bd2d47SAlan Somers #define FUSE_BIG_WRITES (1 << 5) 1565fe58019SAttilio Rao 1575fe58019SAttilio Rao /** 1585fe58019SAttilio Rao * Release flags 1595fe58019SAttilio Rao */ 1605fe58019SAttilio Rao #define FUSE_RELEASE_FLUSH (1 << 0) 1615fe58019SAttilio Rao 16216bd2d47SAlan Somers /** 16316bd2d47SAlan Somers * Getattr flags 16416bd2d47SAlan Somers */ 16516bd2d47SAlan Somers #define FUSE_GETATTR_FH (1 << 0) 16616bd2d47SAlan Somers 16716bd2d47SAlan Somers /** 16816bd2d47SAlan Somers * Lock flags 16916bd2d47SAlan Somers */ 17016bd2d47SAlan Somers #define FUSE_LK_FLOCK (1 << 0) 17116bd2d47SAlan Somers 17216bd2d47SAlan Somers /** 17316bd2d47SAlan Somers * WRITE flags 17416bd2d47SAlan Somers * 17516bd2d47SAlan Somers * FUSE_WRITE_CACHE: delayed write from page cache, file handle is guessed 17616bd2d47SAlan Somers * FUSE_WRITE_LOCKOWNER: lock_owner field is valid 17716bd2d47SAlan Somers */ 17816bd2d47SAlan Somers #define FUSE_WRITE_CACHE (1 << 0) 17916bd2d47SAlan Somers #define FUSE_WRITE_LOCKOWNER (1 << 1) 18016bd2d47SAlan Somers 18116bd2d47SAlan Somers /** 18216bd2d47SAlan Somers * Read flags 18316bd2d47SAlan Somers */ 18416bd2d47SAlan Somers #define FUSE_READ_LOCKOWNER (1 << 1) 18516bd2d47SAlan Somers 1865fe58019SAttilio Rao enum fuse_opcode { 1875fe58019SAttilio Rao FUSE_LOOKUP = 1, 1885fe58019SAttilio Rao FUSE_FORGET = 2, /* no reply */ 1895fe58019SAttilio Rao FUSE_GETATTR = 3, 1905fe58019SAttilio Rao FUSE_SETATTR = 4, 1915fe58019SAttilio Rao FUSE_READLINK = 5, 1925fe58019SAttilio Rao FUSE_SYMLINK = 6, 1935fe58019SAttilio Rao FUSE_MKNOD = 8, 1945fe58019SAttilio Rao FUSE_MKDIR = 9, 1955fe58019SAttilio Rao FUSE_UNLINK = 10, 1965fe58019SAttilio Rao FUSE_RMDIR = 11, 1975fe58019SAttilio Rao FUSE_RENAME = 12, 1985fe58019SAttilio Rao FUSE_LINK = 13, 1995fe58019SAttilio Rao FUSE_OPEN = 14, 2005fe58019SAttilio Rao FUSE_READ = 15, 2015fe58019SAttilio Rao FUSE_WRITE = 16, 2025fe58019SAttilio Rao FUSE_STATFS = 17, 2035fe58019SAttilio Rao FUSE_RELEASE = 18, 2045fe58019SAttilio Rao FUSE_FSYNC = 20, 2055fe58019SAttilio Rao FUSE_SETXATTR = 21, 2065fe58019SAttilio Rao FUSE_GETXATTR = 22, 2075fe58019SAttilio Rao FUSE_LISTXATTR = 23, 2085fe58019SAttilio Rao FUSE_REMOVEXATTR = 24, 2095fe58019SAttilio Rao FUSE_FLUSH = 25, 2105fe58019SAttilio Rao FUSE_INIT = 26, 2115fe58019SAttilio Rao FUSE_OPENDIR = 27, 2125fe58019SAttilio Rao FUSE_READDIR = 28, 2135fe58019SAttilio Rao FUSE_RELEASEDIR = 29, 2145fe58019SAttilio Rao FUSE_FSYNCDIR = 30, 2155fe58019SAttilio Rao FUSE_GETLK = 31, 2165fe58019SAttilio Rao FUSE_SETLK = 32, 2175fe58019SAttilio Rao FUSE_SETLKW = 33, 2185fe58019SAttilio Rao FUSE_ACCESS = 34, 2195fe58019SAttilio Rao FUSE_CREATE = 35, 2205fe58019SAttilio Rao FUSE_INTERRUPT = 36, 2215fe58019SAttilio Rao FUSE_BMAP = 37, 2225fe58019SAttilio Rao FUSE_DESTROY = 38, 2235fe58019SAttilio Rao }; 2245fe58019SAttilio Rao 2255fe58019SAttilio Rao /* The read buffer is required to be at least 8k, but may be much larger */ 2265fe58019SAttilio Rao #define FUSE_MIN_READ_BUFFER 8192 2275fe58019SAttilio Rao 22816bd2d47SAlan Somers #define FUSE_COMPAT_ENTRY_OUT_SIZE 120 22916bd2d47SAlan Somers 2305fe58019SAttilio Rao struct fuse_entry_out { 2315fe58019SAttilio Rao __u64 nodeid; /* Inode ID */ 2325fe58019SAttilio Rao __u64 generation; /* Inode generation: nodeid:gen must 2335fe58019SAttilio Rao be unique for the fs's lifetime */ 2345fe58019SAttilio Rao __u64 entry_valid; /* Cache timeout for the name */ 2355fe58019SAttilio Rao __u64 attr_valid; /* Cache timeout for the attributes */ 2365fe58019SAttilio Rao __u32 entry_valid_nsec; 2375fe58019SAttilio Rao __u32 attr_valid_nsec; 2385fe58019SAttilio Rao struct fuse_attr attr; 2395fe58019SAttilio Rao }; 2405fe58019SAttilio Rao 2415fe58019SAttilio Rao struct fuse_forget_in { 2425fe58019SAttilio Rao __u64 nlookup; 2435fe58019SAttilio Rao }; 2445fe58019SAttilio Rao 24516bd2d47SAlan Somers struct fuse_getattr_in { 24616bd2d47SAlan Somers __u32 getattr_flags; 24716bd2d47SAlan Somers __u32 dummy; 24816bd2d47SAlan Somers __u64 fh; 24916bd2d47SAlan Somers }; 25016bd2d47SAlan Somers 25116bd2d47SAlan Somers #define FUSE_COMPAT_ATTR_OUT_SIZE 96 25216bd2d47SAlan Somers 2535fe58019SAttilio Rao struct fuse_attr_out { 2545fe58019SAttilio Rao __u64 attr_valid; /* Cache timeout for the attributes */ 2555fe58019SAttilio Rao __u32 attr_valid_nsec; 2565fe58019SAttilio Rao __u32 dummy; 2575fe58019SAttilio Rao struct fuse_attr attr; 2585fe58019SAttilio Rao }; 2595fe58019SAttilio Rao 2604cbb4f88SAlan Somers struct fuse_mknod_in { 2614cbb4f88SAlan Somers __u32 mode; 2624cbb4f88SAlan Somers __u32 rdev; 2634cbb4f88SAlan Somers }; 2644cbb4f88SAlan Somers 2655fe58019SAttilio Rao struct fuse_mkdir_in { 2665fe58019SAttilio Rao __u32 mode; 2675fe58019SAttilio Rao __u32 padding; 2685fe58019SAttilio Rao }; 2695fe58019SAttilio Rao 2705fe58019SAttilio Rao struct fuse_rename_in { 2715fe58019SAttilio Rao __u64 newdir; 2725fe58019SAttilio Rao }; 2735fe58019SAttilio Rao 2745fe58019SAttilio Rao struct fuse_link_in { 2755fe58019SAttilio Rao __u64 oldnodeid; 2765fe58019SAttilio Rao }; 2775fe58019SAttilio Rao 2785fe58019SAttilio Rao struct fuse_setattr_in { 2795fe58019SAttilio Rao __u32 valid; 2805fe58019SAttilio Rao __u32 padding; 2815fe58019SAttilio Rao __u64 fh; 2825fe58019SAttilio Rao __u64 size; 28316bd2d47SAlan Somers __u64 lock_owner; 2845fe58019SAttilio Rao __u64 atime; 2855fe58019SAttilio Rao __u64 mtime; 2865fe58019SAttilio Rao __u64 unused2; 2875fe58019SAttilio Rao __u32 atimensec; 2885fe58019SAttilio Rao __u32 mtimensec; 2895fe58019SAttilio Rao __u32 unused3; 2905fe58019SAttilio Rao __u32 mode; 2915fe58019SAttilio Rao __u32 unused4; 2925fe58019SAttilio Rao __u32 uid; 2935fe58019SAttilio Rao __u32 gid; 2945fe58019SAttilio Rao __u32 unused5; 2955fe58019SAttilio Rao }; 2965fe58019SAttilio Rao 2975fe58019SAttilio Rao struct fuse_open_in { 2985fe58019SAttilio Rao __u32 flags; 2995fe58019SAttilio Rao __u32 mode; 3005fe58019SAttilio Rao }; 3015fe58019SAttilio Rao 3025fe58019SAttilio Rao struct fuse_open_out { 3035fe58019SAttilio Rao __u64 fh; 3045fe58019SAttilio Rao __u32 open_flags; 3055fe58019SAttilio Rao __u32 padding; 3065fe58019SAttilio Rao }; 3075fe58019SAttilio Rao 3085fe58019SAttilio Rao struct fuse_release_in { 3095fe58019SAttilio Rao __u64 fh; 3105fe58019SAttilio Rao __u32 flags; 3115fe58019SAttilio Rao __u32 release_flags; 3125fe58019SAttilio Rao __u64 lock_owner; 3135fe58019SAttilio Rao }; 3145fe58019SAttilio Rao 3155fe58019SAttilio Rao struct fuse_flush_in { 3165fe58019SAttilio Rao __u64 fh; 3175fe58019SAttilio Rao __u32 unused; 3185fe58019SAttilio Rao __u32 padding; 3195fe58019SAttilio Rao __u64 lock_owner; 3205fe58019SAttilio Rao }; 3215fe58019SAttilio Rao 3225fe58019SAttilio Rao struct fuse_read_in { 3235fe58019SAttilio Rao __u64 fh; 3245fe58019SAttilio Rao __u64 offset; 3255fe58019SAttilio Rao __u32 size; 32616bd2d47SAlan Somers __u32 read_flags; 32716bd2d47SAlan Somers __u64 lock_owner; 32816bd2d47SAlan Somers __u32 flags; 3295fe58019SAttilio Rao __u32 padding; 3305fe58019SAttilio Rao }; 3315fe58019SAttilio Rao 33216bd2d47SAlan Somers #define FUSE_COMPAT_WRITE_IN_SIZE 24 33316bd2d47SAlan Somers 3345fe58019SAttilio Rao struct fuse_write_in { 3355fe58019SAttilio Rao __u64 fh; 3365fe58019SAttilio Rao __u64 offset; 3375fe58019SAttilio Rao __u32 size; 3385fe58019SAttilio Rao __u32 write_flags; 33916bd2d47SAlan Somers __u64 lock_owner; 34016bd2d47SAlan Somers __u32 flags; 34116bd2d47SAlan Somers __u32 padding; 3425fe58019SAttilio Rao }; 3435fe58019SAttilio Rao 3445fe58019SAttilio Rao struct fuse_write_out { 3455fe58019SAttilio Rao __u32 size; 3465fe58019SAttilio Rao __u32 padding; 3475fe58019SAttilio Rao }; 3485fe58019SAttilio Rao 3495fe58019SAttilio Rao #define FUSE_COMPAT_STATFS_SIZE 48 3505fe58019SAttilio Rao 3515fe58019SAttilio Rao struct fuse_statfs_out { 3525fe58019SAttilio Rao struct fuse_kstatfs st; 3535fe58019SAttilio Rao }; 3545fe58019SAttilio Rao 3555fe58019SAttilio Rao struct fuse_fsync_in { 3565fe58019SAttilio Rao __u64 fh; 3575fe58019SAttilio Rao __u32 fsync_flags; 3585fe58019SAttilio Rao __u32 padding; 3595fe58019SAttilio Rao }; 3605fe58019SAttilio Rao 36196192dfcSAlan Somers struct fuse_setxattr_in { 362493b4a8cSFedor Uporov __u32 size; 363493b4a8cSFedor Uporov __u32 flags; 364493b4a8cSFedor Uporov }; 365493b4a8cSFedor Uporov 36696192dfcSAlan Somers struct fuse_listxattr_in { 36796192dfcSAlan Somers __u32 size; 36896192dfcSAlan Somers __u32 padding; 36996192dfcSAlan Somers }; 37096192dfcSAlan Somers 371493b4a8cSFedor Uporov struct fuse_listxattr_out { 3725fe58019SAttilio Rao __u32 size; 37396192dfcSAlan Somers __u32 padding; 3745fe58019SAttilio Rao }; 3755fe58019SAttilio Rao 3765fe58019SAttilio Rao struct fuse_getxattr_in { 3775fe58019SAttilio Rao __u32 size; 3785fe58019SAttilio Rao __u32 padding; 3795fe58019SAttilio Rao }; 3805fe58019SAttilio Rao 3815fe58019SAttilio Rao struct fuse_getxattr_out { 3825fe58019SAttilio Rao __u32 size; 3835fe58019SAttilio Rao __u32 padding; 3845fe58019SAttilio Rao }; 3855fe58019SAttilio Rao 3865fe58019SAttilio Rao struct fuse_lk_in { 3875fe58019SAttilio Rao __u64 fh; 3885fe58019SAttilio Rao __u64 owner; 3895fe58019SAttilio Rao struct fuse_file_lock lk; 39016bd2d47SAlan Somers __u32 lk_flags; 39116bd2d47SAlan Somers __u32 padding; 3925fe58019SAttilio Rao }; 3935fe58019SAttilio Rao 3945fe58019SAttilio Rao struct fuse_lk_out { 3955fe58019SAttilio Rao struct fuse_file_lock lk; 3965fe58019SAttilio Rao }; 3975fe58019SAttilio Rao 3985fe58019SAttilio Rao struct fuse_access_in { 3995fe58019SAttilio Rao __u32 mask; 4005fe58019SAttilio Rao __u32 padding; 4015fe58019SAttilio Rao }; 4025fe58019SAttilio Rao 4035fe58019SAttilio Rao struct fuse_init_in { 4045fe58019SAttilio Rao __u32 major; 4055fe58019SAttilio Rao __u32 minor; 4065fe58019SAttilio Rao __u32 max_readahead; 4075fe58019SAttilio Rao __u32 flags; 4085fe58019SAttilio Rao }; 4095fe58019SAttilio Rao 4105fe58019SAttilio Rao struct fuse_init_out { 4115fe58019SAttilio Rao __u32 major; 4125fe58019SAttilio Rao __u32 minor; 4135fe58019SAttilio Rao __u32 max_readahead; 4145fe58019SAttilio Rao __u32 flags; 4155fe58019SAttilio Rao __u32 unused; 4165fe58019SAttilio Rao __u32 max_write; 4175fe58019SAttilio Rao }; 4185fe58019SAttilio Rao 4195fe58019SAttilio Rao struct fuse_interrupt_in { 4205fe58019SAttilio Rao __u64 unique; 4215fe58019SAttilio Rao }; 4225fe58019SAttilio Rao 4235fe58019SAttilio Rao struct fuse_bmap_in { 4245fe58019SAttilio Rao __u64 block; 4255fe58019SAttilio Rao __u32 blocksize; 4265fe58019SAttilio Rao __u32 padding; 4275fe58019SAttilio Rao }; 4285fe58019SAttilio Rao 4295fe58019SAttilio Rao struct fuse_bmap_out { 4305fe58019SAttilio Rao __u64 block; 4315fe58019SAttilio Rao }; 4325fe58019SAttilio Rao 4335fe58019SAttilio Rao struct fuse_in_header { 4345fe58019SAttilio Rao __u32 len; 4355fe58019SAttilio Rao __u32 opcode; 4365fe58019SAttilio Rao __u64 unique; 4375fe58019SAttilio Rao __u64 nodeid; 4385fe58019SAttilio Rao __u32 uid; 4395fe58019SAttilio Rao __u32 gid; 4405fe58019SAttilio Rao __u32 pid; 4415fe58019SAttilio Rao __u32 padding; 4425fe58019SAttilio Rao }; 4435fe58019SAttilio Rao 4445fe58019SAttilio Rao struct fuse_out_header { 4455fe58019SAttilio Rao __u32 len; 4465fe58019SAttilio Rao __s32 error; 4475fe58019SAttilio Rao __u64 unique; 4485fe58019SAttilio Rao }; 4495fe58019SAttilio Rao 4505fe58019SAttilio Rao struct fuse_dirent { 4515fe58019SAttilio Rao __u64 ino; 4525fe58019SAttilio Rao __u64 off; 4535fe58019SAttilio Rao __u32 namelen; 4545fe58019SAttilio Rao __u32 type; 4557d20a270SPedro F. Giffuni char name[0]; 4565fe58019SAttilio Rao }; 4575fe58019SAttilio Rao 4585fe58019SAttilio Rao #define FUSE_NAME_OFFSET offsetof(struct fuse_dirent, name) 4595fe58019SAttilio Rao #define FUSE_DIRENT_ALIGN(x) (((x) + sizeof(__u64) - 1) & ~(sizeof(__u64) - 1)) 4605fe58019SAttilio Rao #define FUSE_DIRENT_SIZE(d) \ 4615fe58019SAttilio Rao FUSE_DIRENT_ALIGN(FUSE_NAME_OFFSET + (d)->namelen) 46216bd2d47SAlan Somers 46316bd2d47SAlan Somers #endif /* _FUSE_FUSE_KERNEL_H */ 464