summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2008-01-07 13:21:26 +0100
committerMichael Adam <obnox@samba.org>2008-01-07 15:59:01 +0100
commit87a684f7fcfa8d9fabc42e33981299d0b33eeeb7 (patch)
tree9c348c30ed24be60e1aa96e725af3f06bf82ad5a /source3
parent8dcce0d236b2102ca94fbcb7aa7126fe6733f2e7 (diff)
downloadsamba-87a684f7fcfa8d9fabc42e33981299d0b33eeeb7.tar.gz
samba-87a684f7fcfa8d9fabc42e33981299d0b33eeeb7.tar.bz2
samba-87a684f7fcfa8d9fabc42e33981299d0b33eeeb7.zip
Remove redundant parameter fd from SMB_VFS_FSTAT().
Michael (This used to be commit 0b86c420be94d295f6917a220b5d699f65b46711)
Diffstat (limited to 'source3')
-rw-r--r--source3/include/vfs.h4
-rw-r--r--source3/include/vfs_macros.h6
-rw-r--r--source3/modules/nfs4_acls.c2
-rw-r--r--source3/modules/vfs_afsacl.c2
-rw-r--r--source3/modules/vfs_commit.c2
-rw-r--r--source3/modules/vfs_default.c8
-rw-r--r--source3/modules/vfs_fake_perms.c4
-rw-r--r--source3/modules/vfs_full_audit.c6
-rw-r--r--source3/modules/vfs_gpfs.c2
-rw-r--r--source3/printing/nt_printing.c4
-rw-r--r--source3/printing/printfsp.c2
-rw-r--r--source3/smbd/fileio.c4
-rw-r--r--source3/smbd/open.c6
-rw-r--r--source3/smbd/posix_acls.c6
-rw-r--r--source3/smbd/reply.c8
-rw-r--r--source3/smbd/trans2.c4
-rw-r--r--source3/smbd/vfs.c4
-rw-r--r--source3/torture/cmd_vfs.c2
18 files changed, 39 insertions, 37 deletions
diff --git a/source3/include/vfs.h b/source3/include/vfs.h
index 4f4e30b614..f4422e4fa9 100644
--- a/source3/include/vfs.h
+++ b/source3/include/vfs.h
@@ -83,6 +83,8 @@
/* Leave at 22 - not yet released. Remove parameter fd from pwrite. - obnox */
/* Leave at 22 - not yet released. Remove parameter fd from lseek. - obnox */
/* Leave at 22 - not yet released. Remove parameter fd from fsync. - obnox */
+/* Leave at 22 - not yet released. Remove parameter fd from fstat. - obnox */
+
#define SMB_VFS_INTERFACE_VERSION 22
@@ -282,7 +284,7 @@ struct vfs_ops {
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);
- int (*fstat)(struct vfs_handle_struct *handle, struct files_struct *fsp, int fd, SMB_STRUCT_STAT *sbuf);
+ int (*fstat)(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_STAT *sbuf);
int (*lstat)(struct vfs_handle_struct *handle, const char *path, SMB_STRUCT_STAT *sbuf);
int (*unlink)(struct vfs_handle_struct *handle, const char *path);
int (*chmod)(struct vfs_handle_struct *handle, const char *path, mode_t mode);
diff --git a/source3/include/vfs_macros.h b/source3/include/vfs_macros.h
index 9ff31e5112..693d464f10 100644
--- a/source3/include/vfs_macros.h
+++ b/source3/include/vfs_macros.h
@@ -58,7 +58,7 @@
#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)))
-#define SMB_VFS_FSTAT(fsp, fd, sbuf) ((fsp)->conn->vfs.ops.fstat((fsp)->conn->vfs.handles.fstat, (fsp) ,(fd) ,(sbuf)))
+#define SMB_VFS_FSTAT(fsp, sbuf) ((fsp)->conn->vfs.ops.fstat((fsp)->conn->vfs.handles.fstat, (fsp), (sbuf)))
#define SMB_VFS_LSTAT(conn, path, sbuf) ((conn)->vfs.ops.lstat((conn)->vfs.handles.lstat, (path), (sbuf)))
#define SMB_VFS_UNLINK(conn, path) ((conn)->vfs.ops.unlink((conn)->vfs.handles.unlink, (path)))
#define SMB_VFS_CHMOD(conn, path, mode) ((conn)->vfs.ops.chmod((conn)->vfs.handles.chmod, (path), (mode)))
@@ -177,7 +177,7 @@
#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)))
-#define SMB_VFS_OPAQUE_FSTAT(fsp, fd, sbuf) ((fsp)->conn->vfs_opaque.ops.fstat((fsp)->conn->vfs_opaque.handles.fstat, (fsp) ,(fd) ,(sbuf)))
+#define SMB_VFS_OPAQUE_FSTAT(fsp, sbuf) ((fsp)->conn->vfs_opaque.ops.fstat((fsp)->conn->vfs_opaque.handles.fstat, (fsp), (sbuf)))
#define SMB_VFS_OPAQUE_LSTAT(conn, path, sbuf) ((conn)->vfs_opaque.ops.lstat((conn)->vfs_opaque.handles.lstat, (path), (sbuf)))
#define SMB_VFS_OPAQUE_UNLINK(conn, path) ((conn)->vfs_opaque.ops.unlink((conn)->vfs_opaque.handles.unlink, (path)))
#define SMB_VFS_OPAQUE_CHMOD(conn, path, mode) ((conn)->vfs_opaque.ops.chmod((conn)->vfs_opaque.handles.chmod, (path), (mode)))
@@ -297,7 +297,7 @@
#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)))
-#define SMB_VFS_NEXT_FSTAT(handle, fsp, fd, sbuf) ((handle)->vfs_next.ops.fstat((handle)->vfs_next.handles.fstat, (fsp) ,(fd) ,(sbuf)))
+#define SMB_VFS_NEXT_FSTAT(handle, fsp, sbuf) ((handle)->vfs_next.ops.fstat((handle)->vfs_next.handles.fstat, (fsp), (sbuf)))
#define SMB_VFS_NEXT_LSTAT(handle, path, sbuf) ((handle)->vfs_next.ops.lstat((handle)->vfs_next.handles.lstat, (path), (sbuf)))
#define SMB_VFS_NEXT_UNLINK(handle, path) ((handle)->vfs_next.ops.unlink((handle)->vfs_next.handles.unlink, (path)))
#define SMB_VFS_NEXT_CHMOD(handle, path, mode) ((handle)->vfs_next.ops.chmod((handle)->vfs_next.handles.chmod, (path), (mode)))
diff --git a/source3/modules/nfs4_acls.c b/source3/modules/nfs4_acls.c
index 6d2972d8ed..52d3983fff 100644
--- a/source3/modules/nfs4_acls.c
+++ b/source3/modules/nfs4_acls.c
@@ -185,7 +185,7 @@ static int smbacl4_fGetFileOwner(files_struct *fsp, SMB_STRUCT_STAT *psbuf)
if (fsp->is_directory || fsp->fh->fd == -1) {
return smbacl4_GetFileOwner(fsp->conn, fsp->fsp_name, psbuf);
}
- if (SMB_VFS_FSTAT(fsp,fsp->fh->fd, psbuf) != 0)
+ if (SMB_VFS_FSTAT(fsp, psbuf) != 0)
{
DEBUG(8, ("SMB_VFS_FSTAT failed with error %s\n",
strerror(errno)));
diff --git a/source3/modules/vfs_afsacl.c b/source3/modules/vfs_afsacl.c
index 90c6a589a1..e35bfabb8c 100644
--- a/source3/modules/vfs_afsacl.c
+++ b/source3/modules/vfs_afsacl.c
@@ -684,7 +684,7 @@ static size_t afs_fto_nt_acl(struct afs_acl *afs_acl,
security_info, ppdesc);
}
- if(SMB_VFS_FSTAT(fsp,fsp->fh->fd,&sbuf) != 0) {
+ if(SMB_VFS_FSTAT(fsp, &sbuf) != 0) {
return 0;
}
diff --git a/source3/modules/vfs_commit.c b/source3/modules/vfs_commit.c
index e445c43181..f79e68f49e 100644
--- a/source3/modules/vfs_commit.c
+++ b/source3/modules/vfs_commit.c
@@ -217,7 +217,7 @@ static int commit_open(
/* EOF commit modes require us to know the initial file size. */
if (c && (c->on_eof != EOF_NONE)) {
SMB_STRUCT_STAT st;
- if (SMB_VFS_FSTAT(fsp, fd, &st) == -1) {
+ if (SMB_VFS_FSTAT(fsp, &st) == -1) {
return -1;
}
c->eof = st.st_size;
diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c
index 8aa1709647..dd3f4ba2cd 100644
--- a/source3/modules/vfs_default.c
+++ b/source3/modules/vfs_default.c
@@ -491,12 +491,12 @@ static int vfswrap_stat(vfs_handle_struct *handle, const char *fname, SMB_STRUC
return result;
}
-static int vfswrap_fstat(vfs_handle_struct *handle, files_struct *fsp, int fd, SMB_STRUCT_STAT *sbuf)
+static int vfswrap_fstat(vfs_handle_struct *handle, files_struct *fsp, SMB_STRUCT_STAT *sbuf)
{
int result;
START_PROFILE(syscall_fstat);
- result = sys_fstat(fd, sbuf);
+ result = sys_fstat(fsp->fh->fd, sbuf);
END_PROFILE(syscall_fstat);
return result;
}
@@ -684,7 +684,7 @@ static int strict_allocate_ftruncate(vfs_handle_struct *handle, files_struct *fs
if (currpos == -1)
return -1;
- if (SMB_VFS_FSTAT(fsp, fd, &st) == -1)
+ if (SMB_VFS_FSTAT(fsp, &st) == -1)
return -1;
space_to_write = len - st.st_size;
@@ -763,7 +763,7 @@ static int vfswrap_ftruncate(vfs_handle_struct *handle, files_struct *fsp, int f
size in which case the ftruncate above should have
succeeded or shorter, in which case seek to len - 1 and
write 1 byte of zero */
- if (SMB_VFS_FSTAT(fsp, fd, &st) == -1) {
+ if (SMB_VFS_FSTAT(fsp, &st) == -1) {
goto done;
}
diff --git a/source3/modules/vfs_fake_perms.c b/source3/modules/vfs_fake_perms.c
index 8157f05d52..ddad0008a7 100644
--- a/source3/modules/vfs_fake_perms.c
+++ b/source3/modules/vfs_fake_perms.c
@@ -46,11 +46,11 @@ static int fake_perms_stat(vfs_handle_struct *handle, const char *fname, SMB_STR
return ret;
}
-static int fake_perms_fstat(vfs_handle_struct *handle, files_struct *fsp, int fd, SMB_STRUCT_STAT *sbuf)
+static int fake_perms_fstat(vfs_handle_struct *handle, files_struct *fsp, SMB_STRUCT_STAT *sbuf)
{
int ret = -1;
- ret = SMB_VFS_NEXT_FSTAT(handle, fsp, fd, sbuf);
+ ret = SMB_VFS_NEXT_FSTAT(handle, fsp, sbuf);
if (ret == 0) {
if (S_ISDIR(sbuf->st_mode)) {
sbuf->st_mode = S_IFDIR | S_IRWXU;
diff --git a/source3/modules/vfs_full_audit.c b/source3/modules/vfs_full_audit.c
index 396b2bbb68..7464bf80b3 100644
--- a/source3/modules/vfs_full_audit.c
+++ b/source3/modules/vfs_full_audit.c
@@ -136,7 +136,7 @@ static int smb_full_audit_rename(vfs_handle_struct *handle,
static int smb_full_audit_fsync(vfs_handle_struct *handle, files_struct *fsp);
static int smb_full_audit_stat(vfs_handle_struct *handle,
const char *fname, SMB_STRUCT_STAT *sbuf);
-static int smb_full_audit_fstat(vfs_handle_struct *handle, files_struct *fsp, int fd,
+static int smb_full_audit_fstat(vfs_handle_struct *handle, files_struct *fsp,
SMB_STRUCT_STAT *sbuf);
static int smb_full_audit_lstat(vfs_handle_struct *handle,
const char *path, SMB_STRUCT_STAT *sbuf);
@@ -1216,12 +1216,12 @@ static int smb_full_audit_stat(vfs_handle_struct *handle,
return result;
}
-static int smb_full_audit_fstat(vfs_handle_struct *handle, files_struct *fsp, int fd,
+static int smb_full_audit_fstat(vfs_handle_struct *handle, files_struct *fsp,
SMB_STRUCT_STAT *sbuf)
{
int result;
- result = SMB_VFS_NEXT_FSTAT(handle, fsp, fd, sbuf);
+ result = SMB_VFS_NEXT_FSTAT(handle, fsp, sbuf);
do_log(SMB_VFS_OP_FSTAT, (result >= 0), handle, "%s", fsp->fsp_name);
diff --git a/source3/modules/vfs_gpfs.c b/source3/modules/vfs_gpfs.c
index 0f7dc81ae6..500a6ee772 100644
--- a/source3/modules/vfs_gpfs.c
+++ b/source3/modules/vfs_gpfs.c
@@ -645,7 +645,7 @@ static int vfs_gpfs_chmod(vfs_handle_struct *handle, const char *path, mode_t mo
static int vfs_gpfs_fchmod(vfs_handle_struct *handle, files_struct *fsp, int fd, mode_t mode)
{
SMB_STRUCT_STAT st;
- if (SMB_VFS_NEXT_FSTAT(handle, fsp, fd, &st) != 0) {
+ if (SMB_VFS_NEXT_FSTAT(handle, fsp, &st) != 0) {
return -1;
}
/* avoid chmod() if possible, to preserve acls */
diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c
index b661b6fd56..1a4a26ee6f 100644
--- a/source3/printing/nt_printing.c
+++ b/source3/printing/nt_printing.c
@@ -1360,7 +1360,7 @@ static int file_version_is_newer(connection_struct *conn, fstring new_file, fstr
DEBUG(6,("file_version_is_newer: Version info not found [%s], use mod time\n",
old_file));
use_version = false;
- if (SMB_VFS_FSTAT(fsp, fsp->fh->fd, &st) == -1) {
+ if (SMB_VFS_FSTAT(fsp, &st) == -1) {
goto error_exit;
}
old_create_time = st.st_mtime;
@@ -1400,7 +1400,7 @@ static int file_version_is_newer(connection_struct *conn, fstring new_file, fstr
DEBUG(6,("file_version_is_newer: Version info not found [%s], use mod time\n",
new_file));
use_version = false;
- if (SMB_VFS_FSTAT(fsp, fsp->fh->fd, &st) == -1) {
+ if (SMB_VFS_FSTAT(fsp, &st) == -1) {
goto error_exit;
}
new_create_time = st.st_mtime;
diff --git a/source3/printing/printfsp.c b/source3/printing/printfsp.c
index 337fd4f74b..1fde16b802 100644
--- a/source3/printing/printfsp.c
+++ b/source3/printing/printfsp.c
@@ -83,7 +83,7 @@ NTSTATUS print_fsp_open(connection_struct *conn, const char *fname,
fsp->is_directory = False;
string_set(&fsp->fsp_name,print_job_fname(lp_const_servicename(SNUM(conn)),jobid));
fsp->wcp = NULL;
- SMB_VFS_FSTAT(fsp,fsp->fh->fd, &sbuf);
+ SMB_VFS_FSTAT(fsp, &sbuf);
fsp->mode = sbuf.st_mode;
fsp->file_id = vfs_file_id_from_sbuf(conn, &sbuf);
diff --git a/source3/smbd/fileio.c b/source3/smbd/fileio.c
index 5a4263739b..1258b73cad 100644
--- a/source3/smbd/fileio.c
+++ b/source3/smbd/fileio.c
@@ -229,7 +229,7 @@ ssize_t write_file(struct smb_request *req,
SMB_STRUCT_STAT st;
fsp->modified = True;
- if (SMB_VFS_FSTAT(fsp,fsp->fh->fd,&st) == 0) {
+ if (SMB_VFS_FSTAT(fsp, &st) == 0) {
int dosmode = dos_mode(fsp->conn,fsp->fsp_name,&st);
if ((lp_store_dos_attributes(SNUM(fsp->conn)) ||
MAP_ARCHIVE(fsp->conn)) &&
@@ -896,6 +896,6 @@ int fsp_stat(files_struct *fsp, SMB_STRUCT_STAT *pst)
if (fsp->fh->fd == -1) {
return SMB_VFS_STAT(fsp->conn, fsp->fsp_name, pst);
} else {
- return SMB_VFS_FSTAT(fsp,fsp->fh->fd, pst);
+ return SMB_VFS_FSTAT(fsp, pst);
}
}
diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index 23d0223446..d870374835 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -342,7 +342,7 @@ static NTSTATUS open_file(files_struct *fsp,
if (fsp->fh->fd == -1) {
ret = SMB_VFS_STAT(conn, path, psbuf);
} else {
- ret = SMB_VFS_FSTAT(fsp,fsp->fh->fd,psbuf);
+ ret = SMB_VFS_FSTAT(fsp, psbuf);
/* If we have an fd, this stat should succeed. */
if (ret == -1) {
DEBUG(0,("Error doing fstat on open file %s "
@@ -1790,7 +1790,7 @@ NTSTATUS open_file_ntcreate(connection_struct *conn,
* struct..
*/
if ((SMB_VFS_FTRUNCATE(fsp,fsp->fh->fd,0) == -1) ||
- (SMB_VFS_FSTAT(fsp,fsp->fh->fd,psbuf)==-1)) {
+ (SMB_VFS_FSTAT(fsp, psbuf)==-1)) {
status = map_nt_error_from_unix(errno);
TALLOC_FREE(lck);
fd_close(fsp);
@@ -2675,7 +2675,7 @@ NTSTATUS create_file_unixpath(connection_struct *conn,
*psbuf = sbuf;
}
else {
- SMB_VFS_FSTAT(fsp, fsp->fh->fd, psbuf);
+ SMB_VFS_FSTAT(fsp, psbuf);
}
}
return NT_STATUS_OK;
diff --git a/source3/smbd/posix_acls.c b/source3/smbd/posix_acls.c
index 2810b5e587..f11aa69e08 100644
--- a/source3/smbd/posix_acls.c
+++ b/source3/smbd/posix_acls.c
@@ -3080,7 +3080,7 @@ NTSTATUS posix_fget_nt_acl(struct files_struct *fsp, uint32_t security_info,
}
/* Get the stat struct for the owner info. */
- if(SMB_VFS_FSTAT(fsp,fsp->fh->fd,&sbuf) != 0) {
+ if(SMB_VFS_FSTAT(fsp, &sbuf) != 0) {
return map_nt_error_from_unix(errno);
}
@@ -3429,7 +3429,7 @@ NTSTATUS set_nt_acl(files_struct *fsp, uint32 security_info_sent, SEC_DESC *psd)
if(SMB_VFS_STAT(fsp->conn,fsp->fsp_name, &sbuf) != 0)
return map_nt_error_from_unix(errno);
} else {
- if(SMB_VFS_FSTAT(fsp,fsp->fh->fd,&sbuf) != 0)
+ if(SMB_VFS_FSTAT(fsp, &sbuf) != 0)
return map_nt_error_from_unix(errno);
}
@@ -3479,7 +3479,7 @@ NTSTATUS set_nt_acl(files_struct *fsp, uint32 security_info_sent, SEC_DESC *psd)
if(fsp->fh->fd == -1)
ret = SMB_VFS_STAT(fsp->conn, fsp->fsp_name, &sbuf);
else
- ret = SMB_VFS_FSTAT(fsp,fsp->fh->fd,&sbuf);
+ ret = SMB_VFS_FSTAT(fsp, &sbuf);
if(ret != 0)
return map_nt_error_from_unix(errno);
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index 910e3a27a6..27f380a627 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -2835,7 +2835,7 @@ void reply_readbraw(struct smb_request *req)
return;
}
- if (SMB_VFS_FSTAT(fsp,fsp->fh->fd,&st) == 0) {
+ if (SMB_VFS_FSTAT(fsp, &st) == 0) {
size = st.st_size;
}
@@ -3096,7 +3096,7 @@ static void send_file_readX(connection_struct *conn, struct smb_request *req,
SMB_STRUCT_STAT sbuf;
ssize_t nread = -1;
- if(SMB_VFS_FSTAT(fsp,fsp->fh->fd, &sbuf) == -1) {
+ if(SMB_VFS_FSTAT(fsp, &sbuf) == -1) {
reply_unixerror(req, ERRDOS, ERRnoaccess);
return;
}
@@ -4096,7 +4096,7 @@ void reply_lseek(struct smb_request *req)
SMB_OFF_T current_pos = startpos;
SMB_STRUCT_STAT sbuf;
- if(SMB_VFS_FSTAT(fsp,fsp->fh->fd, &sbuf) == -1) {
+ if(SMB_VFS_FSTAT(fsp, &sbuf) == -1) {
reply_unixerror(req, ERRDOS,
ERRnoaccess);
END_PROFILE(SMBlseek);
@@ -5485,7 +5485,7 @@ NTSTATUS rename_internals_fsp(connection_struct *conn,
/* Ensure we have a valid stat struct for the source. */
if (fsp->fh->fd != -1) {
- if (SMB_VFS_FSTAT(fsp,fsp->fh->fd,&sbuf) == -1) {
+ if (SMB_VFS_FSTAT(fsp, &sbuf) == -1) {
return map_nt_error_from_unix(errno);
}
} else {
diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c
index c3b5f9fa2f..ab6706aec7 100644
--- a/source3/smbd/trans2.c
+++ b/source3/smbd/trans2.c
@@ -3663,7 +3663,7 @@ static void call_trans2qfilepathinfo(connection_struct *conn,
return;
}
- if (SMB_VFS_FSTAT(fsp,fsp->fh->fd,&sbuf) != 0) {
+ if (SMB_VFS_FSTAT(fsp, &sbuf) != 0) {
DEBUG(3,("fstat of fnum %d failed (%s)\n", fsp->fnum, strerror(errno)));
reply_unixerror(req, ERRDOS, ERRbadfid);
return;
@@ -6346,7 +6346,7 @@ static void call_trans2setfilepathinfo(connection_struct *conn,
return;
}
- if (SMB_VFS_FSTAT(fsp, fsp->fh->fd, &sbuf) != 0) {
+ if (SMB_VFS_FSTAT(fsp, &sbuf) != 0) {
DEBUG(3,("call_trans2setfilepathinfo: fstat of fnum %d failed (%s)\n",fsp->fnum, strerror(errno)));
reply_unixerror(req, ERRDOS, ERRbadfid);
return;
diff --git a/source3/smbd/vfs.c b/source3/smbd/vfs.c
index aa914797d1..c7edac7b7a 100644
--- a/source3/smbd/vfs.c
+++ b/source3/smbd/vfs.c
@@ -525,7 +525,7 @@ int vfs_allocate_file_space(files_struct *fsp, SMB_BIG_UINT len)
return -1;
}
- ret = SMB_VFS_FSTAT(fsp,fsp->fh->fd,&st);
+ ret = SMB_VFS_FSTAT(fsp, &st);
if (ret == -1)
return ret;
@@ -612,7 +612,7 @@ int vfs_fill_sparse(files_struct *fsp, SMB_OFF_T len)
ssize_t pwrite_ret;
release_level_2_oplocks_on_change(fsp);
- ret = SMB_VFS_FSTAT(fsp,fsp->fh->fd,&st);
+ ret = SMB_VFS_FSTAT(fsp, &st);
if (ret == -1) {
return ret;
}
diff --git a/source3/torture/cmd_vfs.c b/source3/torture/cmd_vfs.c
index 17f4b9bfc0..7c8d070e06 100644
--- a/source3/torture/cmd_vfs.c
+++ b/source3/torture/cmd_vfs.c
@@ -572,7 +572,7 @@ static NTSTATUS cmd_fstat(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc,
return NT_STATUS_OK;
}
- if (SMB_VFS_FSTAT(vfs->files[fd], fd, &st) == -1) {
+ if (SMB_VFS_FSTAT(vfs->files[fd], &st) == -1) {
printf("fstat: error=%d (%s)\n", errno, strerror(errno));
return NT_STATUS_UNSUCCESSFUL;
}