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_READ().
Michael
(This used to be commit a8fc2ddad8
)
This commit is contained in:
parent
ba2a255282
commit
1d66f4d58b
@ -130,9 +130,9 @@ static int skel_close(vfs_handle_struct *handle, files_struct *fsp, int fd)
|
||||
return vfswrap_close(NULL, fsp, fd);
|
||||
}
|
||||
|
||||
static ssize_t skel_read(vfs_handle_struct *handle, files_struct *fsp, int fd, void *data, size_t n)
|
||||
static ssize_t skel_read(vfs_handle_struct *handle, files_struct *fsp, void *data, size_t n)
|
||||
{
|
||||
return vfswrap_read(NULL, fsp, fd, data, n);
|
||||
return vfswrap_read(NULL, fsp, data, n);
|
||||
}
|
||||
|
||||
static ssize_t skel_pread(vfs_handle_struct *handle, struct files_struct *fsp, void *data, size_t n, SMB_OFF_T offset)
|
||||
|
@ -124,9 +124,9 @@ static int skel_close(vfs_handle_struct *handle, files_struct *fsp, int fd)
|
||||
return SMB_VFS_NEXT_CLOSE(handle, fsp, fd);
|
||||
}
|
||||
|
||||
static ssize_t skel_read(vfs_handle_struct *handle, files_struct *fsp, int fd, void *data, size_t n)
|
||||
static ssize_t skel_read(vfs_handle_struct *handle, files_struct *fsp, void *data, size_t n)
|
||||
{
|
||||
return SMB_VFS_NEXT_READ(handle, fsp, fd, data, n);
|
||||
return SMB_VFS_NEXT_READ(handle, fsp, data, n);
|
||||
}
|
||||
|
||||
static ssize_t skel_pread(vfs_handle_struct *handle, files_struct *fsp, void *data, size_t n, SMB_OFF_T offset)
|
||||
|
@ -99,6 +99,7 @@
|
||||
/* Leave at 22 - not yet released. Remove parameter fd from fremovexattr. - obnox */
|
||||
/* 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 */
|
||||
|
||||
|
||||
|
||||
@ -290,7 +291,7 @@ struct vfs_ops {
|
||||
|
||||
int (*open)(struct vfs_handle_struct *handle, const char *fname, files_struct *fsp, int flags, mode_t mode);
|
||||
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, int fd, void *data, size_t n);
|
||||
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 (*pwrite)(struct vfs_handle_struct *handle, struct files_struct *fsp, const void *data, size_t n, SMB_OFF_T offset);
|
||||
|
@ -48,7 +48,7 @@
|
||||
/* File operations */
|
||||
#define SMB_VFS_OPEN(conn, fname, fsp, flags, mode) (((conn)->vfs.ops.open)((conn)->vfs.handles.open, (fname), (fsp), (flags), (mode)))
|
||||
#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, fd, data, n) ((fsp)->conn->vfs.ops.read((fsp)->conn->vfs.handles.read, (fsp), (fd), (data), (n)))
|
||||
#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_PWRITE(fsp, data, n, off) ((fsp)->conn->vfs.ops.pwrite((fsp)->conn->vfs.handles.pwrite, (fsp), (data), (n), (off)))
|
||||
@ -167,7 +167,7 @@
|
||||
/* File operations */
|
||||
#define SMB_VFS_OPAQUE_OPEN(conn, fname, fsp, flags, mode) (((conn)->vfs_opaque.ops.open)((conn)->vfs_opaque.handles.open, (fname), (fsp), (flags), (mode)))
|
||||
#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, fd, data, n) ((fsp)->conn->vfs_opaque.ops.read((fsp)->conn->vfs_opaque.handles.read, (fsp), (fd), (data), (n)))
|
||||
#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_PWRITE(fsp, data, n, off) ((fsp)->conn->vfs_opaque.ops.pwrite((fsp)->conn->vfs_opaque.handles.pwrite, (fsp), (data), (n), (off)))
|
||||
@ -287,7 +287,7 @@
|
||||
/* File operations */
|
||||
#define SMB_VFS_NEXT_OPEN(handle, fname, fsp, flags, mode) (((handle)->vfs_next.ops.open)((handle)->vfs_next.handles.open, (fname), (fsp), (flags), (mode)))
|
||||
#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, fd, data, n) ((handle)->vfs_next.ops.read((handle)->vfs_next.handles.read, (fsp), (fd), (data), (n)))
|
||||
#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_PWRITE(handle, fsp, data, n, off) ((handle)->vfs_next.ops.pwrite((handle)->vfs_next.handles.pwrite, (fsp), (data), (n), (off)))
|
||||
|
@ -154,7 +154,7 @@ static ssize_t cprime_read(
|
||||
SMB_VFS_LSEEK(fsp, fd, offset, SEEK_SET);
|
||||
}
|
||||
|
||||
return SMB_VFS_NEXT_READ(handle, fsp, fd, data, count);
|
||||
return SMB_VFS_NEXT_READ(handle, fsp, data, count);
|
||||
}
|
||||
|
||||
static ssize_t cprime_pread(
|
||||
|
@ -208,12 +208,12 @@ static int vfswrap_close(vfs_handle_struct *handle, files_struct *fsp, int fd)
|
||||
return result;
|
||||
}
|
||||
|
||||
static ssize_t vfswrap_read(vfs_handle_struct *handle, files_struct *fsp, int fd, void *data, size_t n)
|
||||
static ssize_t vfswrap_read(vfs_handle_struct *handle, files_struct *fsp, void *data, size_t n)
|
||||
{
|
||||
ssize_t result;
|
||||
|
||||
START_PROFILE_BYTES(syscall_read, n);
|
||||
result = sys_read(fd, data, n);
|
||||
result = sys_read(fsp->fh->fd, data, n);
|
||||
END_PROFILE(syscall_read);
|
||||
return result;
|
||||
}
|
||||
@ -230,7 +230,7 @@ static ssize_t vfswrap_pread(vfs_handle_struct *handle, files_struct *fsp, void
|
||||
|
||||
if (result == -1 && errno == ESPIPE) {
|
||||
/* Maintain the fiction that pipes can be seeked (sought?) on. */
|
||||
result = SMB_VFS_READ(fsp, fsp->fh->fd, data, n);
|
||||
result = SMB_VFS_READ(fsp, data, n);
|
||||
fsp->fh->pos = 0;
|
||||
}
|
||||
|
||||
@ -241,7 +241,7 @@ static ssize_t vfswrap_pread(vfs_handle_struct *handle, files_struct *fsp, void
|
||||
curr = SMB_VFS_LSEEK(fsp, 0, SEEK_CUR);
|
||||
if (curr == -1 && errno == ESPIPE) {
|
||||
/* Maintain the fiction that pipes can be seeked (sought?) on. */
|
||||
result = SMB_VFS_READ(fsp, fsp->fh->fd, data, n);
|
||||
result = SMB_VFS_READ(fsp, data, n);
|
||||
fsp->fh->pos = 0;
|
||||
return result;
|
||||
}
|
||||
@ -251,7 +251,7 @@ static ssize_t vfswrap_pread(vfs_handle_struct *handle, files_struct *fsp, void
|
||||
}
|
||||
|
||||
errno = 0;
|
||||
result = SMB_VFS_READ(fsp, fsp->fh->fd, data, n);
|
||||
result = SMB_VFS_READ(fsp, data, n);
|
||||
lerrno = errno;
|
||||
|
||||
SMB_VFS_LSEEK(fsp, curr, SEEK_SET);
|
||||
|
@ -113,7 +113,7 @@ static int smb_full_audit_open(vfs_handle_struct *handle,
|
||||
const char *fname, files_struct *fsp, int flags, mode_t mode);
|
||||
static int smb_full_audit_close(vfs_handle_struct *handle, files_struct *fsp, int fd);
|
||||
static ssize_t smb_full_audit_read(vfs_handle_struct *handle, files_struct *fsp,
|
||||
int fd, void *data, size_t n);
|
||||
void *data, size_t n);
|
||||
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,
|
||||
@ -1087,11 +1087,11 @@ static int smb_full_audit_close(vfs_handle_struct *handle, files_struct *fsp, in
|
||||
}
|
||||
|
||||
static ssize_t smb_full_audit_read(vfs_handle_struct *handle, files_struct *fsp,
|
||||
int fd, void *data, size_t n)
|
||||
void *data, size_t n)
|
||||
{
|
||||
ssize_t result;
|
||||
|
||||
result = SMB_VFS_NEXT_READ(handle, fsp, fd, data, n);
|
||||
result = SMB_VFS_NEXT_READ(handle, fsp, data, n);
|
||||
|
||||
do_log(SMB_VFS_OP_READ, (result >= 0), handle, "%s", fsp->fsp_name);
|
||||
|
||||
|
@ -389,8 +389,8 @@ ssize_t vfs_read_data(files_struct *fsp, char *buf, size_t byte_count)
|
||||
|
||||
while (total < byte_count)
|
||||
{
|
||||
ssize_t ret = SMB_VFS_READ(fsp, fsp->fh->fd, buf + total,
|
||||
byte_count - total);
|
||||
ssize_t ret = SMB_VFS_READ(fsp, buf + total,
|
||||
byte_count - total);
|
||||
|
||||
if (ret == 0) return total;
|
||||
if (ret == -1) {
|
||||
@ -666,7 +666,7 @@ static ssize_t vfs_read_fn(void *file, void *buf, size_t len)
|
||||
{
|
||||
struct files_struct *fsp = (struct files_struct *)file;
|
||||
|
||||
return SMB_VFS_READ(fsp, fsp->fh->fd, buf, len);
|
||||
return SMB_VFS_READ(fsp, buf, len);
|
||||
}
|
||||
|
||||
static ssize_t vfs_write_fn(void *file, const void *buf, size_t len)
|
||||
|
@ -389,7 +389,7 @@ static NTSTATUS cmd_read(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc, c
|
||||
}
|
||||
vfs->data_size = size;
|
||||
|
||||
rsize = SMB_VFS_READ(vfs->files[fd], fd, vfs->data, size);
|
||||
rsize = SMB_VFS_READ(vfs->files[fd], vfs->data, size);
|
||||
if (rsize == -1) {
|
||||
printf("read: error=%d (%s)\n", errno, strerror(errno));
|
||||
return NT_STATUS_UNSUCCESSFUL;
|
||||
|
Loading…
Reference in New Issue
Block a user