From 4caab9ca25e1163378714de825d835e79e27dd4f Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Fri, 11 Jan 2008 00:51:19 +0100 Subject: Combine fsp and fromfd to fromfsp in SMB_VFS_SENDFILE(). Michael (This used to be commit a52cfb7d777157c93c9dc26c67f457be592dd537) --- source3/include/vfs.h | 3 ++- source3/include/vfs_macros.h | 6 +++--- source3/modules/vfs_cacheprime.c | 7 +++---- source3/modules/vfs_default.c | 4 ++-- source3/modules/vfs_full_audit.c | 9 ++++----- source3/modules/vfs_readahead.c | 14 ++++++-------- source3/smbd/reply.c | 4 ++-- 7 files changed, 22 insertions(+), 25 deletions(-) (limited to 'source3') diff --git a/source3/include/vfs.h b/source3/include/vfs.h index 8aa8057982..11f88c98f3 100644 --- a/source3/include/vfs.h +++ b/source3/include/vfs.h @@ -101,6 +101,7 @@ /* Leave at 22 - not yet released. Remove parameter fd from aio_cancel. - obnox */ /* Leave at 22 - not yet released. Remove parameter fd from read. - obnox */ /* Leave at 22 - not yet released. Remove parameter fd from write. - obnox */ +/* Leave at 22 - not yet released. Remove parameter fromfd from sendfile. - obnox */ @@ -297,7 +298,7 @@ struct vfs_ops { ssize_t (*write)(struct vfs_handle_struct *handle, struct files_struct *fsp, const void *data, size_t n); ssize_t (*pwrite)(struct vfs_handle_struct *handle, struct files_struct *fsp, const void *data, size_t n, SMB_OFF_T offset); SMB_OFF_T (*lseek)(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_OFF_T offset, int whence); - ssize_t (*sendfile)(struct vfs_handle_struct *handle, int tofd, files_struct *fsp, int fromfd, const DATA_BLOB *header, SMB_OFF_T offset, size_t count); + ssize_t (*sendfile)(struct vfs_handle_struct *handle, int tofd, files_struct *fromfsp, const DATA_BLOB *header, SMB_OFF_T offset, size_t count); ssize_t (*recvfile)(struct vfs_handle_struct *handle, int fromfd, files_struct *fsp, int tofd, SMB_OFF_T offset, size_t count); int (*rename)(struct vfs_handle_struct *handle, const char *oldname, const char *newname); int (*fsync)(struct vfs_handle_struct *handle, struct files_struct *fsp); diff --git a/source3/include/vfs_macros.h b/source3/include/vfs_macros.h index 48f5fcf1f4..379d6307e9 100644 --- a/source3/include/vfs_macros.h +++ b/source3/include/vfs_macros.h @@ -53,7 +53,7 @@ #define SMB_VFS_WRITE(fsp, data, n) ((fsp)->conn->vfs.ops.write((fsp)->conn->vfs.handles.write, (fsp), (data), (n))) #define SMB_VFS_PWRITE(fsp, data, n, off) ((fsp)->conn->vfs.ops.pwrite((fsp)->conn->vfs.handles.pwrite, (fsp), (data), (n), (off))) #define SMB_VFS_LSEEK(fsp, offset, whence) ((fsp)->conn->vfs.ops.lseek((fsp)->conn->vfs.handles.lseek, (fsp), (offset), (whence))) -#define SMB_VFS_SENDFILE(tofd, fsp, fromfd, header, offset, count) ((fsp)->conn->vfs.ops.sendfile((fsp)->conn->vfs.handles.sendfile, (tofd), (fsp), (fromfd), (header), (offset), (count))) +#define SMB_VFS_SENDFILE(tofd, fromfsp, header, offset, count) ((fsp)->conn->vfs.ops.sendfile((fsp)->conn->vfs.handles.sendfile, (tofd), (fromfsp), (header), (offset), (count))) #define SMB_VFS_RECVFILE(fromfd, fsp, tofd, offset, count) ((fsp)->conn->vfs.ops.recvfile((fsp)->conn->vfs.handles.recvfile, (fromfd), (fsp), (tofd), (offset), (count))) #define SMB_VFS_RENAME(conn, old, new) ((conn)->vfs.ops.rename((conn)->vfs.handles.rename, (old), (new))) #define SMB_VFS_FSYNC(fsp) ((fsp)->conn->vfs.ops.fsync((fsp)->conn->vfs.handles.fsync, (fsp))) @@ -172,7 +172,7 @@ #define SMB_VFS_OPAQUE_WRITE(fsp, data, n) ((fsp)->conn->vfs_opaque.ops.write((fsp)->conn->vfs_opaque.handles.write, (fsp), (data), (n))) #define SMB_VFS_OPAQUE_PWRITE(fsp, data, n, off) ((fsp)->conn->vfs_opaque.ops.pwrite((fsp)->conn->vfs_opaque.handles.pwrite, (fsp), (data), (n), (off))) #define SMB_VFS_OPAQUE_LSEEK(fsp, offset, whence) ((fsp)->conn->vfs_opaque.ops.lseek((fsp)->conn->vfs_opaque.handles.lseek, (fsp), (offset), (whence))) -#define SMB_VFS_OPAQUE_SENDFILE(tofd, fsp, fromfd, header, offset, count) ((fsp)->conn->vfs_opaque.ops.sendfile((fsp)->conn->vfs_opaque.handles.sendfile, (tofd), (fsp), (fromfd), (header), (offset), (count))) +#define SMB_VFS_OPAQUE_SENDFILE(tofd, fromfsp, header, offset, count) ((fsp)->conn->vfs_opaque.ops.sendfile((fsp)->conn->vfs_opaque.handles.sendfile, (tofd), (fromfsp), (header), (offset), (count))) #define SMB_VFS_OPAQUE_RECVFILE(fromfd, fsp, tofd, offset, count) ((fsp)->conn->vfs_opaque.ops.recvfile((fsp)->conn->vfs_opaque.handles.recvfile, (fromfd), (fsp), (tofd), (offset), (count))) #define SMB_VFS_OPAQUE_RENAME(conn, old, new) ((conn)->vfs_opaque.ops.rename((conn)->vfs_opaque.handles.rename, (old), (new))) #define SMB_VFS_OPAQUE_FSYNC(fsp) ((fsp)->conn->vfs_opaque.ops.fsync((fsp)->conn->vfs_opaque.handles.fsync, (fsp))) @@ -292,7 +292,7 @@ #define SMB_VFS_NEXT_WRITE(handle, fsp, data, n) ((handle)->vfs_next.ops.write((handle)->vfs_next.handles.write, (fsp), (data), (n))) #define SMB_VFS_NEXT_PWRITE(handle, fsp, data, n, off) ((handle)->vfs_next.ops.pwrite((handle)->vfs_next.handles.pwrite, (fsp), (data), (n), (off))) #define SMB_VFS_NEXT_LSEEK(handle, fsp, offset, whence) ((handle)->vfs_next.ops.lseek((handle)->vfs_next.handles.lseek, (fsp), (offset), (whence))) -#define SMB_VFS_NEXT_SENDFILE(handle, tofd, fsp, fromfd, header, offset, count) ((handle)->vfs_next.ops.sendfile((handle)->vfs_next.handles.sendfile, (tofd), (fsp), (fromfd), (header), (offset), (count))) +#define SMB_VFS_NEXT_SENDFILE(handle, tofd, fromfsp, header, offset, count) ((handle)->vfs_next.ops.sendfile((handle)->vfs_next.handles.sendfile, (tofd), (fromfsp), (header), (offset), (count))) #define SMB_VFS_NEXT_RECVFILE(handle, fromfd, fsp, tofd, offset, count) ((handle)->vfs_next.ops.recvfile((handle)->vfs_next.handles.recvfile, (fromfd), (fsp), (tofd), (offset), (count))) #define SMB_VFS_NEXT_RENAME(handle, old, new) ((handle)->vfs_next.ops.rename((handle)->vfs_next.handles.rename, (old), (new))) #define SMB_VFS_NEXT_FSYNC(handle, fsp) ((handle)->vfs_next.ops.fsync((handle)->vfs_next.handles.fsync, (fsp))) diff --git a/source3/modules/vfs_cacheprime.c b/source3/modules/vfs_cacheprime.c index 5675108f1e..15c8167a07 100644 --- a/source3/modules/vfs_cacheprime.c +++ b/source3/modules/vfs_cacheprime.c @@ -125,17 +125,16 @@ static int cprime_connect( static ssize_t cprime_sendfile( struct vfs_handle_struct * handle, int tofd, - files_struct * fsp, - int fromfd, + files_struct * fromfsp, const DATA_BLOB * header, SMB_OFF_T offset, size_t count) { if (g_readbuf && offset == 0) { - prime_cache(handle, fsp, fromfd, offset, count); + prime_cache(handle, fromfsp, fromfsp->fh->fd, offset, count); } - return SMB_VFS_NEXT_SENDFILE(handle, tofd, fsp, fromfd, + return SMB_VFS_NEXT_SENDFILE(handle, tofd, fromfsp, header, offset, count); } diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c index e57d24cb1a..3a0ed0bebd 100644 --- a/source3/modules/vfs_default.c +++ b/source3/modules/vfs_default.c @@ -337,13 +337,13 @@ static SMB_OFF_T vfswrap_lseek(vfs_handle_struct *handle, files_struct *fsp, SMB return result; } -static ssize_t vfswrap_sendfile(vfs_handle_struct *handle, int tofd, files_struct *fsp, int fromfd, const DATA_BLOB *hdr, +static ssize_t vfswrap_sendfile(vfs_handle_struct *handle, int tofd, files_struct *fromfsp, const DATA_BLOB *hdr, SMB_OFF_T offset, size_t n) { ssize_t result; START_PROFILE_BYTES(syscall_sendfile, n); - result = sys_sendfile(tofd, fromfd, hdr, offset, n); + result = sys_sendfile(tofd, fromfsp->fh->fd, hdr, offset, n); END_PROFILE(syscall_sendfile); return result; } diff --git a/source3/modules/vfs_full_audit.c b/source3/modules/vfs_full_audit.c index 00512678b1..baa5d24a33 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -124,7 +124,7 @@ static ssize_t smb_full_audit_pwrite(vfs_handle_struct *handle, files_struct *fs static SMB_OFF_T smb_full_audit_lseek(vfs_handle_struct *handle, files_struct *fsp, SMB_OFF_T offset, int whence); static ssize_t smb_full_audit_sendfile(vfs_handle_struct *handle, int tofd, - files_struct *fsp, int fromfd, + files_struct *fromfsp, const DATA_BLOB *hdr, SMB_OFF_T offset, size_t n); static ssize_t smb_full_audit_recvfile(vfs_handle_struct *handle, int fromfd, @@ -1149,17 +1149,16 @@ static SMB_OFF_T smb_full_audit_lseek(vfs_handle_struct *handle, files_struct *f } static ssize_t smb_full_audit_sendfile(vfs_handle_struct *handle, int tofd, - files_struct *fsp, int fromfd, + files_struct *fromfsp, const DATA_BLOB *hdr, SMB_OFF_T offset, size_t n) { ssize_t result; - result = SMB_VFS_NEXT_SENDFILE(handle, tofd, fsp, fromfd, hdr, - offset, n); + result = SMB_VFS_NEXT_SENDFILE(handle, tofd, fromfsp, hdr, offset, n); do_log(SMB_VFS_OP_SENDFILE, (result >= 0), handle, - "%s", fsp->fsp_name); + "%s", fromfsp->fsp_name); return result; } diff --git a/source3/modules/vfs_readahead.c b/source3/modules/vfs_readahead.c index b3642d558f..df75814b72 100644 --- a/source3/modules/vfs_readahead.c +++ b/source3/modules/vfs_readahead.c @@ -35,8 +35,7 @@ struct readahead_data { static ssize_t readahead_sendfile(struct vfs_handle_struct *handle, int tofd, - files_struct *fsp, - int fromfd, + files_struct *fromfsp, const DATA_BLOB *header, SMB_OFF_T offset, size_t count) @@ -45,16 +44,16 @@ static ssize_t readahead_sendfile(struct vfs_handle_struct *handle, if ( offset % rhd->off_bound == 0) { #if defined(HAVE_LINUX_READAHEAD) - int err = readahead(fromfd, offset, (size_t)rhd->len); + int err = readahead(fromfsp->fh->fd, offset, (size_t)rhd->len); DEBUG(10,("readahead_sendfile: readahead on fd %u, offset %llu, len %u returned %d\n", - (unsigned int)fromfd, + (unsigned int)fromfsp->fh->fd, (unsigned long long)offset, (unsigned int)rhd->len, err )); #elif defined(HAVE_POSIX_FADVISE) - int err = posix_fadvise(fromfd, offset, (off_t)rhd->len, POSIX_FADV_WILLNEED); + int err = posix_fadvise(fromfsp->fh->fd, offset, (off_t)rhd->len, POSIX_FADV_WILLNEED); DEBUG(10,("readahead_sendfile: posix_fadvise on fd %u, offset %llu, len %u returned %d\n", - (unsigned int)fromfd, + (unsigned int)fromfsp->fh->fd, (unsigned long long)offset, (unsigned int)rhd->len, err )); @@ -67,8 +66,7 @@ static ssize_t readahead_sendfile(struct vfs_handle_struct *handle, } return SMB_VFS_NEXT_SENDFILE(handle, tofd, - fsp, - fromfd, + fromfsp, header, offset, count); diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c index 79c0176e64..8149f5aeb6 100644 --- a/source3/smbd/reply.c +++ b/source3/smbd/reply.c @@ -2654,7 +2654,7 @@ void send_file_readbraw(connection_struct *conn, _smb_setlen(header,nread); header_blob = data_blob_const(header, 4); - if ( SMB_VFS_SENDFILE( smbd_server_fd(), fsp, fsp->fh->fd, + if (SMB_VFS_SENDFILE(smbd_server_fd(), fsp, &header_blob, startpos, nread) == -1) { /* Returning ENOSYS means no data at all was sent. * Do this as a normal read. */ @@ -3137,7 +3137,7 @@ static void send_file_readX(connection_struct *conn, struct smb_request *req, construct_reply_common((char *)req->inbuf, (char *)headerbuf); setup_readX_header((char *)headerbuf, smb_maxcnt); - if ((nread = SMB_VFS_SENDFILE( smbd_server_fd(), fsp, fsp->fh->fd, &header, startpos, smb_maxcnt)) == -1) { + if ((nread = SMB_VFS_SENDFILE(smbd_server_fd(), fsp, &header, startpos, smb_maxcnt)) == -1) { /* Returning ENOSYS means no data at all was sent. Do this as a normal read. */ if (errno == ENOSYS) { goto normal_read; -- cgit From 14d45bedfa844dfbf646e792d1cf84544997de25 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Fri, 11 Jan 2008 00:56:06 +0100 Subject: Remove now redundant parameter fd from prime_cache(). Michael (This used to be commit 63acaf1b9755cd5be5342929e1210afa06e170f3) --- source3/modules/vfs_cacheprime.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'source3') diff --git a/source3/modules/vfs_cacheprime.c b/source3/modules/vfs_cacheprime.c index 15c8167a07..be934f6bd6 100644 --- a/source3/modules/vfs_cacheprime.c +++ b/source3/modules/vfs_cacheprime.c @@ -48,7 +48,6 @@ static void * g_readbuf = NULL; static bool prime_cache( struct vfs_handle_struct * handle, files_struct * fsp, - int fd, SMB_OFF_T offset, size_t count) { @@ -75,7 +74,7 @@ static bool prime_cache( MODULE, (long long)g_readsz, (long long)*last, fsp->fsp_name)); - nread = sys_pread(fd, g_readbuf, g_readsz, *last); + nread = sys_pread(fsp->fh->fd, g_readbuf, g_readsz, *last); if (nread < 0) { *last = -1; return False; @@ -131,7 +130,7 @@ static ssize_t cprime_sendfile( size_t count) { if (g_readbuf && offset == 0) { - prime_cache(handle, fromfsp, fromfsp->fh->fd, offset, count); + prime_cache(handle, fromfsp, offset, count); } return SMB_VFS_NEXT_SENDFILE(handle, tofd, fromfsp, @@ -148,7 +147,7 @@ static ssize_t cprime_read( offset = SMB_VFS_LSEEK(fsp, 0, SEEK_CUR); if (offset >= 0 && g_readbuf) { - prime_cache(handle, fsp, fsp->fh->fd, offset, count); + prime_cache(handle, fsp, offset, count); SMB_VFS_LSEEK(fsp, offset, SEEK_SET); } @@ -163,7 +162,7 @@ static ssize_t cprime_pread( SMB_OFF_T offset) { if (g_readbuf) { - prime_cache(handle, fsp, fsp->fh->fd, offset, count); + prime_cache(handle, fsp, offset, count); } return SMB_VFS_NEXT_PREAD(handle, fsp, data, count, offset); -- cgit From fef9cf00e1e110ff5872f1c368d080fe4f7939d6 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Fri, 11 Jan 2008 01:26:54 +0100 Subject: Combine fsp and tofd to tofsp in SMB_VFS_RECVFILE(). Michael (This used to be commit 3958abffaf2866c69ad9e13ec345364fde5c78bb) --- source3/include/vfs.h | 3 ++- source3/include/vfs_macros.h | 6 +++--- source3/modules/vfs_default.c | 5 ++--- source3/modules/vfs_full_audit.c | 9 ++++----- source3/smbd/vfs.c | 2 -- 5 files changed, 11 insertions(+), 14 deletions(-) (limited to 'source3') diff --git a/source3/include/vfs.h b/source3/include/vfs.h index 11f88c98f3..0be3886227 100644 --- a/source3/include/vfs.h +++ b/source3/include/vfs.h @@ -102,6 +102,7 @@ /* Leave at 22 - not yet released. Remove parameter fd from read. - obnox */ /* Leave at 22 - not yet released. Remove parameter fd from write. - obnox */ /* Leave at 22 - not yet released. Remove parameter fromfd from sendfile. - obnox */ +/* Leave at 22 - not yet released. Remove parameter fromfd from recvfile. - obnox */ @@ -299,7 +300,7 @@ struct vfs_ops { ssize_t (*pwrite)(struct vfs_handle_struct *handle, struct files_struct *fsp, const void *data, size_t n, SMB_OFF_T offset); SMB_OFF_T (*lseek)(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_OFF_T offset, int whence); ssize_t (*sendfile)(struct vfs_handle_struct *handle, int tofd, files_struct *fromfsp, const DATA_BLOB *header, SMB_OFF_T offset, size_t count); - ssize_t (*recvfile)(struct vfs_handle_struct *handle, int fromfd, files_struct *fsp, int tofd, SMB_OFF_T offset, size_t count); + ssize_t (*recvfile)(struct vfs_handle_struct *handle, int fromfd, files_struct *tofsp, SMB_OFF_T offset, size_t count); int (*rename)(struct vfs_handle_struct *handle, const char *oldname, const char *newname); int (*fsync)(struct vfs_handle_struct *handle, struct files_struct *fsp); int (*stat)(struct vfs_handle_struct *handle, const char *fname, SMB_STRUCT_STAT *sbuf); diff --git a/source3/include/vfs_macros.h b/source3/include/vfs_macros.h index 379d6307e9..9232e94a42 100644 --- a/source3/include/vfs_macros.h +++ b/source3/include/vfs_macros.h @@ -54,7 +54,7 @@ #define SMB_VFS_PWRITE(fsp, data, n, off) ((fsp)->conn->vfs.ops.pwrite((fsp)->conn->vfs.handles.pwrite, (fsp), (data), (n), (off))) #define SMB_VFS_LSEEK(fsp, offset, whence) ((fsp)->conn->vfs.ops.lseek((fsp)->conn->vfs.handles.lseek, (fsp), (offset), (whence))) #define SMB_VFS_SENDFILE(tofd, fromfsp, header, offset, count) ((fsp)->conn->vfs.ops.sendfile((fsp)->conn->vfs.handles.sendfile, (tofd), (fromfsp), (header), (offset), (count))) -#define SMB_VFS_RECVFILE(fromfd, fsp, tofd, offset, count) ((fsp)->conn->vfs.ops.recvfile((fsp)->conn->vfs.handles.recvfile, (fromfd), (fsp), (tofd), (offset), (count))) +#define SMB_VFS_RECVFILE(fromfd, tofsp, offset, count) ((fsp)->conn->vfs.ops.recvfile((fsp)->conn->vfs.handles.recvfile, (fromfd), (tofsp), (offset), (count))) #define SMB_VFS_RENAME(conn, old, new) ((conn)->vfs.ops.rename((conn)->vfs.handles.rename, (old), (new))) #define SMB_VFS_FSYNC(fsp) ((fsp)->conn->vfs.ops.fsync((fsp)->conn->vfs.handles.fsync, (fsp))) #define SMB_VFS_STAT(conn, fname, sbuf) ((conn)->vfs.ops.stat((conn)->vfs.handles.stat, (fname), (sbuf))) @@ -173,7 +173,7 @@ #define SMB_VFS_OPAQUE_PWRITE(fsp, data, n, off) ((fsp)->conn->vfs_opaque.ops.pwrite((fsp)->conn->vfs_opaque.handles.pwrite, (fsp), (data), (n), (off))) #define SMB_VFS_OPAQUE_LSEEK(fsp, offset, whence) ((fsp)->conn->vfs_opaque.ops.lseek((fsp)->conn->vfs_opaque.handles.lseek, (fsp), (offset), (whence))) #define SMB_VFS_OPAQUE_SENDFILE(tofd, fromfsp, header, offset, count) ((fsp)->conn->vfs_opaque.ops.sendfile((fsp)->conn->vfs_opaque.handles.sendfile, (tofd), (fromfsp), (header), (offset), (count))) -#define SMB_VFS_OPAQUE_RECVFILE(fromfd, fsp, tofd, offset, count) ((fsp)->conn->vfs_opaque.ops.recvfile((fsp)->conn->vfs_opaque.handles.recvfile, (fromfd), (fsp), (tofd), (offset), (count))) +#define SMB_VFS_OPAQUE_RECVFILE(fromfd, tofsp, offset, count) ((fsp)->conn->vfs_opaque.ops.recvfile((fsp)->conn->vfs_opaque.handles.recvfile, (fromfd), (tofsp), (offset), (count))) #define SMB_VFS_OPAQUE_RENAME(conn, old, new) ((conn)->vfs_opaque.ops.rename((conn)->vfs_opaque.handles.rename, (old), (new))) #define SMB_VFS_OPAQUE_FSYNC(fsp) ((fsp)->conn->vfs_opaque.ops.fsync((fsp)->conn->vfs_opaque.handles.fsync, (fsp))) #define SMB_VFS_OPAQUE_STAT(conn, fname, sbuf) ((conn)->vfs_opaque.ops.stat((conn)->vfs_opaque.handles.stat, (fname), (sbuf))) @@ -293,7 +293,7 @@ #define SMB_VFS_NEXT_PWRITE(handle, fsp, data, n, off) ((handle)->vfs_next.ops.pwrite((handle)->vfs_next.handles.pwrite, (fsp), (data), (n), (off))) #define SMB_VFS_NEXT_LSEEK(handle, fsp, offset, whence) ((handle)->vfs_next.ops.lseek((handle)->vfs_next.handles.lseek, (fsp), (offset), (whence))) #define SMB_VFS_NEXT_SENDFILE(handle, tofd, fromfsp, header, offset, count) ((handle)->vfs_next.ops.sendfile((handle)->vfs_next.handles.sendfile, (tofd), (fromfsp), (header), (offset), (count))) -#define SMB_VFS_NEXT_RECVFILE(handle, fromfd, fsp, tofd, offset, count) ((handle)->vfs_next.ops.recvfile((handle)->vfs_next.handles.recvfile, (fromfd), (fsp), (tofd), (offset), (count))) +#define SMB_VFS_NEXT_RECVFILE(handle, fromfd, tofsp, offset, count) ((handle)->vfs_next.ops.recvfile((handle)->vfs_next.handles.recvfile, (fromfd), (tofsp), (offset), (count))) #define SMB_VFS_NEXT_RENAME(handle, old, new) ((handle)->vfs_next.ops.rename((handle)->vfs_next.handles.rename, (old), (new))) #define SMB_VFS_NEXT_FSYNC(handle, fsp) ((handle)->vfs_next.ops.fsync((handle)->vfs_next.handles.fsync, (fsp))) #define SMB_VFS_NEXT_STAT(handle, fname, sbuf) ((handle)->vfs_next.ops.stat((handle)->vfs_next.handles.stat, (fname), (sbuf))) diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c index 3a0ed0bebd..e21136ccee 100644 --- a/source3/modules/vfs_default.c +++ b/source3/modules/vfs_default.c @@ -350,15 +350,14 @@ static ssize_t vfswrap_sendfile(vfs_handle_struct *handle, int tofd, files_struc static ssize_t vfswrap_recvfile(vfs_handle_struct *handle, int fromfd, - files_struct *fsp, - int tofd, + files_struct *tofsp, SMB_OFF_T offset, size_t n) { ssize_t result; START_PROFILE_BYTES(syscall_recvfile, n); - result = sys_recvfile(fromfd, tofd, offset, n); + result = sys_recvfile(fromfd, tofsp->fh->fd, offset, n); END_PROFILE(syscall_recvfile); return result; } diff --git a/source3/modules/vfs_full_audit.c b/source3/modules/vfs_full_audit.c index baa5d24a33..5aa9bab5b5 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -128,7 +128,7 @@ static ssize_t smb_full_audit_sendfile(vfs_handle_struct *handle, int tofd, 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, + files_struct *tofsp, SMB_OFF_T offset, size_t n); static int smb_full_audit_rename(vfs_handle_struct *handle, @@ -1164,17 +1164,16 @@ static ssize_t smb_full_audit_sendfile(vfs_handle_struct *handle, int tofd, } static ssize_t smb_full_audit_recvfile(vfs_handle_struct *handle, int fromfd, - files_struct *fsp, int tofd, + files_struct *tofsp, SMB_OFF_T offset, size_t n) { ssize_t result; - result = SMB_VFS_NEXT_RECVFILE(handle, fromfd, fsp, tofd, - offset, n); + result = SMB_VFS_NEXT_RECVFILE(handle, fromfd, tofsp, offset, n); do_log(SMB_VFS_OP_RECVFILE, (result >= 0), handle, - "%s", fsp->fsp_name); + "%s", tofsp->fsp_name); return result; } diff --git a/source3/smbd/vfs.c b/source3/smbd/vfs.c index 1e71da742c..33a3a43aa4 100644 --- a/source3/smbd/vfs.c +++ b/source3/smbd/vfs.c @@ -445,7 +445,6 @@ ssize_t vfs_write_data(struct smb_request *req, req->unread_bytes = 0; return SMB_VFS_RECVFILE(smbd_server_fd(), fsp, - fsp->fh->fd, (SMB_OFF_T)-1, N); } @@ -479,7 +478,6 @@ ssize_t vfs_pwrite_data(struct smb_request *req, req->unread_bytes = 0; return SMB_VFS_RECVFILE(smbd_server_fd(), fsp, - fsp->fh->fd, offset, N); } -- cgit