diff options
author | Miklos Szeredi <miklos@szeredi.hu> | 2005-09-09 16:10:28 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-09-09 17:03:45 -0400 |
commit | e5e5558e923f35839108a12718494ecb73fb782f (patch) | |
tree | c410d6826e9df13f7ea9e382a26589b66ec0989c /include/linux | |
parent | 334f485df85ac7736ebe14940bf0a059c5f26d7d (diff) |
[PATCH] FUSE - read-only operations
This patch adds the read-only filesystem operations of FUSE.
This contains the following files:
o dir.c
- directory, symlink and file-inode operations
The following operations are added:
o lookup
o getattr
o readlink
o follow_link
o directory open
o readdir
o directory release
o permission
o dentry revalidate
o statfs
Signed-off-by: Miklos Szeredi <miklos@szeredi.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/fuse.h | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/include/linux/fuse.h b/include/linux/fuse.h index a1aebd7104c4..21b9ba16f8d5 100644 --- a/include/linux/fuse.h +++ b/include/linux/fuse.h | |||
@@ -42,13 +42,61 @@ struct fuse_attr { | |||
42 | __u32 rdev; | 42 | __u32 rdev; |
43 | }; | 43 | }; |
44 | 44 | ||
45 | struct fuse_kstatfs { | ||
46 | __u64 blocks; | ||
47 | __u64 bfree; | ||
48 | __u64 bavail; | ||
49 | __u64 files; | ||
50 | __u64 ffree; | ||
51 | __u32 bsize; | ||
52 | __u32 namelen; | ||
53 | }; | ||
54 | |||
45 | enum fuse_opcode { | 55 | enum fuse_opcode { |
56 | FUSE_LOOKUP = 1, | ||
57 | FUSE_FORGET = 2, /* no reply */ | ||
58 | FUSE_GETATTR = 3, | ||
59 | FUSE_READLINK = 5, | ||
60 | FUSE_GETDIR = 7, | ||
61 | FUSE_STATFS = 17, | ||
46 | FUSE_INIT = 26 | 62 | FUSE_INIT = 26 |
47 | }; | 63 | }; |
48 | 64 | ||
49 | /* Conservative buffer size for the client */ | 65 | /* Conservative buffer size for the client */ |
50 | #define FUSE_MAX_IN 8192 | 66 | #define FUSE_MAX_IN 8192 |
51 | 67 | ||
68 | #define FUSE_NAME_MAX 1024 | ||
69 | |||
70 | struct fuse_entry_out { | ||
71 | __u64 nodeid; /* Inode ID */ | ||
72 | __u64 generation; /* Inode generation: nodeid:gen must | ||
73 | be unique for the fs's lifetime */ | ||
74 | __u64 entry_valid; /* Cache timeout for the name */ | ||
75 | __u64 attr_valid; /* Cache timeout for the attributes */ | ||
76 | __u32 entry_valid_nsec; | ||
77 | __u32 attr_valid_nsec; | ||
78 | struct fuse_attr attr; | ||
79 | }; | ||
80 | |||
81 | struct fuse_forget_in { | ||
82 | __u64 version; | ||
83 | }; | ||
84 | |||
85 | struct fuse_attr_out { | ||
86 | __u64 attr_valid; /* Cache timeout for the attributes */ | ||
87 | __u32 attr_valid_nsec; | ||
88 | __u32 dummy; | ||
89 | struct fuse_attr attr; | ||
90 | }; | ||
91 | |||
92 | struct fuse_getdir_out { | ||
93 | __u32 fd; | ||
94 | }; | ||
95 | |||
96 | struct fuse_statfs_out { | ||
97 | struct fuse_kstatfs st; | ||
98 | }; | ||
99 | |||
52 | struct fuse_init_in_out { | 100 | struct fuse_init_in_out { |
53 | __u32 major; | 101 | __u32 major; |
54 | __u32 minor; | 102 | __u32 minor; |
@@ -70,3 +118,15 @@ struct fuse_out_header { | |||
70 | __u64 unique; | 118 | __u64 unique; |
71 | }; | 119 | }; |
72 | 120 | ||
121 | struct fuse_dirent { | ||
122 | __u64 ino; | ||
123 | __u64 off; | ||
124 | __u32 namelen; | ||
125 | __u32 type; | ||
126 | char name[0]; | ||
127 | }; | ||
128 | |||
129 | #define FUSE_NAME_OFFSET ((unsigned) ((struct fuse_dirent *) 0)->name) | ||
130 | #define FUSE_DIRENT_ALIGN(x) (((x) + sizeof(__u64) - 1) & ~(sizeof(__u64) - 1)) | ||
131 | #define FUSE_DIRENT_SIZE(d) \ | ||
132 | FUSE_DIRENT_ALIGN(FUSE_NAME_OFFSET + (d)->namelen) | ||