[PATCH] fuse: transfer readdir data through device

This patch removes a long lasting "hack" in FUSE, which used a separate
channel (a file descriptor refering to a disk-file) to transfer directory
contents from userspace to the kernel.

The patch adds three new operations (OPENDIR, READDIR, RELEASEDIR), which
have semantics and implementation exactly maching the respective file
operations (OPEN, READ, RELEASE).

This simplifies the directory reading code.  Also disk space is not
necessary, which can be important in embedded systems.

Signed-off-by: Miklos Szeredi <miklos@szeredi.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
Miklos Szeredi 2005-09-09 13:10:36 -07:00 committed by Linus Torvalds
parent 413ef8cb30
commit 04730fef1f
5 changed files with 77 additions and 94 deletions

View file

@ -70,7 +70,6 @@ enum fuse_opcode {
FUSE_SETATTR = 4,
FUSE_READLINK = 5,
FUSE_SYMLINK = 6,
FUSE_GETDIR = 7,
FUSE_MKNOD = 8,
FUSE_MKDIR = 9,
FUSE_UNLINK = 10,
@ -88,7 +87,10 @@ enum fuse_opcode {
FUSE_LISTXATTR = 23,
FUSE_REMOVEXATTR = 24,
FUSE_FLUSH = 25,
FUSE_INIT = 26
FUSE_INIT = 26,
FUSE_OPENDIR = 27,
FUSE_READDIR = 28,
FUSE_RELEASEDIR = 29
};
/* Conservative buffer size for the client */
@ -120,10 +122,6 @@ struct fuse_attr_out {
struct fuse_attr attr;
};
struct fuse_getdir_out {
__u32 fd;
};
struct fuse_mknod_in {
__u32 mode;
__u32 rdev;