Miklos Szeredi | 85c74fc | 2001-10-28 19:44:14 +0000 | [diff] [blame^] | 1 | /* |
| 2 | FUSE: Filesystem in Userspace |
| 3 | Copyright (C) 2001 Miklos Szeredi (mszeredi@inf.bme.hu) |
| 4 | |
| 5 | This program can be distributed under the terms of the GNU GPL. |
| 6 | See the file COPYING. |
| 7 | */ |
| 8 | |
| 9 | /* This file defines the kernel interface of FUSE */ |
| 10 | |
| 11 | |
| 12 | #define FUSE_MOUNT_VERSION 1 |
| 13 | |
| 14 | struct fuse_mount_data { |
| 15 | int version; |
| 16 | int fd; |
| 17 | }; |
| 18 | |
| 19 | #define FUSE_ROOT_INO 1 |
| 20 | |
| 21 | struct fuse_attr { |
| 22 | unsigned short mode; |
| 23 | unsigned short nlink; |
| 24 | unsigned short uid; |
| 25 | unsigned short gid; |
| 26 | unsigned short rdev; |
| 27 | unsigned long long size; |
| 28 | unsigned long blksize; |
| 29 | unsigned long blocks; |
| 30 | unsigned long atime; |
| 31 | unsigned long mtime; |
| 32 | unsigned long ctime; |
| 33 | }; |
| 34 | |
| 35 | enum fuse_opcode { |
| 36 | FUSE_LOOKUP = 1, |
| 37 | FUSE_FORGET, |
| 38 | FUSE_GETATTR, |
| 39 | FUSE_READLINK, |
| 40 | FUSE_GETDIR, |
| 41 | FUSE_MKNOD, |
| 42 | }; |
| 43 | |
| 44 | /* Conservative buffer size for the client */ |
| 45 | #define FUSE_MAX_IN 8192 |
| 46 | |
| 47 | struct fuse_lookup_out { |
| 48 | unsigned long ino; |
| 49 | struct fuse_attr attr; |
| 50 | }; |
| 51 | |
| 52 | struct fuse_getattr_out { |
| 53 | struct fuse_attr attr; |
| 54 | }; |
| 55 | |
| 56 | struct fuse_getdir_out { |
| 57 | int fd; |
| 58 | void *file; /* Used by kernel only */ |
| 59 | }; |
| 60 | |
| 61 | struct fuse_mknod_in { |
| 62 | unsigned short mode; |
| 63 | unsigned short rdev; |
| 64 | char name[1]; |
| 65 | }; |
| 66 | |
| 67 | struct fuse_mknod_out { |
| 68 | unsigned long ino; |
| 69 | struct fuse_attr attr; |
| 70 | }; |
| 71 | |
| 72 | struct fuse_in_header { |
| 73 | int unique; |
| 74 | enum fuse_opcode opcode; |
| 75 | unsigned long ino; |
| 76 | }; |
| 77 | |
| 78 | struct fuse_out_header { |
| 79 | int unique; |
| 80 | int result; |
| 81 | }; |
| 82 | |
| 83 | struct fuse_dirent { |
| 84 | unsigned long ino; |
| 85 | unsigned short namelen; |
| 86 | unsigned char type; |
| 87 | char name[256]; |
| 88 | }; |
| 89 | |
| 90 | #define FUSE_NAME_OFFSET ((unsigned int) ((struct fuse_dirent *) 0)->name) |
| 91 | #define FUSE_DIRENT_ALIGN(x) (((x) + sizeof(long) - 1) & ~(sizeof(long) - 1)) |
| 92 | #define FUSE_DIRENT_SIZE(d) \ |
| 93 | FUSE_DIRENT_ALIGN(FUSE_NAME_OFFSET + (d)->namelen) |
| 94 | |
| 95 | /* |
| 96 | * Local Variables: |
| 97 | * indent-tabs-mode: t |
| 98 | * c-basic-offset: 8 |
| 99 | * End: |
| 100 | */ |