summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2008-01-07 09:23:04 +0100
committerMichael Adam <obnox@samba.org>2008-01-07 15:59:01 +0100
commita56b417809805f8872c1e3238cce5d006d6189e4 (patch)
tree48237bfcc63171112e5cc3ca56c3662ecb898690 /source3
parentcab9aa525dbbf4ba65acb43763298bfb30d4fca4 (diff)
downloadsamba-a56b417809805f8872c1e3238cce5d006d6189e4.tar.gz
samba-a56b417809805f8872c1e3238cce5d006d6189e4.tar.bz2
samba-a56b417809805f8872c1e3238cce5d006d6189e4.zip
Remove redundant parameter fd from SMB_VFS_PWRITE().
Michael (This used to be commit 8c4901a19ae2fd3ee085f9499f33aa7db016d182)
Diffstat (limited to 'source3')
-rw-r--r--source3/include/vfs.h3
-rw-r--r--source3/include/vfs_macros.h6
-rw-r--r--source3/modules/vfs_commit.c3
-rw-r--r--source3/modules/vfs_default.c14
-rw-r--r--source3/modules/vfs_full_audit.c6
-rw-r--r--source3/smbd/vfs.c6
6 files changed, 19 insertions, 19 deletions
diff --git a/source3/include/vfs.h b/source3/include/vfs.h
index 88cf59c028..6f3232cbf9 100644
--- a/source3/include/vfs.h
+++ b/source3/include/vfs.h
@@ -80,6 +80,7 @@
/* Leave at 22 - not yet released. Remove parameter fd from fget_nt_acl. - obnox */
/* Leave at 22 - not yet released. Remove parameter fd from gset_nt_acl. - obnox */
/* Leave at 22 - not yet released. Remove parameter fd from pread. - obnox */
+/* Leave at 22 - not yet released. Remove parameter fd from pwrite. - obnox */
#define SMB_VFS_INTERFACE_VERSION 22
@@ -272,7 +273,7 @@ struct vfs_ops {
ssize_t (*read)(struct vfs_handle_struct *handle, struct files_struct *fsp, int fd, void *data, size_t n);
ssize_t (*pread)(struct vfs_handle_struct *handle, struct files_struct *fsp, void *data, size_t n, SMB_OFF_T offset);
ssize_t (*write)(struct vfs_handle_struct *handle, struct files_struct *fsp, int fd, const void *data, size_t n);
- ssize_t (*pwrite)(struct vfs_handle_struct *handle, struct files_struct *fsp, int fd, const void *data, size_t n, SMB_OFF_T offset);
+ 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, int fd, SMB_OFF_T offset, int whence);
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);
diff --git a/source3/include/vfs_macros.h b/source3/include/vfs_macros.h
index 6ee1b7c66d..74a45814bd 100644
--- a/source3/include/vfs_macros.h
+++ b/source3/include/vfs_macros.h
@@ -51,7 +51,7 @@
#define SMB_VFS_READ(fsp, fd, data, n) ((fsp)->conn->vfs.ops.read((fsp)->conn->vfs.handles.read, (fsp), (fd), (data), (n)))
#define SMB_VFS_PREAD(fsp, data, n, off) ((fsp)->conn->vfs.ops.pread((fsp)->conn->vfs.handles.pread, (fsp), (data), (n), (off)))
#define SMB_VFS_WRITE(fsp, fd, data, n) ((fsp)->conn->vfs.ops.write((fsp)->conn->vfs.handles.write, (fsp), (fd), (data), (n)))
-#define SMB_VFS_PWRITE(fsp, fd, data, n, off) ((fsp)->conn->vfs.ops.pwrite((fsp)->conn->vfs.handles.pwrite, (fsp), (fd), (data), (n), (off)))
+#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, fd, offset, whence) ((fsp)->conn->vfs.ops.lseek((fsp)->conn->vfs.handles.lseek, (fsp), (fd), (offset), (whence)))
#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)))
@@ -170,7 +170,7 @@
#define SMB_VFS_OPAQUE_READ(fsp, fd, data, n) ((fsp)->conn->vfs_opaque.ops.read((fsp)->conn->vfs_opaque.handles.read, (fsp), (fd), (data), (n)))
#define SMB_VFS_OPAQUE_PREAD(fsp, data, n, off) ((fsp)->conn->vfs_opaque.ops.pread((fsp)->conn->vfs_opaque.handles.pread, (fsp), (data), (n), (off)))
#define SMB_VFS_OPAQUE_WRITE(fsp, fd, data, n) ((fsp)->conn->vfs_opaque.ops.write((fsp)->conn->vfs_opaque.handles.write, (fsp), (fd), (data), (n)))
-#define SMB_VFS_OPAQUE_PWRITE(fsp, fd, data, n, off) ((fsp)->conn->vfs_opaque.ops.pwrite((fsp)->conn->vfs_opaque.handles.pwrite, (fsp), (fd), (data), (n), (off)))
+#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, fd, offset, whence) ((fsp)->conn->vfs_opaque.ops.lseek((fsp)->conn->vfs_opaque.handles.lseek, (fsp), (fd), (offset), (whence)))
#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)))
@@ -290,7 +290,7 @@
#define SMB_VFS_NEXT_READ(handle, fsp, fd, data, n) ((handle)->vfs_next.ops.read((handle)->vfs_next.handles.read, (fsp), (fd), (data), (n)))
#define SMB_VFS_NEXT_PREAD(handle, fsp, data, n, off) ((handle)->vfs_next.ops.pread((handle)->vfs_next.handles.pread, (fsp), (data), (n), (off)))
#define SMB_VFS_NEXT_WRITE(handle, fsp, fd, data, n) ((handle)->vfs_next.ops.write((handle)->vfs_next.handles.write, (fsp), (fd), (data), (n)))
-#define SMB_VFS_NEXT_PWRITE(handle, fsp, fd, data, n, off) ((handle)->vfs_next.ops.pwrite((handle)->vfs_next.handles.pwrite, (fsp), (fd), (data), (n), (off)))
+#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, fd, offset, whence) ((handle)->vfs_next.ops.lseek((handle)->vfs_next.handles.lseek, (fsp), (fd), (offset), (whence)))
#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)))
diff --git a/source3/modules/vfs_commit.c b/source3/modules/vfs_commit.c
index d7d81924f1..e445c43181 100644
--- a/source3/modules/vfs_commit.c
+++ b/source3/modules/vfs_commit.c
@@ -248,14 +248,13 @@ static ssize_t commit_write(
static ssize_t commit_pwrite(
vfs_handle_struct * handle,
files_struct * fsp,
- int fd,
void * data,
size_t count,
SMB_OFF_T offset)
{
ssize_t ret;
- ret = SMB_VFS_NEXT_PWRITE(handle, fsp, fd, data, count, offset);
+ ret = SMB_VFS_NEXT_PWRITE(handle, fsp, data, count, offset);
if (ret > 0) {
if (commit(handle, fsp, offset, ret) == -1) {
return -1;
diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c
index 4f9d90abde..b4ce9346e2 100644
--- a/source3/modules/vfs_default.c
+++ b/source3/modules/vfs_default.c
@@ -272,38 +272,38 @@ static ssize_t vfswrap_write(vfs_handle_struct *handle, files_struct *fsp, int f
return result;
}
-static ssize_t vfswrap_pwrite(vfs_handle_struct *handle, files_struct *fsp, int fd, const void *data,
+static ssize_t vfswrap_pwrite(vfs_handle_struct *handle, files_struct *fsp, const void *data,
size_t n, SMB_OFF_T offset)
{
ssize_t result;
#if defined(HAVE_PWRITE) || defined(HAVE_PRWITE64)
START_PROFILE_BYTES(syscall_pwrite, n);
- result = sys_pwrite(fd, data, n, offset);
+ result = sys_pwrite(fsp->fh->fd, data, n, offset);
END_PROFILE(syscall_pwrite);
if (result == -1 && errno == ESPIPE) {
/* Maintain the fiction that pipes can be sought on. */
- result = SMB_VFS_WRITE(fsp, fd, data, n);
+ result = SMB_VFS_WRITE(fsp, fsp->fh->fd, data, n);
}
#else /* HAVE_PWRITE */
SMB_OFF_T curr;
int lerrno;
- curr = SMB_VFS_LSEEK(fsp, fd, 0, SEEK_CUR);
+ curr = SMB_VFS_LSEEK(fsp, fsp->fh->fd, 0, SEEK_CUR);
if (curr == -1) {
return -1;
}
- if (SMB_VFS_LSEEK(fsp, fd, offset, SEEK_SET) == -1) {
+ if (SMB_VFS_LSEEK(fsp, fsp->fh->fd, offset, SEEK_SET) == -1) {
return -1;
}
- result = SMB_VFS_WRITE(fsp, fd, data, n);
+ result = SMB_VFS_WRITE(fsp, fsp->fh->fd, data, n);
lerrno = errno;
- SMB_VFS_LSEEK(fsp, fd, curr, SEEK_SET);
+ SMB_VFS_LSEEK(fsp, fsp->fh->fd, curr, SEEK_SET);
errno = lerrno;
#endif /* HAVE_PWRITE */
diff --git a/source3/modules/vfs_full_audit.c b/source3/modules/vfs_full_audit.c
index 7acca905a0..c0bc40cc67 100644
--- a/source3/modules/vfs_full_audit.c
+++ b/source3/modules/vfs_full_audit.c
@@ -119,7 +119,7 @@ static ssize_t smb_full_audit_pread(vfs_handle_struct *handle, files_struct *fsp
static ssize_t smb_full_audit_write(vfs_handle_struct *handle, files_struct *fsp,
int fd, const void *data, size_t n);
static ssize_t smb_full_audit_pwrite(vfs_handle_struct *handle, files_struct *fsp,
- int fd, const void *data, size_t n,
+ const void *data, size_t n,
SMB_OFF_T offset);
static SMB_OFF_T smb_full_audit_lseek(vfs_handle_struct *handle, files_struct *fsp,
int filedes, SMB_OFF_T offset, int whence);
@@ -1124,12 +1124,12 @@ static ssize_t smb_full_audit_write(vfs_handle_struct *handle, files_struct *fsp
}
static ssize_t smb_full_audit_pwrite(vfs_handle_struct *handle, files_struct *fsp,
- int fd, const void *data, size_t n,
+ const void *data, size_t n,
SMB_OFF_T offset)
{
ssize_t result;
- result = SMB_VFS_NEXT_PWRITE(handle, fsp, fd, data, n, offset);
+ result = SMB_VFS_NEXT_PWRITE(handle, fsp, data, n, offset);
do_log(SMB_VFS_OP_PWRITE, (result >= 0), handle, "%s", fsp->fsp_name);
diff --git a/source3/smbd/vfs.c b/source3/smbd/vfs.c
index bc272914c7..aa914797d1 100644
--- a/source3/smbd/vfs.c
+++ b/source3/smbd/vfs.c
@@ -485,8 +485,8 @@ ssize_t vfs_pwrite_data(struct smb_request *req,
}
while (total < N) {
- ret = SMB_VFS_PWRITE(fsp, fsp->fh->fd, buffer + total,
- N - total, offset + total);
+ ret = SMB_VFS_PWRITE(fsp, buffer + total, N - total,
+ offset + total);
if (ret == -1)
return -1;
@@ -641,7 +641,7 @@ int vfs_fill_sparse(files_struct *fsp, SMB_OFF_T len)
while (total < num_to_write) {
size_t curr_write_size = MIN(SPARSE_BUF_WRITE_SIZE, (num_to_write - total));
- pwrite_ret = SMB_VFS_PWRITE(fsp, fsp->fh->fd, sparse_buf, curr_write_size, offset + total);
+ pwrite_ret = SMB_VFS_PWRITE(fsp, sparse_buf, curr_write_size, offset + total);
if (pwrite_ret == -1) {
DEBUG(10,("vfs_fill_sparse: SMB_VFS_PWRITE for file %s failed with error %s\n",
fsp->fsp_name, strerror(errno) ));