From df31f2b11efd0d024f12c7035ab0d3646ad9c7c6 Mon Sep 17 00:00:00 2001 From: Miklos Szeredi Date: Wed, 10 Nov 2010 11:41:21 +0100 Subject: add write_buf method to high level API Add new write_buf() method to the highlevel API. Similarly to the lowlevel write_buf() method, this allows implementing zero copy writes. --- include/fuse.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'include/fuse.h') diff --git a/include/fuse.h b/include/fuse.h index 51ccb89..c2708cf 100644 --- a/include/fuse.h +++ b/include/fuse.h @@ -513,6 +513,17 @@ struct fuse_operations { */ int (*poll) (const char *, struct fuse_file_info *, struct fuse_pollhandle *ph, unsigned *reventsp); + + /** Write contents of buffer to an open file + * + * Similar to the write() method, but data is supplied in a + * generic buffer. Use fuse_buf_copy() to transfer data to + * the destination. + * + * Introduced in version 2.9 + */ + int (*write_buf) (const char *, struct fuse_bufvec *buf, off_t off, + struct fuse_file_info *); }; /** Extra context that may be needed by some filesystems @@ -726,6 +737,9 @@ int fuse_fs_read(struct fuse_fs *fs, const char *path, char *buf, size_t size, off_t off, struct fuse_file_info *fi); int fuse_fs_write(struct fuse_fs *fs, const char *path, const char *buf, size_t size, off_t off, struct fuse_file_info *fi); +int fuse_fs_write_buf(struct fuse_fs *fs, const char *path, + struct fuse_bufvec *buf, off_t off, + struct fuse_file_info *fi); int fuse_fs_fsync(struct fuse_fs *fs, const char *path, int datasync, struct fuse_file_info *fi); int fuse_fs_flush(struct fuse_fs *fs, const char *path, -- cgit v1.2.3