From 63322038855660cc106c8f87a2ae42bcac37a4af Mon Sep 17 00:00:00 2001 From: Miklos Szeredi Date: Wed, 10 Nov 2010 11:41:21 +0100 Subject: add read_buf method to high level API Add a new read_buf() method to the highlevel API. This allows returning a generic buffer from the read method, which in turn allows zero copy reads. --- lib/modules/subdir.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/modules/subdir.c') diff --git a/lib/modules/subdir.c b/lib/modules/subdir.c index 788765c..6d9ac89 100644 --- a/lib/modules/subdir.c +++ b/lib/modules/subdir.c @@ -384,14 +384,14 @@ static int subdir_open(const char *path, struct fuse_file_info *fi) return err; } -static int subdir_read(const char *path, char *buf, size_t size, off_t offset, - struct fuse_file_info *fi) +static int subdir_read_buf(const char *path, struct fuse_bufvec **bufp, + size_t size, off_t offset, struct fuse_file_info *fi) { struct subdir *d = subdir_get(); char *newpath; int err = subdir_addpath(d, path, &newpath); if (!err) { - err = fuse_fs_read(d->next, newpath, buf, size, offset, fi); + err = fuse_fs_read_buf(d->next, newpath, bufp, size, offset, fi); free(newpath); } return err; @@ -587,7 +587,7 @@ static struct fuse_operations subdir_oper = { .utimens = subdir_utimens, .create = subdir_create, .open = subdir_open, - .read = subdir_read, + .read_buf = subdir_read_buf, .write_buf = subdir_write_buf, .statfs = subdir_statfs, .flush = subdir_flush, -- cgit v1.2.3