From: Volker Lendecke Date: Fri, 9 Jun 2023 15:33:02 +0000 (+0200) Subject: vfs: Remove vfs telldir/seekdir functions X-Git-Tag: talloc-2.4.1~415 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cac38aa38704c31d20d54e6cd7f53e99685aae72;p=thirdparty%2Fsamba.git vfs: Remove vfs telldir/seekdir functions Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison Autobuild-User(master): Jeremy Allison Autobuild-Date(master): Wed Jun 14 00:26:55 UTC 2023 on atb-devel-224 --- diff --git a/examples/VFS/skel_opaque.c b/examples/VFS/skel_opaque.c index 98b090728f2..cbaf9a272a8 100644 --- a/examples/VFS/skel_opaque.c +++ b/examples/VFS/skel_opaque.c @@ -163,16 +163,6 @@ static struct dirent *skel_readdir(vfs_handle_struct *handle, return NULL; } -static void skel_seekdir(vfs_handle_struct *handle, DIR *dirp, long offset) -{ - ; -} - -static long skel_telldir(vfs_handle_struct *handle, DIR *dirp) -{ - return (long)-1; -} - static void skel_rewind_dir(vfs_handle_struct *handle, DIR *dirp) { ; @@ -993,8 +983,6 @@ static struct vfs_fn_pointers skel_opaque_fns = { .fdopendir_fn = skel_fdopendir, .readdir_fn = skel_readdir, - .seekdir_fn = skel_seekdir, - .telldir_fn = skel_telldir, .rewind_dir_fn = skel_rewind_dir, .mkdirat_fn = skel_mkdirat, .closedir_fn = skel_closedir, diff --git a/examples/VFS/skel_transparent.c b/examples/VFS/skel_transparent.c index b152f3596c5..9c08b87f7c7 100644 --- a/examples/VFS/skel_transparent.c +++ b/examples/VFS/skel_transparent.c @@ -171,16 +171,6 @@ static struct dirent *skel_readdir(vfs_handle_struct *handle, return SMB_VFS_NEXT_READDIR(handle, dirfsp, dirp, sbuf); } -static void skel_seekdir(vfs_handle_struct *handle, DIR *dirp, long offset) -{ - SMB_VFS_NEXT_SEEKDIR(handle, dirp, offset); -} - -static long skel_telldir(vfs_handle_struct *handle, DIR *dirp) -{ - return SMB_VFS_NEXT_TELLDIR(handle, dirp); -} - static void skel_rewind_dir(vfs_handle_struct *handle, DIR *dirp) { SMB_VFS_NEXT_REWINDDIR(handle, dirp); @@ -1304,8 +1294,6 @@ static struct vfs_fn_pointers skel_transparent_fns = { .fdopendir_fn = skel_fdopendir, .readdir_fn = skel_readdir, - .seekdir_fn = skel_seekdir, - .telldir_fn = skel_telldir, .rewind_dir_fn = skel_rewind_dir, .mkdirat_fn = skel_mkdirat, .closedir_fn = skel_closedir, diff --git a/source3/include/smbprofile.h b/source3/include/smbprofile.h index 7b080e11ee1..62873a5532b 100644 --- a/source3/include/smbprofile.h +++ b/source3/include/smbprofile.h @@ -45,8 +45,6 @@ struct tevent_context; SMBPROFILE_STATS_BASIC(syscall_opendir) \ SMBPROFILE_STATS_BASIC(syscall_fdopendir) \ SMBPROFILE_STATS_BASIC(syscall_readdir) \ - SMBPROFILE_STATS_BASIC(syscall_seekdir) \ - SMBPROFILE_STATS_BASIC(syscall_telldir) \ SMBPROFILE_STATS_BASIC(syscall_rewinddir) \ SMBPROFILE_STATS_BASIC(syscall_mkdirat) \ SMBPROFILE_STATS_BASIC(syscall_closedir) \ diff --git a/source3/include/vfs.h b/source3/include/vfs.h index 31b657addee..eafc432be43 100644 --- a/source3/include/vfs.h +++ b/source3/include/vfs.h @@ -378,9 +378,11 @@ * Change to Version 48 - will ship with 4.18 * Version 48 - Add cached_dos_attributes to struct stat_ex * Version 48 - Add dirfsp to connectpath_fn() + * Change to Version 49 - will ship with 4.19 + * Version 49 - remove seekdir and telldir */ -#define SMB_VFS_INTERFACE_VERSION 48 +#define SMB_VFS_INTERFACE_VERSION 49 /* All intercepted VFS operations must be declared as static functions inside module source @@ -967,8 +969,6 @@ struct vfs_fn_pointers { struct files_struct *dirfsp, DIR *dirp, SMB_STRUCT_STAT *sbuf); - void (*seekdir_fn)(struct vfs_handle_struct *handle, DIR *dirp, long offset); - long (*telldir_fn)(struct vfs_handle_struct *handle, DIR *dirp); void (*rewind_dir_fn)(struct vfs_handle_struct *handle, DIR *dirp); int (*mkdirat_fn)(struct vfs_handle_struct *handle, struct files_struct *dirfsp, @@ -1464,10 +1464,6 @@ struct dirent *smb_vfs_call_readdir(struct vfs_handle_struct *handle, struct files_struct *dirfsp, DIR *dirp, SMB_STRUCT_STAT *sbuf); -void smb_vfs_call_seekdir(struct vfs_handle_struct *handle, - DIR *dirp, long offset); -long smb_vfs_call_telldir(struct vfs_handle_struct *handle, - DIR *dirp); void smb_vfs_call_rewind_dir(struct vfs_handle_struct *handle, DIR *dirp); int smb_vfs_call_mkdirat(struct vfs_handle_struct *handle, @@ -1910,8 +1906,6 @@ struct dirent *vfs_not_implemented_readdir(vfs_handle_struct *handle, struct files_struct *dirfsp, DIR *dirp, SMB_STRUCT_STAT *sbuf); -void vfs_not_implemented_seekdir(vfs_handle_struct *handle, DIR *dirp, long offset); -long vfs_not_implemented_telldir(vfs_handle_struct *handle, DIR *dirp); void vfs_not_implemented_rewind_dir(vfs_handle_struct *handle, DIR *dirp); int vfs_not_implemented_mkdirat(vfs_handle_struct *handle, struct files_struct *dirfsp, diff --git a/source3/include/vfs_macros.h b/source3/include/vfs_macros.h index f1a59e1d13a..29ce22e98c5 100644 --- a/source3/include/vfs_macros.h +++ b/source3/include/vfs_macros.h @@ -116,16 +116,6 @@ #define SMB_VFS_NEXT_READDIR(handle, dirfsp, dirp, sbuf) \ smb_vfs_call_readdir((handle)->next, (dirfsp), (dirp), (sbuf)) -#define SMB_VFS_SEEKDIR(conn, dirp, offset) \ - smb_vfs_call_seekdir((conn)->vfs_handles, (dirp), (offset)) -#define SMB_VFS_NEXT_SEEKDIR(handle, dirp, offset) \ - smb_vfs_call_seekdir((handle)->next, (dirp), (offset)) - -#define SMB_VFS_TELLDIR(conn, dirp) \ - smb_vfs_call_telldir((conn)->vfs_handles, (dirp)) -#define SMB_VFS_NEXT_TELLDIR(handle, dirp) \ - smb_vfs_call_telldir((handle)->next, (dirp)) - #define SMB_VFS_REWINDDIR(conn, dirp) \ smb_vfs_call_rewind_dir((conn)->vfs_handles, (dirp)) #define SMB_VFS_NEXT_REWINDDIR(handle, dirp) \ diff --git a/source3/modules/The_New_VFS.org b/source3/modules/The_New_VFS.org index 6309986a519..d18e5ef82ad 100644 --- a/source3/modules/The_New_VFS.org +++ b/source3/modules/The_New_VFS.org @@ -260,7 +260,7 @@ whenever VFS access is done in a piecemeal fashion. | SMB_VFS_LSTAT() | [[Path][Path]] | Todo | | SMB_VFS_MKDIRAT() | [[NsC][NsC]] | - | | SMB_VFS_MKNODAT() | [[NsC][NsC]] | - | -| SMB_VFS_NTIMES() | [[Path][Path]] | - | +| SMB_VFS_NTIMES() | [[Path][Path]] | - | | SMB_VFS_OFFLOAD_READ_RECV() | [[fsp][fsp]] | - | | SMB_VFS_OFFLOAD_READ_SEND() | [[fsp][fsp]] | - | | SMB_VFS_OFFLOAD_WRITE_RECV() | [[fsp][fsp]] | - | @@ -272,14 +272,13 @@ whenever VFS access is done in a piecemeal fashion. | SMB_VFS_PWRITE_SEND() | [[fsp][fsp]] | - | | SMB_VFS_READ_DFS_PATHAT() | [[Symlink][Symlink]] | - | | SMB_VFS_READDIR() | [[fsp][fsp]] | - | -| SMB_VFS_READDIR_ATTR() | [[Path][Path]] | - | +| SMB_VFS_READDIR_ATTR() | [[Path][Path]] | - | | SMB_VFS_READLINKAT() | [[Symlink][Symlink]] | - | | SMB_VFS_REALPATH() | [[P2px][P2px]] | - | | SMB_VFS_RECVFILE() | [[fsp][fsp]] | - | | SMB_VFS_REMOVEXATTR() | [[Path][Path]] | - | | SMB_VFS_RENAMEAT() | [[Path][Path]] | ---- | | SMB_VFS_REWINDDIR() | [[fsp][fsp]] | - | -| SMB_VFS_SEEKDIR() | [[fsp][fsp]] | - | | SMB_VFS_SENDFILE() | [[fsp][fsp]] | - | | SMB_VFS_SET_COMPRESSION() | [[fsp][fsp]] | - | | SMB_VFS_SET_DOS_ATTRIBUTES() | [[Path][Path]] | - | @@ -299,7 +298,6 @@ whenever VFS access is done in a piecemeal fashion. | SMB_VFS_SYS_ACL_GET_FD() | [[xpathref][xpathref]] | - | | SMB_VFS_SYS_ACL_GET_FILE() | [[Path][Path]] | - | | SMB_VFS_SYS_ACL_SET_FD() | [[xpathref][xpathref]] | - | -| SMB_VFS_TELLDIR() | [[fsp][fsp]] | - | | SMB_VFS_TRANSLATE_NAME() | [[P2px][P2px]] | - | | SMB_VFS_UNLINKAT() | [[NsC][NsC]] | - | |-----------------------------------+----------+--------| @@ -363,11 +361,9 @@ whenever VFS access is done in a piecemeal fashion. - SMB_VFS_READDIR() - SMB_VFS_RECVFILE() - SMB_VFS_REWINDDIR() - - SMB_VFS_SEEKDIR() - SMB_VFS_SENDFILE() - SMB_VFS_SET_COMPRESSION() - SMB_VFS_STRICT_LOCK_CHECK() - - SMB_VFS_TELLDIR() If an fsp is provided by the SMB layer we use that, otherwise we use the pathref fsp =smb_fname->fsp= provided by =filename_convert()=. diff --git a/source3/modules/The_New_VFS.txt b/source3/modules/The_New_VFS.txt index 7988639d4a4..abda0cbbe9b 100644 --- a/source3/modules/The_New_VFS.txt +++ b/source3/modules/The_New_VFS.txt @@ -347,7 +347,6 @@ Table of Contents SMB_VFS_REMOVEXATTR() [Path] - SMB_VFS_RENAMEAT() [Path] - SMB_VFS_REWINDDIR() [fsp] - - SMB_VFS_SEEKDIR() [fsp] - SMB_VFS_SENDFILE() [fsp] - SMB_VFS_SET_COMPRESSION() [fsp] - SMB_VFS_SET_DOS_ATTRIBUTES() [Path] - @@ -367,7 +366,6 @@ Table of Contents SMB_VFS_SYS_ACL_GET_FD() [xpathref] - SMB_VFS_SYS_ACL_GET_FILE() [Path] - SMB_VFS_SYS_ACL_SET_FD() [xpathref] - - SMB_VFS_TELLDIR() [fsp] - SMB_VFS_TRANSLATE_NAME() [P2px] - SMB_VFS_UNLINKAT() [NsC] - ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ @@ -469,11 +467,9 @@ Table of Contents • SMB_VFS_READDIR() • SMB_VFS_RECVFILE() • SMB_VFS_REWINDDIR() - • SMB_VFS_SEEKDIR() • SMB_VFS_SENDFILE() • SMB_VFS_SET_COMPRESSION() • SMB_VFS_STRICT_LOCK_CHECK() - • SMB_VFS_TELLDIR() If an fsp is provided by the SMB layer we use that, otherwise we use the pathref fsp `smb_fname->fsp' provided by `filename_convert()'. diff --git a/source3/modules/vfs_ceph.c b/source3/modules/vfs_ceph.c index 3978f8f589b..af303ac60b7 100644 --- a/source3/modules/vfs_ceph.c +++ b/source3/modules/vfs_ceph.c @@ -467,21 +467,6 @@ static struct dirent *cephwrap_readdir(struct vfs_handle_struct *handle, return result; } -static void cephwrap_seekdir(struct vfs_handle_struct *handle, DIR *dirp, long offset) -{ - DBG_DEBUG("[CEPH] seekdir(%p, %p, %ld)\n", handle, dirp, offset); - ceph_seekdir(handle->data, (struct ceph_dir_result *) dirp, offset); -} - -static long cephwrap_telldir(struct vfs_handle_struct *handle, DIR *dirp) -{ - long ret; - DBG_DEBUG("[CEPH] telldir(%p, %p)\n", handle, dirp); - ret = ceph_telldir(handle->data, (struct ceph_dir_result *) dirp); - DBG_DEBUG("[CEPH] telldir(...) = %ld\n", ret); - WRAP_RETURN(ret); -} - static void cephwrap_rewinddir(struct vfs_handle_struct *handle, DIR *dirp) { DBG_DEBUG("[CEPH] rewinddir(%p, %p)\n", handle, dirp); @@ -1725,8 +1710,6 @@ static struct vfs_fn_pointers ceph_fns = { .fdopendir_fn = cephwrap_fdopendir, .readdir_fn = cephwrap_readdir, - .seekdir_fn = cephwrap_seekdir, - .telldir_fn = cephwrap_telldir, .rewind_dir_fn = cephwrap_rewinddir, .mkdirat_fn = cephwrap_mkdirat, .closedir_fn = cephwrap_closedir, diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c index 89eec1146d7..cbced890597 100644 --- a/source3/modules/vfs_default.c +++ b/source3/modules/vfs_default.c @@ -657,22 +657,6 @@ static NTSTATUS vfswrap_freaddir_attr(struct vfs_handle_struct *handle, return NT_STATUS_NOT_SUPPORTED; } -static void vfswrap_seekdir(vfs_handle_struct *handle, DIR *dirp, long offset) -{ - START_PROFILE(syscall_seekdir); - seekdir(dirp, offset); - END_PROFILE(syscall_seekdir); -} - -static long vfswrap_telldir(vfs_handle_struct *handle, DIR *dirp) -{ - long result; - START_PROFILE(syscall_telldir); - result = telldir(dirp); - END_PROFILE(syscall_telldir); - return result; -} - static void vfswrap_rewinddir(vfs_handle_struct *handle, DIR *dirp) { START_PROFILE(syscall_rewinddir); @@ -4066,8 +4050,6 @@ static struct vfs_fn_pointers vfs_default_fns = { .fdopendir_fn = vfswrap_fdopendir, .readdir_fn = vfswrap_readdir, .freaddir_attr_fn = vfswrap_freaddir_attr, - .seekdir_fn = vfswrap_seekdir, - .telldir_fn = vfswrap_telldir, .rewind_dir_fn = vfswrap_rewinddir, .mkdirat_fn = vfswrap_mkdirat, .closedir_fn = vfswrap_closedir, diff --git a/source3/modules/vfs_dirsort.c b/source3/modules/vfs_dirsort.c index d9cfcadacf8..89637aa38f2 100644 --- a/source3/modules/vfs_dirsort.c +++ b/source3/modules/vfs_dirsort.c @@ -218,74 +218,6 @@ static struct dirent *dirsort_readdir(vfs_handle_struct *handle, return &data->directory_list[data->pos++]; } -static void dirsort_seekdir(vfs_handle_struct *handle, DIR *dirp, - long offset) -{ - struct timespec current_mtime; - struct dirsort_privates *data = NULL; - - SMB_VFS_HANDLE_GET_DATA(handle, data, struct dirsort_privates, return); - - /* Find the entry holding dirp. */ - while(data && (data->source_directory != dirp)) { - data = data->next; - } - if (data == NULL) { - return; - } - if (offset >= data->number_of_entries) { - return; - } - data->pos = offset; - - if (get_sorted_dir_mtime(handle, data, ¤t_mtime) == false) { - return; - } - - if (timespec_compare(¤t_mtime, &data->mtime)) { - /* Directory changed. We must re-read the - cache and search for the name that was - previously stored at the offset being - requested, otherwise after the re-sort - we will point to the wrong entry. The - OS/2 incremental delete code relies on - this. */ - unsigned int i; - char *wanted_name = talloc_strdup(handle->conn, - data->directory_list[offset].d_name); - if (wanted_name == NULL) { - return; - } - SMB_VFS_NEXT_REWINDDIR(handle, data->source_directory); - open_and_sort_dir(handle, data); - /* Now search for where we were. */ - data->pos = 0; - for (i = 0; i < data->number_of_entries; i++) { - if(strcmp(wanted_name, data->directory_list[i].d_name) == 0) { - data->pos = i; - break; - } - } - TALLOC_FREE(wanted_name); - } -} - -static long dirsort_telldir(vfs_handle_struct *handle, DIR *dirp) -{ - struct dirsort_privates *data = NULL; - SMB_VFS_HANDLE_GET_DATA(handle, data, struct dirsort_privates, - return -1); - - /* Find the entry holding dirp. */ - while(data && (data->source_directory != dirp)) { - data = data->next; - } - if (data == NULL) { - return -1; - } - return data->pos; -} - static void dirsort_rewinddir(vfs_handle_struct *handle, DIR *dirp) { struct dirsort_privates *data = NULL; @@ -328,8 +260,6 @@ static int dirsort_closedir(vfs_handle_struct *handle, DIR *dirp) static struct vfs_fn_pointers vfs_dirsort_fns = { .fdopendir_fn = dirsort_fdopendir, .readdir_fn = dirsort_readdir, - .seekdir_fn = dirsort_seekdir, - .telldir_fn = dirsort_telldir, .rewind_dir_fn = dirsort_rewinddir, .closedir_fn = dirsort_closedir, }; diff --git a/source3/modules/vfs_full_audit.c b/source3/modules/vfs_full_audit.c index d45298cf705..b407de0d778 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -110,8 +110,6 @@ typedef enum _vfs_op_type { SMB_VFS_OP_FDOPENDIR, SMB_VFS_OP_READDIR, - SMB_VFS_OP_SEEKDIR, - SMB_VFS_OP_TELLDIR, SMB_VFS_OP_REWINDDIR, SMB_VFS_OP_MKDIRAT, SMB_VFS_OP_CLOSEDIR, @@ -250,8 +248,6 @@ static struct { { SMB_VFS_OP_READ_DFS_PATHAT, "read_dfs_pathat" }, { SMB_VFS_OP_FDOPENDIR, "fdopendir" }, { SMB_VFS_OP_READDIR, "readdir" }, - { SMB_VFS_OP_SEEKDIR, "seekdir" }, - { SMB_VFS_OP_TELLDIR, "telldir" }, { SMB_VFS_OP_REWINDDIR, "rewinddir" }, { SMB_VFS_OP_MKDIRAT, "mkdirat" }, { SMB_VFS_OP_CLOSEDIR, "closedir" }, @@ -1034,26 +1030,6 @@ static struct dirent *smb_full_audit_readdir(vfs_handle_struct *handle, return result; } -static void smb_full_audit_seekdir(vfs_handle_struct *handle, - DIR *dirp, long offset) -{ - SMB_VFS_NEXT_SEEKDIR(handle, dirp, offset); - - do_log(SMB_VFS_OP_SEEKDIR, True, handle, ""); -} - -static long smb_full_audit_telldir(vfs_handle_struct *handle, - DIR *dirp) -{ - long result; - - result = SMB_VFS_NEXT_TELLDIR(handle, dirp); - - do_log(SMB_VFS_OP_TELLDIR, True, handle, ""); - - return result; -} - static void smb_full_audit_rewinddir(vfs_handle_struct *handle, DIR *dirp) { @@ -2946,8 +2922,6 @@ static struct vfs_fn_pointers vfs_full_audit_fns = { .read_dfs_pathat_fn = smb_full_audit_read_dfs_pathat, .fdopendir_fn = smb_full_audit_fdopendir, .readdir_fn = smb_full_audit_readdir, - .seekdir_fn = smb_full_audit_seekdir, - .telldir_fn = smb_full_audit_telldir, .rewind_dir_fn = smb_full_audit_rewinddir, .mkdirat_fn = smb_full_audit_mkdirat, .closedir_fn = smb_full_audit_closedir, diff --git a/source3/modules/vfs_glusterfs.c b/source3/modules/vfs_glusterfs.c index 5b0654b7a47..0c2d6950421 100644 --- a/source3/modules/vfs_glusterfs.c +++ b/source3/modules/vfs_glusterfs.c @@ -681,25 +681,6 @@ static struct dirent *vfs_gluster_readdir(struct vfs_handle_struct *handle, return dirent; } -static long vfs_gluster_telldir(struct vfs_handle_struct *handle, DIR *dirp) -{ - long ret; - - START_PROFILE(syscall_telldir); - ret = glfs_telldir((void *)dirp); - END_PROFILE(syscall_telldir); - - return ret; -} - -static void vfs_gluster_seekdir(struct vfs_handle_struct *handle, DIR *dirp, - long offset) -{ - START_PROFILE(syscall_seekdir); - glfs_seekdir((void *)dirp, offset); - END_PROFILE(syscall_seekdir); -} - static void vfs_gluster_rewinddir(struct vfs_handle_struct *handle, DIR *dirp) { START_PROFILE(syscall_rewinddir); @@ -2608,8 +2589,6 @@ static struct vfs_fn_pointers glusterfs_fns = { .fdopendir_fn = vfs_gluster_fdopendir, .readdir_fn = vfs_gluster_readdir, - .seekdir_fn = vfs_gluster_seekdir, - .telldir_fn = vfs_gluster_telldir, .rewind_dir_fn = vfs_gluster_rewinddir, .mkdirat_fn = vfs_gluster_mkdirat, .closedir_fn = vfs_gluster_closedir, diff --git a/source3/modules/vfs_media_harmony.c b/source3/modules/vfs_media_harmony.c index 2ef9b89d1eb..ceace9c5b2d 100644 --- a/source3/modules/vfs_media_harmony.c +++ b/source3/modules/vfs_media_harmony.c @@ -948,31 +948,6 @@ out: return d; } -/* - * Success: no success result defined. - * Failure: no failure result defined. - */ -static void mh_seekdir(vfs_handle_struct *handle, - DIR *dirp, - long offset) -{ - DEBUG(MH_INFO_DEBUG, ("Entering and leaving mh_seekdir\n")); - SMB_VFS_NEXT_SEEKDIR(handle, - ((mh_dirinfo_struct*)dirp)->dirstream, offset); -} - -/* - * Success: return long - * Failure: no failure result defined. - */ -static long mh_telldir(vfs_handle_struct *handle, - DIR *dirp) -{ - DEBUG(MH_INFO_DEBUG, ("Entering and leaving mh_telldir\n")); - return SMB_VFS_NEXT_TELLDIR(handle, - ((mh_dirinfo_struct*)dirp)->dirstream); -} - /* * Success: no success result defined. * Failure: no failure result defined. @@ -1845,8 +1820,6 @@ static struct vfs_fn_pointers vfs_mh_fns = { .fdopendir_fn = mh_fdopendir, .readdir_fn = mh_readdir, - .seekdir_fn = mh_seekdir, - .telldir_fn = mh_telldir, .rewind_dir_fn = mh_rewinddir, .mkdirat_fn = mh_mkdirat, .closedir_fn = mh_closedir, diff --git a/source3/modules/vfs_not_implemented.c b/source3/modules/vfs_not_implemented.c index 0d3294658cf..aeec1a4a376 100644 --- a/source3/modules/vfs_not_implemented.c +++ b/source3/modules/vfs_not_implemented.c @@ -175,19 +175,6 @@ struct dirent *vfs_not_implemented_readdir(vfs_handle_struct *handle, return NULL; } -_PUBLIC_ -void vfs_not_implemented_seekdir(vfs_handle_struct *handle, DIR *dirp, long offset) -{ - ; -} - -_PUBLIC_ -long vfs_not_implemented_telldir(vfs_handle_struct *handle, DIR *dirp) -{ - errno = ENOSYS; - return (long)-1; -} - _PUBLIC_ void vfs_not_implemented_rewind_dir(vfs_handle_struct *handle, DIR *dirp) { @@ -1092,8 +1079,6 @@ static struct vfs_fn_pointers vfs_not_implemented_fns = { .fdopendir_fn = vfs_not_implemented_fdopendir, .readdir_fn = vfs_not_implemented_readdir, - .seekdir_fn = vfs_not_implemented_seekdir, - .telldir_fn = vfs_not_implemented_telldir, .rewind_dir_fn = vfs_not_implemented_rewind_dir, .mkdirat_fn = vfs_not_implemented_mkdirat, .closedir_fn = vfs_not_implemented_closedir, diff --git a/source3/modules/vfs_shadow_copy.c b/source3/modules/vfs_shadow_copy.c index 36545ee05f5..7b1ff9c7fc1 100644 --- a/source3/modules/vfs_shadow_copy.c +++ b/source3/modules/vfs_shadow_copy.c @@ -139,21 +139,6 @@ static struct dirent *shadow_copy_readdir(vfs_handle_struct *handle, return NULL; } -static void shadow_copy_seekdir(struct vfs_handle_struct *handle, DIR *_dirp, long offset) -{ - shadow_copy_Dir *dirp = (shadow_copy_Dir *)_dirp; - - if (offset < dirp->num) { - dirp->pos = offset ; - } -} - -static long shadow_copy_telldir(struct vfs_handle_struct *handle, DIR *_dirp) -{ - shadow_copy_Dir *dirp = (shadow_copy_Dir *)_dirp; - return( dirp->pos ) ; -} - static void shadow_copy_rewinddir(struct vfs_handle_struct *handle, DIR *_dirp) { shadow_copy_Dir *dirp = (shadow_copy_Dir *)_dirp; @@ -261,8 +246,6 @@ static int shadow_copy_get_shadow_copy_data(vfs_handle_struct *handle, static struct vfs_fn_pointers vfs_shadow_copy_fns = { .fdopendir_fn = shadow_copy_fdopendir, .readdir_fn = shadow_copy_readdir, - .seekdir_fn = shadow_copy_seekdir, - .telldir_fn = shadow_copy_telldir, .rewind_dir_fn = shadow_copy_rewinddir, .closedir_fn = shadow_copy_closedir, .get_shadow_copy_data_fn = shadow_copy_get_shadow_copy_data, diff --git a/source3/modules/vfs_time_audit.c b/source3/modules/vfs_time_audit.c index 4942e4b8491..0807f024318 100644 --- a/source3/modules/vfs_time_audit.c +++ b/source3/modules/vfs_time_audit.c @@ -508,42 +508,6 @@ static struct dirent *smb_time_audit_readdir(vfs_handle_struct *handle, return result; } -static void smb_time_audit_seekdir(vfs_handle_struct *handle, - DIR *dirp, long offset) -{ - struct timespec ts1,ts2; - double timediff; - - clock_gettime_mono(&ts1); - SMB_VFS_NEXT_SEEKDIR(handle, dirp, offset); - clock_gettime_mono(&ts2); - timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9; - - if (timediff > audit_timeout) { - smb_time_audit_log("seekdir", timediff); - } - -} - -static long smb_time_audit_telldir(vfs_handle_struct *handle, - DIR *dirp) -{ - long result; - struct timespec ts1,ts2; - double timediff; - - clock_gettime_mono(&ts1); - result = SMB_VFS_NEXT_TELLDIR(handle, dirp); - clock_gettime_mono(&ts2); - timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9; - - if (timediff > audit_timeout) { - smb_time_audit_log("telldir", timediff); - } - - return result; -} - static void smb_time_audit_rewinddir(vfs_handle_struct *handle, DIR *dirp) { @@ -2749,8 +2713,6 @@ static struct vfs_fn_pointers vfs_time_audit_fns = { .read_dfs_pathat_fn = smb_time_audit_read_dfs_pathat, .fdopendir_fn = smb_time_audit_fdopendir, .readdir_fn = smb_time_audit_readdir, - .seekdir_fn = smb_time_audit_seekdir, - .telldir_fn = smb_time_audit_telldir, .rewind_dir_fn = smb_time_audit_rewinddir, .mkdirat_fn = smb_time_audit_mkdirat, .closedir_fn = smb_time_audit_closedir, diff --git a/source3/modules/vfs_unityed_media.c b/source3/modules/vfs_unityed_media.c index 3c1a263c25a..483afd5d5ce 100644 --- a/source3/modules/vfs_unityed_media.c +++ b/source3/modules/vfs_unityed_media.c @@ -712,23 +712,6 @@ err: return NULL; } -static void um_seekdir(vfs_handle_struct *handle, - DIR *dirp, - long offset) -{ - DEBUG(10, ("Entering and leaving um_seekdir\n")); - SMB_VFS_NEXT_SEEKDIR(handle, - ((um_dirinfo_struct*)dirp)->dirstream, offset); -} - -static long um_telldir(vfs_handle_struct *handle, - DIR *dirp) -{ - DEBUG(10, ("Entering and leaving um_telldir\n")); - return SMB_VFS_NEXT_TELLDIR(handle, - ((um_dirinfo_struct*)dirp)->dirstream); -} - static void um_rewinddir(vfs_handle_struct *handle, DIR *dirp) { @@ -1516,8 +1499,6 @@ static struct vfs_fn_pointers vfs_um_fns = { .fdopendir_fn = um_fdopendir, .readdir_fn = um_readdir, - .seekdir_fn = um_seekdir, - .telldir_fn = um_telldir, .rewind_dir_fn = um_rewinddir, .mkdirat_fn = um_mkdirat, .closedir_fn = um_closedir, diff --git a/source3/smbd/vfs.c b/source3/smbd/vfs.c index a4e5dedd7e4..305ac683d09 100644 --- a/source3/smbd/vfs.c +++ b/source3/smbd/vfs.c @@ -1498,20 +1498,6 @@ struct dirent *smb_vfs_call_readdir(struct vfs_handle_struct *handle, return handle->fns->readdir_fn(handle, dirfsp, dirp, sbuf); } -void smb_vfs_call_seekdir(struct vfs_handle_struct *handle, - DIR *dirp, long offset) -{ - VFS_FIND(seekdir); - handle->fns->seekdir_fn(handle, dirp, offset); -} - -long smb_vfs_call_telldir(struct vfs_handle_struct *handle, - DIR *dirp) -{ - VFS_FIND(telldir); - return handle->fns->telldir_fn(handle, dirp); -} - void smb_vfs_call_rewind_dir(struct vfs_handle_struct *handle, DIR *dirp) {