[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>
diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c
index 9aaf10a..e8f3170 100644
--- a/fs/fuse/dev.c
+++ b/fs/fuse/dev.c
@@ -691,6 +691,13 @@
return NULL;
}
+/* fget() needs to be done in this context */
+static void process_getdir(struct fuse_req *req)
+{
+ struct fuse_getdir_out_i *arg = req->out.args[0].value;
+ arg->file = fget(arg->fd);
+}
+
static int copy_out_args(struct fuse_copy_state *cs, struct fuse_out *out,
unsigned nbytes)
{
@@ -770,6 +777,8 @@
if (!err) {
if (req->interrupted)
err = -ENOENT;
+ else if (req->in.h.opcode == FUSE_GETDIR && !oh.error)
+ process_getdir(req);
} else if (!req->interrupted)
req->out.h.error = -EIO;
request_end(fc, req);