Skip to content

Commit

Permalink
[PATCH] FUSE - read-only operations
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Miklos Szeredi authored and Linus Torvalds committed Sep 9, 2005
1 parent 334f485 commit e5e5558
Show file tree
Hide file tree
Showing 6 changed files with 615 additions and 1 deletion.
2 changes: 1 addition & 1 deletion fs/fuse/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

obj-$(CONFIG_FUSE_FS) += fuse.o

fuse-objs := dev.o inode.o
fuse-objs := dev.o dir.o inode.o
9 changes: 9 additions & 0 deletions fs/fuse/dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -691,6 +691,13 @@ static struct fuse_req *request_find(struct fuse_conn *fc, u64 unique)
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)
{
Expand Down Expand Up @@ -770,6 +777,8 @@ static ssize_t fuse_dev_writev(struct file *file, const struct iovec *iov,
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);
Expand Down
Loading

0 comments on commit e5e5558

Please sign in to comment.