aboutsummaryrefslogtreecommitdiffstats
path: root/fuse.h
diff options
context:
space:
mode:
authorMiklos Szeredi <miklos@szeredi.hu>2001-10-26 14:55:42 +0000
committerMiklos Szeredi <miklos@szeredi.hu>2001-10-26 14:55:42 +0000
commit90d8bef61c8c40472ddfb1aafeeb6473ec51a053 (patch)
tree9e86fadff65abd2a0851bfcc4282ed786182acbe /fuse.h
parent724f2bc50ab0dc38248c2dfc6414506f29b10d55 (diff)
downloadlibfuse-90d8bef61c8c40472ddfb1aafeeb6473ec51a053.tar.gz
*** empty log message ***
Diffstat (limited to 'fuse.h')
-rw-r--r--fuse.h94
1 files changed, 74 insertions, 20 deletions
diff --git a/fuse.h b/fuse.h
index 32c2609..04faf9d 100644
--- a/fuse.h
+++ b/fuse.h
@@ -6,6 +6,7 @@
See the file COPYING.
*/
+#include <linux/limits.h>
#define FUSE_MOUNT_VERSION 1
@@ -14,39 +15,92 @@ struct fuse_mount_data {
int fd;
};
+#define FUSE_ROOT_INO 1
+
+struct fuse_attr {
+ unsigned short mode;
+ unsigned short nlink;
+ unsigned short uid;
+ unsigned short gid;
+ unsigned short rdev;
+ unsigned long size;
+ unsigned long blksize;
+ unsigned long blocks;
+ unsigned long atime;
+ unsigned long mtime;
+ unsigned long ctime;
+};
+
enum fuse_opcode {
+ FUSE_LOOKUP,
+ FUSE_GETATTR,
+ FUSE_READLINK,
FUSE_OPEN,
FUSE_RELEASE,
};
-struct fuse_inparam {
- enum fuse_opcode opcode;
- union {
- struct {
- unsigned int ino;
- int flags;
- } open;
- } u;
+/* Conservative buffer size for the client */
+#define FUSE_MAX_IN 8192
+
+struct fuse_in_open {
+ int flag;
};
-struct fuse_outparam {
- int result;
- union {
- struct {
- int fd;
- } open;
- } u;
+struct fuse_out_open {
+ int fd;
+};
+
+struct fuse_in_lookup {
+ char name[NAME_MAX + 1];
+};
+
+struct fuse_out_lookup {
+ unsigned long ino;
+ struct fuse_attr attr;
+};
+
+struct fuse_out_getattr {
+ struct fuse_attr attr;
};
-struct fuse_param {
+struct fuse_out_readlink {
+ char link[PATH_MAX + 1];
+};
+
+struct fuse_in_common {
+ int unique;
+ enum fuse_opcode opcode;
+ unsigned long ino;
+};
+
+struct fuse_out_common {
int unique;
int result;
- union {
- struct fuse_inparam i;
- struct fuse_outparam o;
- } u;
};
+struct fuse_in {
+ struct fuse_in_common c;
+ size_t argsize;
+ void *arg;
+};
+
+struct fuse_out {
+ struct fuse_out_common c;
+ size_t argsize;
+ void *arg;
+};
+
+struct fuse_dirent {
+ unsigned long ino;
+ unsigned short namelen;
+ unsigned char type;
+ char name[NAME_MAX + 1];
+};
+
+#define FUSE_NAME_OFFSET ((size_t) ((struct fuse_dirent *) 0)->name)
+#define FUSE_DIRENT_ALIGN(x) (((x) + sizeof(long) - 1) & ~(sizeof(long) - 1))
+#define FUSE_DIRENT_SIZE(d) \
+ FUSE_DIRENT_ALIGN(FUSE_NAME_OFFSET + (d)->namelen)
/*
* Local Variables: