diff options
author | Tim Prouty <tprouty@samba.org> | 2009-02-20 13:27:39 -0800 |
---|---|---|
committer | Tim Prouty <tprouty@samba.org> | 2009-02-21 17:10:42 -0800 |
commit | 8ec9903426ec4e559df8ac8306a8ebcdf0706176 (patch) | |
tree | d851e433a5f634e1b977b00b489d61c22a050366 /source3/modules/vfs_onefs.c | |
parent | 0dcfa9ce1baa9f2074a002fdb5c8b88cc5db28db (diff) | |
download | samba-8ec9903426ec4e559df8ac8306a8ebcdf0706176.tar.gz samba-8ec9903426ec4e559df8ac8306a8ebcdf0706176.tar.bz2 samba-8ec9903426ec4e559df8ac8306a8ebcdf0706176.zip |
s3 OneFS: Add an atomic sendfile implementation
Diffstat (limited to 'source3/modules/vfs_onefs.c')
-rw-r--r-- | source3/modules/vfs_onefs.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/source3/modules/vfs_onefs.c b/source3/modules/vfs_onefs.c index f0c6a9d8bb..60c2c977a4 100644 --- a/source3/modules/vfs_onefs.c +++ b/source3/modules/vfs_onefs.c @@ -156,6 +156,19 @@ static int onefs_open(vfs_handle_struct *handle, const char *fname, return SMB_VFS_NEXT_OPEN(handle, fname, fsp, flags, mode); } +static ssize_t onefs_sendfile(vfs_handle_struct *handle, int tofd, + files_struct *fromfsp, const DATA_BLOB *header, + SMB_OFF_T offset, size_t count) +{ + ssize_t result; + + START_PROFILE_BYTES(syscall_sendfile, count); + result = onefs_sys_sendfile(handle->conn, tofd, fromfsp->fh->fd, + header, offset, count); + END_PROFILE(syscall_sendfile); + return result; +} + static ssize_t onefs_recvfile(vfs_handle_struct *handle, int fromfd, files_struct *tofsp, SMB_OFF_T offset, size_t count) @@ -340,6 +353,8 @@ static vfs_op_tuple onefs_ops[] = { SMB_VFS_LAYER_OPAQUE}, {SMB_VFS_OP(onefs_close), SMB_VFS_OP_CLOSE, SMB_VFS_LAYER_TRANSPARENT}, + {SMB_VFS_OP(onefs_sendfile), SMB_VFS_OP_SENDFILE, + SMB_VFS_LAYER_OPAQUE}, {SMB_VFS_OP(onefs_recvfile), SMB_VFS_OP_RECVFILE, SMB_VFS_LAYER_OPAQUE}, {SMB_VFS_OP(onefs_rename), SMB_VFS_OP_RENAME, |