mirror of
https://github.com/samba-team/samba.git
synced 2024-12-23 17:34:34 +03:00
Remove redundant parameter fd from SMB_VFS_WRITE().
Michael
This commit is contained in:
parent
a8fc2ddad8
commit
c8ae7d095a
@ -140,9 +140,9 @@ static ssize_t skel_pread(vfs_handle_struct *handle, struct files_struct *fsp, v
|
||||
return vfswrap_pread(NULL, fsp, data, n, offset);
|
||||
}
|
||||
|
||||
static ssize_t skel_write(vfs_handle_struct *handle, files_struct *fsp, int fd, const void *data, size_t n)
|
||||
static ssize_t skel_write(vfs_handle_struct *handle, files_struct *fsp, const void *data, size_t n)
|
||||
{
|
||||
return vfswrap_write(NULL, fsp, fd, data, n);
|
||||
return vfswrap_write(NULL, fsp, data, n);
|
||||
}
|
||||
|
||||
ssize_t skel_pwrite(vfs_handle_struct *handle, struct files_struct *fsp, const void *data, size_t n, SMB_OFF_T offset)
|
||||
|
@ -134,9 +134,9 @@ static ssize_t skel_pread(vfs_handle_struct *handle, files_struct *fsp, void *da
|
||||
return SMB_VFS_NEXT_PREAD(handle, fsp, data, n, offset);
|
||||
}
|
||||
|
||||
static ssize_t skel_write(vfs_handle_struct *handle, files_struct *fsp, int fd, const void *data, size_t n)
|
||||
static ssize_t skel_write(vfs_handle_struct *handle, files_struct *fsp, const void *data, size_t n)
|
||||
{
|
||||
return SMB_VFS_NEXT_WRITE(handle, fsp, fd, data, n);
|
||||
return SMB_VFS_NEXT_WRITE(handle, fsp, data, n);
|
||||
}
|
||||
|
||||
static ssize_t skel_pwrite(vfs_handle_struct *handle, files_struct *fsp, const void *data, size_t n, SMB_OFF_T offset)
|
||||
|
@ -100,6 +100,7 @@
|
||||
/* Leave at 22 - not yet released. Remove parameter fd from fsetxattr. - obnox */
|
||||
/* Leave at 22 - not yet released. Remove parameter fd from aio_cancel. - obnox */
|
||||
/* Leave at 22 - not yet released. Remove parameter fd from read. - obnox */
|
||||
/* Leave at 22 - not yet released. Remove parameter fd from write. - obnox */
|
||||
|
||||
|
||||
|
||||
@ -293,7 +294,7 @@ struct vfs_ops {
|
||||
int (*close_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, int fd);
|
||||
ssize_t (*read)(struct vfs_handle_struct *handle, struct files_struct *fsp, 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 (*write)(struct vfs_handle_struct *handle, struct files_struct *fsp, const void *data, size_t n);
|
||||
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 *fsp, int fromfd, const DATA_BLOB *header, SMB_OFF_T offset, size_t count);
|
||||
|
@ -50,7 +50,7 @@
|
||||
#define SMB_VFS_CLOSE(fsp, fd) ((fsp)->conn->vfs.ops.close_fn((fsp)->conn->vfs.handles.close_hnd, (fsp), (fd)))
|
||||
#define SMB_VFS_READ(fsp, data, n) ((fsp)->conn->vfs.ops.read((fsp)->conn->vfs.handles.read, (fsp), (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_WRITE(fsp, data, n) ((fsp)->conn->vfs.ops.write((fsp)->conn->vfs.handles.write, (fsp), (data), (n)))
|
||||
#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, fsp, fromfd, header, offset, count) ((fsp)->conn->vfs.ops.sendfile((fsp)->conn->vfs.handles.sendfile, (tofd), (fsp), (fromfd), (header), (offset), (count)))
|
||||
@ -169,7 +169,7 @@
|
||||
#define SMB_VFS_OPAQUE_CLOSE(fsp, fd) ((fsp)->conn->vfs_opaque.ops.close_fn((fsp)->conn->vfs_opaque.handles.close_hnd, (fsp), (fd)))
|
||||
#define SMB_VFS_OPAQUE_READ(fsp, data, n) ((fsp)->conn->vfs_opaque.ops.read((fsp)->conn->vfs_opaque.handles.read, (fsp), (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_WRITE(fsp, data, n) ((fsp)->conn->vfs_opaque.ops.write((fsp)->conn->vfs_opaque.handles.write, (fsp), (data), (n)))
|
||||
#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, fsp, fromfd, header, offset, count) ((fsp)->conn->vfs_opaque.ops.sendfile((fsp)->conn->vfs_opaque.handles.sendfile, (tofd), (fsp), (fromfd), (header), (offset), (count)))
|
||||
@ -289,7 +289,7 @@
|
||||
#define SMB_VFS_NEXT_CLOSE(handle, fsp, fd) ((handle)->vfs_next.ops.close_fn((handle)->vfs_next.handles.close_hnd, (fsp), (fd)))
|
||||
#define SMB_VFS_NEXT_READ(handle, fsp, data, n) ((handle)->vfs_next.ops.read((handle)->vfs_next.handles.read, (fsp), (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_WRITE(handle, fsp, data, n) ((handle)->vfs_next.ops.write((handle)->vfs_next.handles.write, (fsp), (data), (n)))
|
||||
#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, fsp, fromfd, header, offset, count) ((handle)->vfs_next.ops.sendfile((handle)->vfs_next.handles.sendfile, (tofd), (fsp), (fromfd), (header), (offset), (count)))
|
||||
|
@ -229,12 +229,11 @@ static int commit_open(
|
||||
static ssize_t commit_write(
|
||||
vfs_handle_struct * handle,
|
||||
files_struct * fsp,
|
||||
int fd,
|
||||
void * data,
|
||||
size_t count)
|
||||
{
|
||||
ssize_t ret;
|
||||
ret = SMB_VFS_NEXT_WRITE(handle, fsp, fd, data, count);
|
||||
ret = SMB_VFS_NEXT_WRITE(handle, fsp, data, count);
|
||||
|
||||
if (ret > 0) {
|
||||
if (commit(handle, fsp, fsp->fh->pos, ret) == -1) {
|
||||
|
@ -262,12 +262,12 @@ static ssize_t vfswrap_pread(vfs_handle_struct *handle, files_struct *fsp, void
|
||||
return result;
|
||||
}
|
||||
|
||||
static ssize_t vfswrap_write(vfs_handle_struct *handle, files_struct *fsp, int fd, const void *data, size_t n)
|
||||
static ssize_t vfswrap_write(vfs_handle_struct *handle, files_struct *fsp, const void *data, size_t n)
|
||||
{
|
||||
ssize_t result;
|
||||
|
||||
START_PROFILE_BYTES(syscall_write, n);
|
||||
result = sys_write(fd, data, n);
|
||||
result = sys_write(fsp->fh->fd, data, n);
|
||||
END_PROFILE(syscall_write);
|
||||
return result;
|
||||
}
|
||||
@ -284,7 +284,7 @@ static ssize_t vfswrap_pwrite(vfs_handle_struct *handle, files_struct *fsp, cons
|
||||
|
||||
if (result == -1 && errno == ESPIPE) {
|
||||
/* Maintain the fiction that pipes can be sought on. */
|
||||
result = SMB_VFS_WRITE(fsp, fsp->fh->fd, data, n);
|
||||
result = SMB_VFS_WRITE(fsp, data, n);
|
||||
}
|
||||
|
||||
#else /* HAVE_PWRITE */
|
||||
@ -300,7 +300,7 @@ static ssize_t vfswrap_pwrite(vfs_handle_struct *handle, files_struct *fsp, cons
|
||||
return -1;
|
||||
}
|
||||
|
||||
result = SMB_VFS_WRITE(fsp, fsp->fh->fd, data, n);
|
||||
result = SMB_VFS_WRITE(fsp, data, n);
|
||||
lerrno = errno;
|
||||
|
||||
SMB_VFS_LSEEK(fsp, curr, SEEK_SET);
|
||||
@ -712,7 +712,7 @@ static int strict_allocate_ftruncate(vfs_handle_struct *handle, files_struct *fs
|
||||
SMB_OFF_T retlen;
|
||||
SMB_OFF_T current_len_to_write = MIN(sizeof(zero_space),space_to_write);
|
||||
|
||||
retlen = SMB_VFS_WRITE(fsp,fsp->fh->fd,(char *)zero_space,current_len_to_write);
|
||||
retlen = SMB_VFS_WRITE(fsp,(char *)zero_space,current_len_to_write);
|
||||
if (retlen <= 0)
|
||||
return -1;
|
||||
|
||||
@ -787,7 +787,7 @@ static int vfswrap_ftruncate(vfs_handle_struct *handle, files_struct *fsp, SMB_O
|
||||
if (SMB_VFS_LSEEK(fsp, len-1, SEEK_SET) != len -1)
|
||||
goto done;
|
||||
|
||||
if (SMB_VFS_WRITE(fsp, fsp->fh->fd, &c, 1)!=1)
|
||||
if (SMB_VFS_WRITE(fsp, &c, 1)!=1)
|
||||
goto done;
|
||||
|
||||
/* Seek to where we were */
|
||||
|
@ -117,7 +117,7 @@ static ssize_t smb_full_audit_read(vfs_handle_struct *handle, files_struct *fsp,
|
||||
static ssize_t smb_full_audit_pread(vfs_handle_struct *handle, files_struct *fsp,
|
||||
void *data, size_t n, SMB_OFF_T offset);
|
||||
static ssize_t smb_full_audit_write(vfs_handle_struct *handle, files_struct *fsp,
|
||||
int fd, const void *data, size_t n);
|
||||
const void *data, size_t n);
|
||||
static ssize_t smb_full_audit_pwrite(vfs_handle_struct *handle, files_struct *fsp,
|
||||
const void *data, size_t n,
|
||||
SMB_OFF_T offset);
|
||||
@ -1111,11 +1111,11 @@ 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)
|
||||
const void *data, size_t n)
|
||||
{
|
||||
ssize_t result;
|
||||
|
||||
result = SMB_VFS_NEXT_WRITE(handle, fsp, fd, data, n);
|
||||
result = SMB_VFS_NEXT_WRITE(handle, fsp, data, n);
|
||||
|
||||
do_log(SMB_VFS_OP_WRITE, (result >= 0), handle, "%s", fsp->fsp_name);
|
||||
|
||||
|
@ -451,7 +451,7 @@ ssize_t vfs_write_data(struct smb_request *req,
|
||||
}
|
||||
|
||||
while (total < N) {
|
||||
ret = SMB_VFS_WRITE(fsp,fsp->fh->fd,buffer + total,N - total);
|
||||
ret = SMB_VFS_WRITE(fsp, buffer + total, N - total);
|
||||
|
||||
if (ret == -1)
|
||||
return -1;
|
||||
@ -673,7 +673,7 @@ static ssize_t vfs_write_fn(void *file, const void *buf, size_t len)
|
||||
{
|
||||
struct files_struct *fsp = (struct files_struct *)file;
|
||||
|
||||
return SMB_VFS_WRITE(fsp, fsp->fh->fd, buf, len);
|
||||
return SMB_VFS_WRITE(fsp, buf, len);
|
||||
}
|
||||
|
||||
SMB_OFF_T vfs_transfer_file(files_struct *in, files_struct *out, SMB_OFF_T n)
|
||||
|
@ -422,7 +422,7 @@ static NTSTATUS cmd_write(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc,
|
||||
return NT_STATUS_UNSUCCESSFUL;
|
||||
}
|
||||
|
||||
wsize = SMB_VFS_WRITE(vfs->files[fd], fd, vfs->data, size);
|
||||
wsize = SMB_VFS_WRITE(vfs->files[fd], vfs->data, size);
|
||||
|
||||
if (wsize == -1) {
|
||||
printf("write: error=%d (%s)\n", errno, strerror(errno));
|
||||
|
Loading…
Reference in New Issue
Block a user