summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--examples/VFS/skel_opaque.c4
-rw-r--r--examples/VFS/skel_transparent.c4
-rw-r--r--source3/include/vfs.h3
-rw-r--r--source3/include/vfs_macros.h6
-rw-r--r--source3/modules/vfs_default.c4
-rw-r--r--source3/modules/vfs_full_audit.c6
-rw-r--r--source3/smbd/fileio.c2
-rw-r--r--source3/torture/cmd_vfs.c2
8 files changed, 16 insertions, 15 deletions
diff --git a/examples/VFS/skel_opaque.c b/examples/VFS/skel_opaque.c
index ea525bf2dd..2ae24312b4 100644
--- a/examples/VFS/skel_opaque.c
+++ b/examples/VFS/skel_opaque.c
@@ -171,9 +171,9 @@ static int skel_rename(vfs_handle_struct *handle, const char *oldname, const ch
return vfswrap_rename(NULL, oldname, newname);
}
-static int skel_fsync(vfs_handle_struct *handle, files_struct *fsp, int fd)
+static int skel_fsync(vfs_handle_struct *handle, files_struct *fsp)
{
- return vfswrap_fsync(NULL, fsp, fd);
+ return vfswrap_fsync(NULL, fsp);
}
static int skel_stat(vfs_handle_struct *handle, const char *fname, SMB_STRUCT_STAT *sbuf)
diff --git a/examples/VFS/skel_transparent.c b/examples/VFS/skel_transparent.c
index 8772718a74..ea20312514 100644
--- a/examples/VFS/skel_transparent.c
+++ b/examples/VFS/skel_transparent.c
@@ -164,9 +164,9 @@ static int skel_rename(vfs_handle_struct *handle, const char *oldname, const ch
return SMB_VFS_NEXT_RENAME(handle, oldname, newname);
}
-static int skel_fsync(vfs_handle_struct *handle, files_struct *fsp, int fd)
+static int skel_fsync(vfs_handle_struct *handle, files_struct *fsp)
{
- return SMB_VFS_NEXT_FSYNC(handle, fsp, fd);
+ return SMB_VFS_NEXT_FSYNC(handle, fsp);
}
static int skel_stat(vfs_handle_struct *handle, const char *fname, SMB_STRUCT_STAT *sbuf)
diff --git a/source3/include/vfs.h b/source3/include/vfs.h
index 279841e501..4f4e30b614 100644
--- a/source3/include/vfs.h
+++ b/source3/include/vfs.h
@@ -82,6 +82,7 @@
/* Leave at 22 - not yet released. Remove parameter fd from pread. - obnox */
/* 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 */
#define SMB_VFS_INTERFACE_VERSION 22
@@ -279,7 +280,7 @@ struct vfs_ops {
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 (*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, int fd);
+ 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 (*lstat)(struct vfs_handle_struct *handle, const char *path, SMB_STRUCT_STAT *sbuf);
diff --git a/source3/include/vfs_macros.h b/source3/include/vfs_macros.h
index 2a8d0354d8..9ff31e5112 100644
--- a/source3/include/vfs_macros.h
+++ b/source3/include/vfs_macros.h
@@ -56,7 +56,7 @@
#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_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, fd) ((fsp)->conn->vfs.ops.fsync((fsp)->conn->vfs.handles.fsync, (fsp), (fd)))
+#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_LSTAT(conn, path, sbuf) ((conn)->vfs.ops.lstat((conn)->vfs.handles.lstat, (path), (sbuf)))
@@ -175,7 +175,7 @@
#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_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, fd) ((fsp)->conn->vfs_opaque.ops.fsync((fsp)->conn->vfs_opaque.handles.fsync, (fsp), (fd)))
+#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_LSTAT(conn, path, sbuf) ((conn)->vfs_opaque.ops.lstat((conn)->vfs_opaque.handles.lstat, (path), (sbuf)))
@@ -295,7 +295,7 @@
#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_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, fd) ((handle)->vfs_next.ops.fsync((handle)->vfs_next.handles.fsync, (fsp), (fd)))
+#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_LSTAT(handle, path, sbuf) ((handle)->vfs_next.ops.lstat((handle)->vfs_next.handles.lstat, (path), (sbuf)))
diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c
index 41162e67ca..8aa1709647 100644
--- a/source3/modules/vfs_default.c
+++ b/source3/modules/vfs_default.c
@@ -467,13 +467,13 @@ static int vfswrap_rename(vfs_handle_struct *handle, const char *oldname, const
return result;
}
-static int vfswrap_fsync(vfs_handle_struct *handle, files_struct *fsp, int fd)
+static int vfswrap_fsync(vfs_handle_struct *handle, files_struct *fsp)
{
#ifdef HAVE_FSYNC
int result;
START_PROFILE(syscall_fsync);
- result = fsync(fd);
+ result = fsync(fsp->fh->fd);
END_PROFILE(syscall_fsync);
return result;
#else
diff --git a/source3/modules/vfs_full_audit.c b/source3/modules/vfs_full_audit.c
index b03f6b53f4..396b2bbb68 100644
--- a/source3/modules/vfs_full_audit.c
+++ b/source3/modules/vfs_full_audit.c
@@ -133,7 +133,7 @@ static ssize_t smb_full_audit_recvfile(vfs_handle_struct *handle, int fromfd,
size_t n);
static int smb_full_audit_rename(vfs_handle_struct *handle,
const char *oldname, const char *newname);
-static int smb_full_audit_fsync(vfs_handle_struct *handle, files_struct *fsp, int fd);
+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,
@@ -1193,11 +1193,11 @@ static int smb_full_audit_rename(vfs_handle_struct *handle,
return result;
}
-static int smb_full_audit_fsync(vfs_handle_struct *handle, files_struct *fsp, int fd)
+static int smb_full_audit_fsync(vfs_handle_struct *handle, files_struct *fsp)
{
int result;
- result = SMB_VFS_NEXT_FSYNC(handle, fsp, fd);
+ result = SMB_VFS_NEXT_FSYNC(handle, fsp);
do_log(SMB_VFS_OP_FSYNC, (result >= 0), handle, "%s", fsp->fsp_name);
diff --git a/source3/smbd/fileio.c b/source3/smbd/fileio.c
index a648326f89..5a4263739b 100644
--- a/source3/smbd/fileio.c
+++ b/source3/smbd/fileio.c
@@ -879,7 +879,7 @@ NTSTATUS sync_file(connection_struct *conn, files_struct *fsp, bool write_throug
if (ret == -1) {
return map_nt_error_from_unix(errno);
}
- ret = SMB_VFS_FSYNC(fsp,fsp->fh->fd);
+ ret = SMB_VFS_FSYNC(fsp);
if (ret == -1) {
return map_nt_error_from_unix(errno);
}
diff --git a/source3/torture/cmd_vfs.c b/source3/torture/cmd_vfs.c
index e595ac9f8b..17f4b9bfc0 100644
--- a/source3/torture/cmd_vfs.c
+++ b/source3/torture/cmd_vfs.c
@@ -479,7 +479,7 @@ static NTSTATUS cmd_fsync(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc,
}
fd = atoi(argv[1]);
- ret = SMB_VFS_FSYNC(vfs->files[fd], fd);
+ ret = SMB_VFS_FSYNC(vfs->files[fd]);
if (ret == -1) {
printf("fsync: error=%d (%s)\n", errno, strerror(errno));
return NT_STATUS_UNSUCCESSFUL;