Remove redundant parameter fd from SMB_VFS_FSTAT().
authorMichael Adam <obnox@samba.org>
Mon, 7 Jan 2008 12:21:26 +0000 (13:21 +0100)
committerMichael Adam <obnox@samba.org>
Mon, 7 Jan 2008 14:59:01 +0000 (15:59 +0100)
Michael

20 files changed:
examples/VFS/skel_opaque.c
examples/VFS/skel_transparent.c
source/include/vfs.h
source/include/vfs_macros.h
source/modules/nfs4_acls.c
source/modules/vfs_afsacl.c
source/modules/vfs_commit.c
source/modules/vfs_default.c
source/modules/vfs_fake_perms.c
source/modules/vfs_full_audit.c
source/modules/vfs_gpfs.c
source/printing/nt_printing.c
source/printing/printfsp.c
source/smbd/fileio.c
source/smbd/open.c
source/smbd/posix_acls.c
source/smbd/reply.c
source/smbd/trans2.c
source/smbd/vfs.c
source/torture/cmd_vfs.c

index 2ae24312b4661207efdd843e0601444599a31882..361cf207d3d5c9ac85123f2b2ac5218dc8d9e131 100644 (file)
@@ -181,9 +181,9 @@ static int skel_stat(vfs_handle_struct *handle,  const char *fname, SMB_STRUCT_S
        return vfswrap_stat(NULL,  fname, sbuf);
 }
 
-static int skel_fstat(vfs_handle_struct *handle, files_struct *fsp, int fd, SMB_STRUCT_STAT *sbuf)
+static int skel_fstat(vfs_handle_struct *handle, files_struct *fsp, SMB_STRUCT_STAT *sbuf)
 {
-       return vfswrap_fstat(NULL, fsp, fd, sbuf);
+       return vfswrap_fstat(NULL, fsp, sbuf);
 }
 
 static int skel_lstat(vfs_handle_struct *handle,  const char *path, SMB_STRUCT_STAT *sbuf)
index ea203125146307a1d207bc1ab3a1fe3e2f1177f4..72ca6f2056c038af691ec39a9e846f0a086db8a7 100644 (file)
@@ -174,9 +174,9 @@ static int skel_stat(vfs_handle_struct *handle,  const char *fname, SMB_STRUCT_S
        return SMB_VFS_NEXT_STAT(handle, fname, sbuf);
 }
 
-static int skel_fstat(vfs_handle_struct *handle, files_struct *fsp, int fd, SMB_STRUCT_STAT *sbuf)
+static int skel_fstat(vfs_handle_struct *handle, files_struct *fsp, SMB_STRUCT_STAT *sbuf)
 {
-       return SMB_VFS_NEXT_FSTAT(handle, fsp, fd, sbuf);
+       return SMB_VFS_NEXT_FSTAT(handle, fsp, sbuf);
 }
 
 static int skel_lstat(vfs_handle_struct *handle,  const char *path, SMB_STRUCT_STAT *sbuf)
index 4f4e30b61426b5e9803a208362f1aa32e4ae899c..f4422e4fa96910ffd2023f77cf1724e91368593a 100644 (file)
@@ -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);
index 9ff31e51121d9166eeaa8586632ed6a2450db449..693d464f1085e5b0275dd434933c09df7f5823ee 100644 (file)
@@ -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)))
 #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)))
 #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)))
index 6d2972d8ed91d9e547d688cfa9305070ba5f7347..52d3983fff7ee43239b5742b16fe98dfe67ede78 100644 (file)
@@ -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)));
index 90c6a589a1b46488071caff4f6f722d5c3d13135..e35bfabb8c7a8df88b33c4d152c814989b42eabc 100644 (file)
@@ -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;
        }
 
index e445c431814217a8bade8d360887f008b0738d0e..f79e68f49e429e36107f8f5908b79bdf6d99a12d 100644 (file)
@@ -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;
index 8aa17096474011a89e791ce8fe95beb9bff9fe6d..dd3f4ba2cdeca3b4ae725543684260c2d9823aa1 100644 (file)
@@ -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;
        }
 
index 8157f05d52eb4ce107aff238ce71e05ebcfc454e..ddad0008a7ef55d1a8a3763b5e9b19f3690dbac4 100644 (file)
@@ -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;
index 396b2bbb689f4ef4e5ee6a658960c10e17753ca3..7464bf80b305f563359754e123aa6c72f69987a8 100644 (file)
@@ -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);
 
index 0f7dc81ae6d0f7fb25426b4b26e54c2eddc02d08..500a6ee7722672697789d35c0122992656e025bd 100644 (file)
@@ -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 */
index b661b6fd566ad2e3ccfaabbedd8cc60badaca213..1a4a26ee6f2c226e8177d14f666dd5bbf16d1a46 100644 (file)
@@ -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;
index 337fd4f74b4cb63b71c00960a729a7ba638955f7..1fde16b802d79040876246cd542b308dbc9c37f2 100644 (file)
@@ -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);
 
index 5a4263739be814695d28a8cb5be052a7a925c45b..1258b73cada9cf0b786778052cde2e8f594f78dc 100644 (file)
@@ -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);
        }
 }
index 23d0223446d4b76fe297847f0c93af735e9255a2..d870374835659e8b581d52524e1af8dd29e7298e 100644 (file)
@@ -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;
index 2810b5e587c77e2114bf859d1f1f84460d6a300b..f11aa69e08ac11a8fc48de4e9144d62f4a85e62a 100644 (file)
@@ -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);
index 910e3a27a6b9c55ebb8c8a3ae2d64440630676b2..27f380a627592c670e8433061db0afba1fc44d92 100644 (file)
@@ -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 {
index c3b5f9fa2f02d50ea13f4a96a7393d56d2ba7721..ab6706aec7b219550ffe1c624f30d292266c5b92 100644 (file)
@@ -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;
index aa914797d1d3432e08e37142ca9cd5359267f0b4..c7edac7b7a0a60a3d9858e0840f44c504c339f71 100644 (file)
@@ -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;
        }
index 17f4b9bfc0ec1982ec420f4849feb7ac2911b7bf..7c8d070e067434ac9dc132af221b23263ec5295e 100644 (file)
@@ -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;
        }