blob: fb3aca03eeb3d6716a5a1f52a9fa6b9ebbe752f8 [file] [log] [blame]
Miklos Szeredi85c74fc2001-10-28 19:44:14 +00001/*
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
14struct fuse_mount_data {
15 int version;
16 int fd;
17};
18
19#define FUSE_ROOT_INO 1
20
21struct 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
35enum 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
47struct fuse_lookup_out {
48 unsigned long ino;
49 struct fuse_attr attr;
50};
51
52struct fuse_getattr_out {
53 struct fuse_attr attr;
54};
55
56struct fuse_getdir_out {
57 int fd;
58 void *file; /* Used by kernel only */
59};
60
61struct fuse_mknod_in {
62 unsigned short mode;
63 unsigned short rdev;
64 char name[1];
65};
66
67struct fuse_mknod_out {
68 unsigned long ino;
69 struct fuse_attr attr;
70};
71
72struct fuse_in_header {
73 int unique;
74 enum fuse_opcode opcode;
75 unsigned long ino;
76};
77
78struct fuse_out_header {
79 int unique;
80 int result;
81};
82
83struct 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 */