diff options
-rw-r--r-- | examples/VFS/skel_opaque.c | 8 | ||||
-rw-r--r-- | examples/VFS/skel_transparent.c | 7 | ||||
-rw-r--r-- | source3/include/vfs.h | 5 | ||||
-rw-r--r-- | source3/include/vfs_macros.h | 5 | ||||
-rw-r--r-- | source3/modules/vfs_cacheprime.c | 18 | ||||
-rw-r--r-- | source3/modules/vfs_ceph.c | 13 | ||||
-rw-r--r-- | source3/modules/vfs_default.c | 11 | ||||
-rw-r--r-- | source3/modules/vfs_full_audit.c | 14 | ||||
-rw-r--r-- | source3/modules/vfs_glusterfs.c | 7 | ||||
-rw-r--r-- | source3/modules/vfs_time_audit.c | 20 | ||||
-rw-r--r-- | source3/smbd/vfs.c | 7 |
11 files changed, 2 insertions, 113 deletions
diff --git a/examples/VFS/skel_opaque.c b/examples/VFS/skel_opaque.c index 41215ccf911..3f0e6652c56 100644 --- a/examples/VFS/skel_opaque.c +++ b/examples/VFS/skel_opaque.c @@ -220,13 +220,6 @@ static int skel_close_fn(vfs_handle_struct *handle, files_struct *fsp) return -1; } -static ssize_t skel_vfs_read(vfs_handle_struct *handle, files_struct *fsp, - void *data, size_t n) -{ - errno = ENOSYS; - return -1; -} - static ssize_t skel_pread(vfs_handle_struct *handle, files_struct *fsp, void *data, size_t n, off_t offset) { @@ -949,7 +942,6 @@ struct vfs_fn_pointers skel_opaque_fns = { .open_fn = skel_open, .create_file_fn = skel_create_file, .close_fn = skel_close_fn, - .read_fn = skel_vfs_read, .pread_fn = skel_pread, .pread_send_fn = skel_pread_send, .pread_recv_fn = skel_pread_recv, diff --git a/examples/VFS/skel_transparent.c b/examples/VFS/skel_transparent.c index 7a82a55a2af..a56cda50027 100644 --- a/examples/VFS/skel_transparent.c +++ b/examples/VFS/skel_transparent.c @@ -229,12 +229,6 @@ static int skel_close_fn(vfs_handle_struct *handle, files_struct *fsp) return SMB_VFS_NEXT_CLOSE(handle, fsp); } -static ssize_t skel_vfs_read(vfs_handle_struct *handle, files_struct *fsp, - void *data, size_t 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, off_t offset) { @@ -1123,7 +1117,6 @@ struct vfs_fn_pointers skel_transparent_fns = { .open_fn = skel_open, .create_file_fn = skel_create_file, .close_fn = skel_close_fn, - .read_fn = skel_vfs_read, .pread_fn = skel_pread, .pread_send_fn = skel_pread_send, .pread_recv_fn = skel_pread_recv, diff --git a/source3/include/vfs.h b/source3/include/vfs.h index 6f940edeeaa..74029a9edab 100644 --- a/source3/include/vfs.h +++ b/source3/include/vfs.h @@ -247,6 +247,8 @@ /* Version 38 - Remove SMB_VFS_INIT_SEARCH_OP */ /* Version 39 - Remove SMB_VFS_FSYNC Only implement async versions. */ +/* Version 39 - Remove SMB_VFS_READ + All users are now pread or async versions. */ #define SMB_VFS_INTERFACE_VERSION 39 @@ -685,7 +687,6 @@ struct vfs_fn_pointers { const struct smb2_create_blobs *in_context_blobs, struct smb2_create_blobs *out_context_blobs); int (*close_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp); - ssize_t (*read_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, void *data, size_t n); ssize_t (*pread_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, void *data, size_t n, off_t offset); struct tevent_req *(*pread_send_fn)(struct vfs_handle_struct *handle, TALLOC_CTX *mem_ctx, @@ -1170,8 +1171,6 @@ NTSTATUS smb_vfs_call_create_file(struct vfs_handle_struct *handle, struct smb2_create_blobs *out_context_blobs); int smb_vfs_call_close(struct vfs_handle_struct *handle, struct files_struct *fsp); -ssize_t smb_vfs_call_read(struct vfs_handle_struct *handle, - struct files_struct *fsp, void *data, size_t n); ssize_t smb_vfs_call_pread(struct vfs_handle_struct *handle, struct files_struct *fsp, void *data, size_t n, off_t offset); diff --git a/source3/include/vfs_macros.h b/source3/include/vfs_macros.h index dcf788e743b..5e30f0b484a 100644 --- a/source3/include/vfs_macros.h +++ b/source3/include/vfs_macros.h @@ -146,11 +146,6 @@ #define SMB_VFS_NEXT_CLOSE(handle, fsp) \ smb_vfs_call_close((handle)->next, (fsp)) -#define SMB_VFS_READ(fsp, data, n) \ - smb_vfs_call_read((fsp)->conn->vfs_handles, (fsp), (data), (n)) -#define SMB_VFS_NEXT_READ(handle, fsp, data, n) \ - smb_vfs_call_read((handle)->next, (fsp), (data), (n)) - #define SMB_VFS_PREAD(fsp, data, n, off) \ smb_vfs_call_pread((fsp)->conn->vfs_handles, (fsp), (data), (n), (off)) #define SMB_VFS_NEXT_PREAD(handle, fsp, data, n, off) \ diff --git a/source3/modules/vfs_cacheprime.c b/source3/modules/vfs_cacheprime.c index 5a8b8e0f904..c8b33d6a7ee 100644 --- a/source3/modules/vfs_cacheprime.c +++ b/source3/modules/vfs_cacheprime.c @@ -146,23 +146,6 @@ static ssize_t cprime_sendfile( header, offset, count); } -static ssize_t cprime_read( - vfs_handle_struct * handle, - files_struct * fsp, - void * data, - size_t count) -{ - off_t offset; - - offset = SMB_VFS_LSEEK(fsp, 0, SEEK_CUR); - if (offset >= 0 && g_readbuf) { - prime_cache(handle, fsp, offset, count); - SMB_VFS_LSEEK(fsp, offset, SEEK_SET); - } - - return SMB_VFS_NEXT_READ(handle, fsp, data, count); -} - static ssize_t cprime_pread( vfs_handle_struct * handle, files_struct * fsp, @@ -180,7 +163,6 @@ static ssize_t cprime_pread( static struct vfs_fn_pointers vfs_cacheprime_fns = { .sendfile_fn = cprime_sendfile, .pread_fn = cprime_pread, - .read_fn = cprime_read, .connect_fn = cprime_connect, }; diff --git a/source3/modules/vfs_ceph.c b/source3/modules/vfs_ceph.c index 2062fe47462..2f50aa67c57 100644 --- a/source3/modules/vfs_ceph.c +++ b/source3/modules/vfs_ceph.c @@ -458,18 +458,6 @@ static int cephwrap_close(struct vfs_handle_struct *handle, files_struct *fsp) WRAP_RETURN(result); } -static ssize_t cephwrap_read(struct vfs_handle_struct *handle, files_struct *fsp, void *data, size_t n) -{ - ssize_t result; - - DBG_DEBUG("[CEPH] read(%p, %p, %p, %llu)\n", handle, fsp, data, llu(n)); - - /* Using -1 for the offset means read/write rather than pread/pwrite */ - result = ceph_read(handle->data, fsp->fh->fd, data, n, -1); - DBG_DEBUG("[CEPH] read(...) = %llu\n", llu(result)); - WRAP_RETURN(result); -} - static ssize_t cephwrap_pread(struct vfs_handle_struct *handle, files_struct *fsp, void *data, size_t n, off_t offset) { @@ -1474,7 +1462,6 @@ static struct vfs_fn_pointers ceph_fns = { .open_fn = cephwrap_open, .close_fn = cephwrap_close, - .read_fn = cephwrap_read, .pread_fn = cephwrap_pread, .write_fn = cephwrap_write, .pwrite_fn = cephwrap_pwrite, diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c index 56dd5c77218..7c93d9a26b3 100644 --- a/source3/modules/vfs_default.c +++ b/source3/modules/vfs_default.c @@ -614,16 +614,6 @@ static int vfswrap_close(vfs_handle_struct *handle, files_struct *fsp) return result; } -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(fsp->fh->fd, data, n); - END_PROFILE_BYTES(syscall_read); - return result; -} - static ssize_t vfswrap_pread(vfs_handle_struct *handle, files_struct *fsp, void *data, size_t n, off_t offset) { @@ -2990,7 +2980,6 @@ static struct vfs_fn_pointers vfs_default_fns = { .open_fn = vfswrap_open, .create_file_fn = vfswrap_create_file, .close_fn = vfswrap_close, - .read_fn = vfswrap_read, .pread_fn = vfswrap_pread, .pread_send_fn = vfswrap_pread_send, .pread_recv_fn = vfswrap_pread_recv, diff --git a/source3/modules/vfs_full_audit.c b/source3/modules/vfs_full_audit.c index 45d6544b5c2..6e28a246652 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -1032,19 +1032,6 @@ static int smb_full_audit_close(vfs_handle_struct *handle, files_struct *fsp) return result; } -static ssize_t smb_full_audit_read(vfs_handle_struct *handle, files_struct *fsp, - void *data, size_t n) -{ - ssize_t result; - - result = SMB_VFS_NEXT_READ(handle, fsp, data, n); - - do_log(SMB_VFS_OP_READ, (result >= 0), handle, "%s", - fsp_str_do_log(fsp)); - - return result; -} - static ssize_t smb_full_audit_pread(vfs_handle_struct *handle, files_struct *fsp, void *data, size_t n, off_t offset) { @@ -2507,7 +2494,6 @@ static struct vfs_fn_pointers vfs_full_audit_fns = { .open_fn = smb_full_audit_open, .create_file_fn = smb_full_audit_create_file, .close_fn = smb_full_audit_close, - .read_fn = smb_full_audit_read, .pread_fn = smb_full_audit_pread, .pread_send_fn = smb_full_audit_pread_send, .pread_recv_fn = smb_full_audit_pread_recv, diff --git a/source3/modules/vfs_glusterfs.c b/source3/modules/vfs_glusterfs.c index 5878c14aba7..6555fd42545 100644 --- a/source3/modules/vfs_glusterfs.c +++ b/source3/modules/vfs_glusterfs.c @@ -592,12 +592,6 @@ static int vfs_gluster_close(struct vfs_handle_struct *handle, return glfs_close(glfd); } -static ssize_t vfs_gluster_read(struct vfs_handle_struct *handle, - files_struct *fsp, void *data, size_t n) -{ - return glfs_read(*(glfs_fd_t **)VFS_FETCH_FSP_EXTENSION(handle, fsp), data, n, 0); -} - static ssize_t vfs_gluster_pread(struct vfs_handle_struct *handle, files_struct *fsp, void *data, size_t n, off_t offset) @@ -1453,7 +1447,6 @@ static struct vfs_fn_pointers glusterfs_fns = { .open_fn = vfs_gluster_open, .create_file_fn = NULL, .close_fn = vfs_gluster_close, - .read_fn = vfs_gluster_read, .pread_fn = vfs_gluster_pread, .pread_send_fn = vfs_gluster_pread_send, .pread_recv_fn = vfs_gluster_recv, diff --git a/source3/modules/vfs_time_audit.c b/source3/modules/vfs_time_audit.c index 383f49b7b22..faa913180fe 100644 --- a/source3/modules/vfs_time_audit.c +++ b/source3/modules/vfs_time_audit.c @@ -648,25 +648,6 @@ static int smb_time_audit_close(vfs_handle_struct *handle, files_struct *fsp) return result; } -static ssize_t smb_time_audit_read(vfs_handle_struct *handle, - files_struct *fsp, void *data, size_t n) -{ - ssize_t result; - struct timespec ts1,ts2; - double timediff; - - clock_gettime_mono(&ts1); - result = SMB_VFS_NEXT_READ(handle, fsp, data, n); - clock_gettime_mono(&ts2); - timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9; - - if (timediff > audit_timeout) { - smb_time_audit_log_fsp("read", timediff, fsp); - } - - return result; -} - static ssize_t smb_time_audit_pread(vfs_handle_struct *handle, files_struct *fsp, void *data, size_t n, off_t offset) @@ -2677,7 +2658,6 @@ static struct vfs_fn_pointers vfs_time_audit_fns = { .open_fn = smb_time_audit_open, .create_file_fn = smb_time_audit_create_file, .close_fn = smb_time_audit_close, - .read_fn = smb_time_audit_read, .pread_fn = smb_time_audit_pread, .pread_send_fn = smb_time_audit_pread_send, .pread_recv_fn = smb_time_audit_pread_recv, diff --git a/source3/smbd/vfs.c b/source3/smbd/vfs.c index 47abf45496b..9e9a9e88164 100644 --- a/source3/smbd/vfs.c +++ b/source3/smbd/vfs.c @@ -1704,13 +1704,6 @@ int smb_vfs_call_close(struct vfs_handle_struct *handle, return handle->fns->close_fn(handle, fsp); } -ssize_t smb_vfs_call_read(struct vfs_handle_struct *handle, - struct files_struct *fsp, void *data, size_t n) -{ - VFS_FIND(read); - return handle->fns->read_fn(handle, fsp, data, n); -} - ssize_t smb_vfs_call_pread(struct vfs_handle_struct *handle, struct files_struct *fsp, void *data, size_t n, off_t offset) |