From 1d66f4d58b5fdd9c4e0c022cd2724e05d144510b Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Thu, 10 Jan 2008 15:33:51 +0100 Subject: Remove redundant parameter fd from SMB_VFS_READ(). Michael (This used to be commit a8fc2ddad8d5f7c6c00cb36c74a32a02d69d1d04) --- source3/modules/vfs_default.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'source3/modules/vfs_default.c') diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c index 97138bdacf..920c05c338 100644 --- a/source3/modules/vfs_default.c +++ b/source3/modules/vfs_default.c @@ -208,12 +208,12 @@ static int vfswrap_close(vfs_handle_struct *handle, files_struct *fsp, int fd) return result; } -static ssize_t vfswrap_read(vfs_handle_struct *handle, files_struct *fsp, int fd, void *data, size_t n) +static ssize_t vfswrap_read(vfs_handle_struct *handle, files_struct *fsp, void *data, size_t n) { ssize_t result; START_PROFILE_BYTES(syscall_read, n); - result = sys_read(fd, data, n); + result = sys_read(fsp->fh->fd, data, n); END_PROFILE(syscall_read); return result; } @@ -230,7 +230,7 @@ static ssize_t vfswrap_pread(vfs_handle_struct *handle, files_struct *fsp, void if (result == -1 && errno == ESPIPE) { /* Maintain the fiction that pipes can be seeked (sought?) on. */ - result = SMB_VFS_READ(fsp, fsp->fh->fd, data, n); + result = SMB_VFS_READ(fsp, data, n); fsp->fh->pos = 0; } @@ -241,7 +241,7 @@ static ssize_t vfswrap_pread(vfs_handle_struct *handle, files_struct *fsp, void curr = SMB_VFS_LSEEK(fsp, 0, SEEK_CUR); if (curr == -1 && errno == ESPIPE) { /* Maintain the fiction that pipes can be seeked (sought?) on. */ - result = SMB_VFS_READ(fsp, fsp->fh->fd, data, n); + result = SMB_VFS_READ(fsp, data, n); fsp->fh->pos = 0; return result; } @@ -251,7 +251,7 @@ static ssize_t vfswrap_pread(vfs_handle_struct *handle, files_struct *fsp, void } errno = 0; - result = SMB_VFS_READ(fsp, fsp->fh->fd, data, n); + result = SMB_VFS_READ(fsp, data, n); lerrno = errno; SMB_VFS_LSEEK(fsp, curr, SEEK_SET); -- cgit From e9a3a62e7448bef72d9c17c90ff2b404082f067c Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Thu, 10 Jan 2008 15:49:35 +0100 Subject: Remove redundant parameter fd from SMB_VFS_WRITE(). Michael (This used to be commit c8ae7d095a2a6a7eac920a68ca7244e3a423e1b1) --- source3/modules/vfs_default.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'source3/modules/vfs_default.c') diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c index 920c05c338..e57d24cb1a 100644 --- a/source3/modules/vfs_default.c +++ b/source3/modules/vfs_default.c @@ -262,12 +262,12 @@ static ssize_t vfswrap_pread(vfs_handle_struct *handle, files_struct *fsp, void return result; } -static ssize_t vfswrap_write(vfs_handle_struct *handle, files_struct *fsp, int fd, const void *data, size_t n) +static ssize_t vfswrap_write(vfs_handle_struct *handle, files_struct *fsp, const void *data, size_t n) { ssize_t result; START_PROFILE_BYTES(syscall_write, n); - result = sys_write(fd, data, n); + result = sys_write(fsp->fh->fd, data, n); END_PROFILE(syscall_write); return result; } @@ -284,7 +284,7 @@ static ssize_t vfswrap_pwrite(vfs_handle_struct *handle, files_struct *fsp, cons if (result == -1 && errno == ESPIPE) { /* Maintain the fiction that pipes can be sought on. */ - result = SMB_VFS_WRITE(fsp, fsp->fh->fd, data, n); + result = SMB_VFS_WRITE(fsp, data, n); } #else /* HAVE_PWRITE */ @@ -300,7 +300,7 @@ static ssize_t vfswrap_pwrite(vfs_handle_struct *handle, files_struct *fsp, cons return -1; } - result = SMB_VFS_WRITE(fsp, fsp->fh->fd, data, n); + result = SMB_VFS_WRITE(fsp, data, n); lerrno = errno; SMB_VFS_LSEEK(fsp, curr, SEEK_SET); @@ -712,7 +712,7 @@ static int strict_allocate_ftruncate(vfs_handle_struct *handle, files_struct *fs SMB_OFF_T retlen; SMB_OFF_T current_len_to_write = MIN(sizeof(zero_space),space_to_write); - retlen = SMB_VFS_WRITE(fsp,fsp->fh->fd,(char *)zero_space,current_len_to_write); + retlen = SMB_VFS_WRITE(fsp,(char *)zero_space,current_len_to_write); if (retlen <= 0) return -1; @@ -787,7 +787,7 @@ static int vfswrap_ftruncate(vfs_handle_struct *handle, files_struct *fsp, SMB_O if (SMB_VFS_LSEEK(fsp, len-1, SEEK_SET) != len -1) goto done; - if (SMB_VFS_WRITE(fsp, fsp->fh->fd, &c, 1)!=1) + if (SMB_VFS_WRITE(fsp, &c, 1)!=1) goto done; /* Seek to where we were */ -- cgit 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/modules/vfs_default.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/modules/vfs_default.c') 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; } -- 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/modules/vfs_default.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'source3/modules/vfs_default.c') 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; } -- cgit