diff options
author | Jeremy Allison <jra@samba.org> | 2007-10-29 17:16:13 -0700 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2007-10-29 17:16:13 -0700 |
commit | 488b59cfac244ec8cfc60df687fcd153d693509c (patch) | |
tree | 016f3ce43e8a7b6b4a0bab95ebfd69854cf0182b /source3/modules | |
parent | 32dd016353355acfb71dd773187076f95ff6e86e (diff) | |
download | samba-488b59cfac244ec8cfc60df687fcd153d693509c.tar.gz samba-488b59cfac244ec8cfc60df687fcd153d693509c.tar.bz2 samba-488b59cfac244ec8cfc60df687fcd153d693509c.zip |
Add in the recvfile entry to the VFS layer with a default
implementation. Needed for the zero-copy write code.
Jeremy.
(This used to be commit bfbdb6324c5d13bfde8b742e9c5a0e0c9092bd86)
Diffstat (limited to 'source3/modules')
-rw-r--r-- | source3/modules/vfs_default.c | 17 | ||||
-rw-r--r-- | source3/modules/vfs_full_audit.c | 22 |
2 files changed, 39 insertions, 0 deletions
diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c index a3bb61d419..8c2bbfea96 100644 --- a/source3/modules/vfs_default.c +++ b/source3/modules/vfs_default.c @@ -348,6 +348,21 @@ static ssize_t vfswrap_sendfile(vfs_handle_struct *handle, int tofd, files_struc return result; } +static ssize_t vfswrap_recvfile(vfs_handle_struct *handle, + int fromfd, + files_struct *fsp, + int tofd, + SMB_OFF_T offset, + size_t n) +{ + ssize_t result; + + START_PROFILE_BYTES(syscall_recvfile, n); + result = sys_recvfile(fromfd, tofd, offset, n); + END_PROFILE(syscall_recvfile); + return result; +} + /********************************************************* For rename across filesystems Patch from Warren Birnbaum <warrenb@hpcvscdp.cv.hp.com> @@ -1263,6 +1278,8 @@ static vfs_op_tuple vfs_default_ops[] = { SMB_VFS_LAYER_OPAQUE}, {SMB_VFS_OP(vfswrap_sendfile), SMB_VFS_OP_SENDFILE, SMB_VFS_LAYER_OPAQUE}, + {SMB_VFS_OP(vfswrap_recvfile), SMB_VFS_OP_RECVFILE, + SMB_VFS_LAYER_OPAQUE}, {SMB_VFS_OP(vfswrap_rename), SMB_VFS_OP_RENAME, SMB_VFS_LAYER_OPAQUE}, {SMB_VFS_OP(vfswrap_fsync), SMB_VFS_OP_FSYNC, diff --git a/source3/modules/vfs_full_audit.c b/source3/modules/vfs_full_audit.c index df49c86264..c8a82e3d9a 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -127,6 +127,10 @@ static ssize_t smb_full_audit_sendfile(vfs_handle_struct *handle, int tofd, files_struct *fsp, int fromfd, const DATA_BLOB *hdr, SMB_OFF_T offset, size_t n); +static ssize_t smb_full_audit_recvfile(vfs_handle_struct *handle, int fromfd, + files_struct *fsp, int tofd, + SMB_OFF_T offset, + size_t n); static int smb_full_audit_rename(vfs_handle_struct *handle, const char *oldname, const char *newname); static int smb_full_audit_fsync(vfs_handle_struct *handle, files_struct *fsp, int fd); @@ -363,6 +367,8 @@ static vfs_op_tuple audit_op_tuples[] = { SMB_VFS_LAYER_LOGGER}, {SMB_VFS_OP(smb_full_audit_sendfile), SMB_VFS_OP_SENDFILE, SMB_VFS_LAYER_LOGGER}, + {SMB_VFS_OP(smb_full_audit_recvfile), SMB_VFS_OP_RECVFILE, + SMB_VFS_LAYER_LOGGER}, {SMB_VFS_OP(smb_full_audit_rename), SMB_VFS_OP_RENAME, SMB_VFS_LAYER_LOGGER}, {SMB_VFS_OP(smb_full_audit_fsync), SMB_VFS_OP_FSYNC, @@ -1145,6 +1151,22 @@ static ssize_t smb_full_audit_sendfile(vfs_handle_struct *handle, int tofd, return result; } +static ssize_t smb_full_audit_recvfile(vfs_handle_struct *handle, int fromfd, + files_struct *fsp, int tofd, + SMB_OFF_T offset, + size_t n) +{ + ssize_t result; + + result = SMB_VFS_NEXT_RECVFILE(handle, fromfd, fsp, tofd, + offset, n); + + do_log(SMB_VFS_OP_RECVFILE, (result >= 0), handle, + "%s", fsp->fsp_name); + + return result; +} + static int smb_full_audit_rename(vfs_handle_struct *handle, const char *oldname, const char *newname) { |