diff options
author | Raghavendra G <raghavendra@zresearch.com> | 2009-06-11 04:58:30 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2009-06-11 07:28:59 -0700 |
commit | ee22651f34b467859959b17b881da465001c6bc8 (patch) | |
tree | 93cc8fce407d35c01375f3cab76656e1ec45654d /libglusterfsclient/src/libglusterfsclient.h | |
parent | 29a3619d6bb5680213c817b13dad7d8ad6e2903b (diff) |
libglusterfsclient: implement glusterfs_sendfile.
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
Diffstat (limited to 'libglusterfsclient/src/libglusterfsclient.h')
-rwxr-xr-x | libglusterfsclient/src/libglusterfsclient.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/libglusterfsclient/src/libglusterfsclient.h b/libglusterfsclient/src/libglusterfsclient.h index 9e03a8c59ac..e8b19f4bc51 100755 --- a/libglusterfsclient/src/libglusterfsclient.h +++ b/libglusterfsclient/src/libglusterfsclient.h @@ -1234,6 +1234,32 @@ glusterfs_seekdir (glusterfs_dir_t dirfd, off_t offset); */ off_t glusterfs_telldir (glusterfs_dir_t dirfd); + + +/* Write count bytes from in_fd to out_fd, starting at *offset. + * glusterfs_sendfile aims at eliminating memory copy at the end of + * each read from in_fd, copying the file directly to out_fd from the buffer + * provided by glusterfs. + * + * @out_fd: file descriptor opened for writing + * + * @in_fd: glusterfs file handle to the file to be read from. + * + * @offset: If offset is not NULL, then it points to a variable holding the file + * offset from which glusterfs_sendfile() will start reading data + * from in_fd. When glusterfs_sendfile() returns, this variable will + * be set to the offset of the byte following the last byte that was + * read. If offset is not NULL, then glusterfs_sendfile() does not + * modify the current file offset of in_fd; otherwise the current file + * offset is adjusted to reflect the number of bytes read from in_fd. + * + * @count: number of bytes to copy between the file descriptors. + */ + +ssize_t +glusterfs_sendfile (int out_fd, glusterfs_file_t in_fd, off_t *offset, + size_t count); + /* FIXME: review the need for these apis */ /* added for log related initialization in booster fork implementation */ void |