summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2008-01-11 01:26:54 +0100
committerMichael Adam <obnox@samba.org>2008-01-11 01:27:05 +0100
commitfef9cf00e1e110ff5872f1c368d080fe4f7939d6 (patch)
tree9b6bf79a5fa28b76c37af56fcc0c5ed2e7bf1884
parent14d45bedfa844dfbf646e792d1cf84544997de25 (diff)
downloadsamba-fef9cf00e1e110ff5872f1c368d080fe4f7939d6.tar.gz
samba-fef9cf00e1e110ff5872f1c368d080fe4f7939d6.tar.bz2
samba-fef9cf00e1e110ff5872f1c368d080fe4f7939d6.zip
Combine fsp and tofd to tofsp in SMB_VFS_RECVFILE().
Michael (This used to be commit 3958abffaf2866c69ad9e13ec345364fde5c78bb)
-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.c5
-rw-r--r--source3/modules/vfs_full_audit.c9
-rw-r--r--source3/smbd/vfs.c2
7 files changed, 15 insertions, 18 deletions
diff --git a/examples/VFS/skel_opaque.c b/examples/VFS/skel_opaque.c
index 16578057d0..5b196af5eb 100644
--- a/examples/VFS/skel_opaque.c
+++ b/examples/VFS/skel_opaque.c
@@ -161,9 +161,9 @@ static ssize_t skel_sendfile(vfs_handle_struct *handle, int tofd, files_struct *
return vfswrap_sendfile(NULL, tofd, fromfsp, hdr, offset, n);
}
-static ssize_t skel_recvfile(vfs_handle_struct *handle, int fromfd, files_struct *fsp, int tofd, SMB_OFF_T offset, size_t n)
+static ssize_t skel_recvfile(vfs_handle_struct *handle, int fromfd, files_struct *tofsp, SMB_OFF_T offset, size_t n)
{
- return vfswrap_recvfile(NULL, fromfd, fsp, tofd, offset, n);
+ return vfswrap_recvfile(NULL, fromfd, tofsp, offset, n);
}
static int skel_rename(vfs_handle_struct *handle, const char *oldname, const char *newname)
diff --git a/examples/VFS/skel_transparent.c b/examples/VFS/skel_transparent.c
index e69826a89d..55407be10c 100644
--- a/examples/VFS/skel_transparent.c
+++ b/examples/VFS/skel_transparent.c
@@ -154,9 +154,9 @@ static ssize_t skel_sendfile(vfs_handle_struct *handle, int tofd, files_struct *
return SMB_VFS_NEXT_SENDFILE(handle, tofd, fromfsp, hdr, offset, n);
}
-static ssize_t skel_recvfile(vfs_handle_struct *handle, int fromfd, files_struct *fsp, int tofd, SMB_OFF_T offset, size_t n)
+static ssize_t skel_recvfile(vfs_handle_struct *handle, int fromfd, files_struct *tofsp, SMB_OFF_T offset, size_t n)
{
- return SMB_VFS_NEXT_RECVFILE(handle, fromfd, fsp, tofd, offset, n);
+ return SMB_VFS_NEXT_RECVFILE(handle, fromfd, tofsp, offset, n);
}
static int skel_rename(vfs_handle_struct *handle, const char *oldname, const char *newname)
diff --git a/source3/include/vfs.h b/source3/include/vfs.h
index 11f88c98f3..0be3886227 100644
--- a/source3/include/vfs.h
+++ b/source3/include/vfs.h
@@ -102,6 +102,7 @@
/* Leave at 22 - not yet released. Remove parameter fd from read. - obnox */
/* Leave at 22 - not yet released. Remove parameter fd from write. - obnox */
/* Leave at 22 - not yet released. Remove parameter fromfd from sendfile. - obnox */
+/* Leave at 22 - not yet released. Remove parameter fromfd from recvfile. - obnox */
@@ -299,7 +300,7 @@ struct vfs_ops {
ssize_t (*pwrite)(struct vfs_handle_struct *handle, struct files_struct *fsp, const void *data, size_t n, SMB_OFF_T offset);
SMB_OFF_T (*lseek)(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_OFF_T offset, int whence);
ssize_t (*sendfile)(struct vfs_handle_struct *handle, int tofd, files_struct *fromfsp, 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);
+ ssize_t (*recvfile)(struct vfs_handle_struct *handle, int fromfd, files_struct *tofsp, 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 (*stat)(struct vfs_handle_struct *handle, const char *fname, SMB_STRUCT_STAT *sbuf);
diff --git a/source3/include/vfs_macros.h b/source3/include/vfs_macros.h
index 379d6307e9..9232e94a42 100644
--- a/source3/include/vfs_macros.h
+++ b/source3/include/vfs_macros.h
@@ -54,7 +54,7 @@
#define SMB_VFS_PWRITE(fsp, data, n, off) ((fsp)->conn->vfs.ops.pwrite((fsp)->conn->vfs.handles.pwrite, (fsp), (data), (n), (off)))
#define SMB_VFS_LSEEK(fsp, offset, whence) ((fsp)->conn->vfs.ops.lseek((fsp)->conn->vfs.handles.lseek, (fsp), (offset), (whence)))
#define SMB_VFS_SENDFILE(tofd, fromfsp, header, offset, count) ((fsp)->conn->vfs.ops.sendfile((fsp)->conn->vfs.handles.sendfile, (tofd), (fromfsp), (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_RECVFILE(fromfd, tofsp, offset, count) ((fsp)->conn->vfs.ops.recvfile((fsp)->conn->vfs.handles.recvfile, (fromfd), (tofsp), (offset), (count)))
#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)))
@@ -173,7 +173,7 @@
#define SMB_VFS_OPAQUE_PWRITE(fsp, data, n, off) ((fsp)->conn->vfs_opaque.ops.pwrite((fsp)->conn->vfs_opaque.handles.pwrite, (fsp), (data), (n), (off)))
#define SMB_VFS_OPAQUE_LSEEK(fsp, offset, whence) ((fsp)->conn->vfs_opaque.ops.lseek((fsp)->conn->vfs_opaque.handles.lseek, (fsp), (offset), (whence)))
#define SMB_VFS_OPAQUE_SENDFILE(tofd, fromfsp, header, offset, count) ((fsp)->conn->vfs_opaque.ops.sendfile((fsp)->conn->vfs_opaque.handles.sendfile, (tofd), (fromfsp), (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_RECVFILE(fromfd, tofsp, offset, count) ((fsp)->conn->vfs_opaque.ops.recvfile((fsp)->conn->vfs_opaque.handles.recvfile, (fromfd), (tofsp), (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) ((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)))
@@ -293,7 +293,7 @@
#define SMB_VFS_NEXT_PWRITE(handle, fsp, data, n, off) ((handle)->vfs_next.ops.pwrite((handle)->vfs_next.handles.pwrite, (fsp), (data), (n), (off)))
#define SMB_VFS_NEXT_LSEEK(handle, fsp, offset, whence) ((handle)->vfs_next.ops.lseek((handle)->vfs_next.handles.lseek, (fsp), (offset), (whence)))
#define SMB_VFS_NEXT_SENDFILE(handle, tofd, fromfsp, header, offset, count) ((handle)->vfs_next.ops.sendfile((handle)->vfs_next.handles.sendfile, (tofd), (fromfsp), (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_RECVFILE(handle, fromfd, tofsp, offset, count) ((handle)->vfs_next.ops.recvfile((handle)->vfs_next.handles.recvfile, (fromfd), (tofsp), (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) ((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)))
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;
}
diff --git a/source3/modules/vfs_full_audit.c b/source3/modules/vfs_full_audit.c
index baa5d24a33..5aa9bab5b5 100644
--- a/source3/modules/vfs_full_audit.c
+++ b/source3/modules/vfs_full_audit.c
@@ -128,7 +128,7 @@ static ssize_t smb_full_audit_sendfile(vfs_handle_struct *handle, int tofd,
const DATA_BLOB *hdr, SMB_OFF_T offset,
size_t n);
static ssize_t smb_full_audit_recvfile(vfs_handle_struct *handle, int fromfd,
- files_struct *fsp, int tofd,
+ files_struct *tofsp,
SMB_OFF_T offset,
size_t n);
static int smb_full_audit_rename(vfs_handle_struct *handle,
@@ -1164,17 +1164,16 @@ static ssize_t smb_full_audit_sendfile(vfs_handle_struct *handle, int tofd,
}
static ssize_t smb_full_audit_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;
- result = SMB_VFS_NEXT_RECVFILE(handle, fromfd, fsp, tofd,
- offset, n);
+ result = SMB_VFS_NEXT_RECVFILE(handle, fromfd, tofsp, offset, n);
do_log(SMB_VFS_OP_RECVFILE, (result >= 0), handle,
- "%s", fsp->fsp_name);
+ "%s", tofsp->fsp_name);
return result;
}
diff --git a/source3/smbd/vfs.c b/source3/smbd/vfs.c
index 1e71da742c..33a3a43aa4 100644
--- a/source3/smbd/vfs.c
+++ b/source3/smbd/vfs.c
@@ -445,7 +445,6 @@ ssize_t vfs_write_data(struct smb_request *req,
req->unread_bytes = 0;
return SMB_VFS_RECVFILE(smbd_server_fd(),
fsp,
- fsp->fh->fd,
(SMB_OFF_T)-1,
N);
}
@@ -479,7 +478,6 @@ ssize_t vfs_pwrite_data(struct smb_request *req,
req->unread_bytes = 0;
return SMB_VFS_RECVFILE(smbd_server_fd(),
fsp,
- fsp->fh->fd,
offset,
N);
}