summaryrefslogtreecommitdiff
path: root/source3/modules
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2008-01-07 15:55:09 +0100
committerMichael Adam <obnox@samba.org>2008-01-07 15:59:02 +0100
commitb457b94bb86897b7020c6f300cd19a3d8e192610 (patch)
tree11528c1749b30edd0785f38bea7ad31063246ae2 /source3/modules
parent670909cb07e38a06bf5db12342b3b1189f0e1ab7 (diff)
downloadsamba-b457b94bb86897b7020c6f300cd19a3d8e192610.tar.gz
samba-b457b94bb86897b7020c6f300cd19a3d8e192610.tar.bz2
samba-b457b94bb86897b7020c6f300cd19a3d8e192610.zip
Remove redundant parameter fd from SMB_VFS_FTRUNCATE().
Michael (This used to be commit 2ad66050a0452b8e7e08b1e7a01efa00c72fd451)
Diffstat (limited to 'source3/modules')
-rw-r--r--source3/modules/vfs_commit.c3
-rw-r--r--source3/modules/vfs_default.c12
-rw-r--r--source3/modules/vfs_full_audit.c6
-rw-r--r--source3/modules/vfs_prealloc.c3
4 files changed, 11 insertions, 13 deletions
diff --git a/source3/modules/vfs_commit.c b/source3/modules/vfs_commit.c
index f79e68f49e..fe7324122f 100644
--- a/source3/modules/vfs_commit.c
+++ b/source3/modules/vfs_commit.c
@@ -277,12 +277,11 @@ static int commit_close(
static int commit_ftruncate(
vfs_handle_struct * handle,
files_struct * fsp,
- int fd,
SMB_OFF_T len)
{
int result;
- result = SMB_VFS_NEXT_FTRUNCATE(handle, fsp, fd, len);
+ result = SMB_VFS_NEXT_FTRUNCATE(handle, fsp, len);
if (result == 0) {
struct commit_info *c;
if ((c = VFS_FETCH_FSP_EXTENSION(handle, fsp))) {
diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c
index f66f77cd47..6ac8cc5def 100644
--- a/source3/modules/vfs_default.c
+++ b/source3/modules/vfs_default.c
@@ -674,7 +674,7 @@ static int vfswrap_ntimes(vfs_handle_struct *handle, const char *path, const str
allocate is set.
**********************************************************************/
-static int strict_allocate_ftruncate(vfs_handle_struct *handle, files_struct *fsp, int fd, SMB_OFF_T len)
+static int strict_allocate_ftruncate(vfs_handle_struct *handle, files_struct *fsp, SMB_OFF_T len)
{
SMB_STRUCT_STAT st;
SMB_OFF_T currpos = SMB_VFS_LSEEK(fsp, 0, SEEK_CUR);
@@ -699,7 +699,7 @@ static int strict_allocate_ftruncate(vfs_handle_struct *handle, files_struct *fs
/* Shrink - just ftruncate. */
if (st.st_size > len)
- return sys_ftruncate(fd, len);
+ return sys_ftruncate(fsp->fh->fd, len);
/* Write out the real space on disk. */
if (SMB_VFS_LSEEK(fsp, st.st_size, SEEK_SET) != st.st_size)
@@ -726,7 +726,7 @@ static int strict_allocate_ftruncate(vfs_handle_struct *handle, files_struct *fs
return 0;
}
-static int vfswrap_ftruncate(vfs_handle_struct *handle, files_struct *fsp, int fd, SMB_OFF_T len)
+static int vfswrap_ftruncate(vfs_handle_struct *handle, files_struct *fsp, SMB_OFF_T len)
{
int result = -1;
SMB_STRUCT_STAT st;
@@ -736,7 +736,7 @@ static int vfswrap_ftruncate(vfs_handle_struct *handle, files_struct *fsp, int f
START_PROFILE(syscall_ftruncate);
if (lp_strict_allocate(SNUM(fsp->conn))) {
- result = strict_allocate_ftruncate(handle, fsp, fd, len);
+ result = strict_allocate_ftruncate(handle, fsp, fsp->fh->fd, len);
END_PROFILE(syscall_ftruncate);
return result;
}
@@ -747,7 +747,7 @@ static int vfswrap_ftruncate(vfs_handle_struct *handle, files_struct *fsp, int f
expansion and some that don't! On Linux fat can't do
ftruncate extend but ext2 can. */
- result = sys_ftruncate(fd, len);
+ result = sys_ftruncate(fsp->fh->fd, len);
if (result == 0)
goto done;
@@ -787,7 +787,7 @@ static int vfswrap_ftruncate(vfs_handle_struct *handle, files_struct *fsp, int f
if (SMB_VFS_LSEEK(fsp, len-1, SEEK_SET) != len -1)
goto done;
- if (SMB_VFS_WRITE(fsp, fd, &c, 1)!=1)
+ if (SMB_VFS_WRITE(fsp, fsp->fh->fd, &c, 1)!=1)
goto done;
/* Seek to where we were */
diff --git a/source3/modules/vfs_full_audit.c b/source3/modules/vfs_full_audit.c
index f7796adba0..1384c16290 100644
--- a/source3/modules/vfs_full_audit.c
+++ b/source3/modules/vfs_full_audit.c
@@ -159,7 +159,7 @@ static char *smb_full_audit_getwd(vfs_handle_struct *handle,
static int smb_full_audit_ntimes(vfs_handle_struct *handle,
const char *path, const struct timespec ts[2]);
static int smb_full_audit_ftruncate(vfs_handle_struct *handle, files_struct *fsp,
- int fd, SMB_OFF_T len);
+ SMB_OFF_T len);
static bool smb_full_audit_lock(vfs_handle_struct *handle, files_struct *fsp, int fd,
int op, SMB_OFF_T offset, SMB_OFF_T count, int type);
static int smb_full_audit_kernel_flock(struct vfs_handle_struct *handle,
@@ -1353,11 +1353,11 @@ static int smb_full_audit_ntimes(vfs_handle_struct *handle,
}
static int smb_full_audit_ftruncate(vfs_handle_struct *handle, files_struct *fsp,
- int fd, SMB_OFF_T len)
+ SMB_OFF_T len)
{
int result;
- result = SMB_VFS_NEXT_FTRUNCATE(handle, fsp, fd, len);
+ result = SMB_VFS_NEXT_FTRUNCATE(handle, fsp, len);
do_log(SMB_VFS_OP_FTRUNCATE, (result >= 0), handle,
"%s", fsp->fsp_name);
diff --git a/source3/modules/vfs_prealloc.c b/source3/modules/vfs_prealloc.c
index cebf3a3933..2d64bc0184 100644
--- a/source3/modules/vfs_prealloc.c
+++ b/source3/modules/vfs_prealloc.c
@@ -184,11 +184,10 @@ normal_open:
static int prealloc_ftruncate(vfs_handle_struct * handle,
files_struct * fsp,
- int fd,
SMB_OFF_T offset)
{
SMB_OFF_T *psize;
- int ret = SMB_VFS_NEXT_FTRUNCATE(handle, fsp, fd, offset);
+ int ret = SMB_VFS_NEXT_FTRUNCATE(handle, fsp, offset);
/* Maintain the allocated space even in the face of truncates. */
if ((psize = VFS_FETCH_FSP_EXTENSION(handle, fsp))) {