aboutsummaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorMiklos Szeredi <miklos@szeredi.hu>2005-09-09 13:10:28 -0700
committerLinus Torvalds <torvalds@g5.osdl.org>2005-09-09 14:03:45 -0700
commite5e5558e923f35839108a12718494ecb73fb782f (patch)
treec410d6826e9df13f7ea9e382a26589b66ec0989c /include/linux
parent334f485df85ac7736ebe14940bf0a059c5f26d7d (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.h60
1 files changed, 60 insertions, 0 deletions
diff --git a/include/linux/fuse.h b/include/linux/fuse.h
index a1aebd7104c..21b9ba16f8d 100644
--- a/include/linux/fuse.h
+++ b/include/linux/fuse.h
@@ -42,13 +42,61 @@ struct fuse_attr {
__u32 rdev;
};
+struct fuse_kstatfs {
+ __u64 blocks;
+ __u64 bfree;
+ __u64 bavail;
+ __u64 files;
+ __u64 ffree;
+ __u32 bsize;
+ __u32 namelen;
+};
+
enum fuse_opcode {
+ FUSE_LOOKUP = 1,
+ FUSE_FORGET = 2, /* no reply */
+ FUSE_GETATTR = 3,
+ FUSE_READLINK = 5,
+ FUSE_GETDIR = 7,
+ FUSE_STATFS = 17,
FUSE_INIT = 26
};
/* Conservative buffer size for the client */
#define FUSE_MAX_IN 8192
+#define FUSE_NAME_MAX 1024
+
+struct fuse_entry_out {
+ __u64 nodeid; /* Inode ID */
+ __u64 generation; /* Inode generation: nodeid:gen must
+ be unique for the fs's lifetime */
+ __u64 entry_valid; /* Cache timeout for the name */
+ __u64 attr_valid; /* Cache timeout for the attributes */
+ __u32 entry_valid_nsec;
+ __u32 attr_valid_nsec;
+ struct fuse_attr attr;
+};
+
+struct fuse_forget_in {
+ __u64 version;
+};
+
+struct fuse_attr_out {
+ __u64 attr_valid; /* Cache timeout for the attributes */
+ __u32 attr_valid_nsec;
+ __u32 dummy;
+ struct fuse_attr attr;
+};
+
+struct fuse_getdir_out {
+ __u32 fd;
+};
+
+struct fuse_statfs_out {
+ struct fuse_kstatfs st;
+};
+
struct fuse_init_in_out {
__u32 major;
__u32 minor;
@@ -70,3 +118,15 @@ struct fuse_out_header {
__u64 unique;
};
+struct fuse_dirent {
+ __u64 ino;
+ __u64 off;
+ __u32 namelen;
+ __u32 type;
+ char name[0];
+};
+
+#define FUSE_NAME_OFFSET ((unsigned) ((struct fuse_dirent *) 0)->name)
+#define FUSE_DIRENT_ALIGN(x) (((x) + sizeof(__u64) - 1) & ~(sizeof(__u64) - 1))
+#define FUSE_DIRENT_SIZE(d) \
+ FUSE_DIRENT_ALIGN(FUSE_NAME_OFFSET + (d)->namelen)