diff options
author | Jeremy Allison <jra@samba.org> | 2019-10-04 15:41:21 -0700 |
---|---|---|
committer | Ralph Boehme <slow@samba.org> | 2019-10-10 07:26:43 +0000 |
commit | 81fbba8f649e4115961eb77462ca450e7a30611e (patch) | |
tree | 0dfa71be5fca95f86fd32f5772cb69551629cc05 /source3 | |
parent | 5bf96b1f0b61847771aab7be35121a1d5c15554e (diff) | |
download | samba-81fbba8f649e4115961eb77462ca450e7a30611e.tar.gz |
s3: VFS: Complete the removal of SMB_VFS_RMDIR()
All users now use SMB_VFS_UNLINKAT(..., AT_REMOVEDIR).
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Thu Oct 10 07:26:43 UTC 2019 on sn-devel-184
Diffstat (limited to 'source3')
-rw-r--r-- | source3/include/smbprofile.h | 1 | ||||
-rw-r--r-- | source3/include/vfs.h | 8 | ||||
-rw-r--r-- | source3/include/vfs_macros.h | 5 | ||||
-rw-r--r-- | source3/modules/vfs_default.c | 12 | ||||
-rw-r--r-- | source3/modules/vfs_not_implemented.c | 8 | ||||
-rw-r--r-- | source3/smbd/vfs.c | 7 |
6 files changed, 2 insertions, 39 deletions
diff --git a/source3/include/smbprofile.h b/source3/include/smbprofile.h index ea2a29a0758..41621c4e862 100644 --- a/source3/include/smbprofile.h +++ b/source3/include/smbprofile.h @@ -49,7 +49,6 @@ struct tevent_context; SMBPROFILE_STATS_BASIC(syscall_telldir) \ SMBPROFILE_STATS_BASIC(syscall_rewinddir) \ SMBPROFILE_STATS_BASIC(syscall_mkdirat) \ - SMBPROFILE_STATS_BASIC(syscall_rmdir) \ SMBPROFILE_STATS_BASIC(syscall_closedir) \ SMBPROFILE_STATS_BASIC(syscall_open) \ SMBPROFILE_STATS_BASIC(syscall_createfile) \ diff --git a/source3/include/vfs.h b/source3/include/vfs.h index 326687f5ee1..5ea4f805817 100644 --- a/source3/include/vfs.h +++ b/source3/include/vfs.h @@ -283,6 +283,8 @@ /* Version 42 - Move [un]become_user*() -> [un]become_user_without_service*() */ /* Version 42 - Move SMB_VFS_UNLINK -> SMB_VFS_UNLINKAT. */ /* Version 42 - Add SMB_VFS_FCNTL */ +/* Version 42 - Remove SMB_VFS_RMDIR. + Use SMB_VFS_UNLINKAT(.., AT_REMOVEDIR) instead. */ #define SMB_VFS_INTERFACE_VERSION 42 @@ -716,8 +718,6 @@ struct vfs_fn_pointers { struct files_struct *dirfsp, const struct smb_filename *smb_fname, mode_t mode); - int (*rmdir_fn)(struct vfs_handle_struct *handle, - const struct smb_filename *smb_fname); int (*closedir_fn)(struct vfs_handle_struct *handle, DIR *dir); /* File operations */ @@ -1228,8 +1228,6 @@ int smb_vfs_call_mkdirat(struct vfs_handle_struct *handle, struct files_struct *dirfsp, const struct smb_filename *smb_fname, mode_t mode); -int smb_vfs_call_rmdir(struct vfs_handle_struct *handle, - const struct smb_filename *smb_fname); int smb_vfs_call_closedir(struct vfs_handle_struct *handle, DIR *dir); int smb_vfs_call_open(struct vfs_handle_struct *handle, @@ -1680,8 +1678,6 @@ int vfs_not_implemented_mkdirat(vfs_handle_struct *handle, struct files_struct *dirfsp, const struct smb_filename *smb_fname, mode_t mode); -int vfs_not_implemented_rmdir(vfs_handle_struct *handle, - const struct smb_filename *smb_fname); int vfs_not_implemented_closedir(vfs_handle_struct *handle, DIR *dir); int vfs_not_implemented_open(vfs_handle_struct *handle, struct smb_filename *smb_fname, diff --git a/source3/include/vfs_macros.h b/source3/include/vfs_macros.h index 2dd59711e19..95cf4cf3088 100644 --- a/source3/include/vfs_macros.h +++ b/source3/include/vfs_macros.h @@ -114,11 +114,6 @@ #define SMB_VFS_NEXT_MKDIRAT(handle, dirfsp, smb_fname, mode) \ smb_vfs_call_mkdirat((handle)->next,(dirfsp), (smb_fname), (mode)) -#define SMB_VFS_RMDIR(conn, smb_fname) \ - smb_vfs_call_rmdir((conn)->vfs_handles, (smb_fname)) -#define SMB_VFS_NEXT_RMDIR(handle, smb_fname) \ - smb_vfs_call_rmdir((handle)->next, (smb_fname)) - #define SMB_VFS_CLOSEDIR(conn, dir) \ smb_vfs_call_closedir((conn)->vfs_handles, dir) #define SMB_VFS_NEXT_CLOSEDIR(handle, dir) \ diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c index 9bf8005bcd7..13d849c5084 100644 --- a/source3/modules/vfs_default.c +++ b/source3/modules/vfs_default.c @@ -520,17 +520,6 @@ static int vfswrap_mkdirat(vfs_handle_struct *handle, return result; } -static int vfswrap_rmdir(vfs_handle_struct *handle, - const struct smb_filename *smb_fname) -{ - int result; - - START_PROFILE(syscall_rmdir); - result = rmdir(smb_fname->base_name); - END_PROFILE(syscall_rmdir); - return result; -} - static int vfswrap_closedir(vfs_handle_struct *handle, DIR *dirp) { int result; @@ -3514,7 +3503,6 @@ static struct vfs_fn_pointers vfs_default_fns = { .telldir_fn = vfswrap_telldir, .rewind_dir_fn = vfswrap_rewinddir, .mkdirat_fn = vfswrap_mkdirat, - .rmdir_fn = vfswrap_rmdir, .closedir_fn = vfswrap_closedir, /* File operations */ diff --git a/source3/modules/vfs_not_implemented.c b/source3/modules/vfs_not_implemented.c index 2b906b3cf28..083ebc9e1f1 100644 --- a/source3/modules/vfs_not_implemented.c +++ b/source3/modules/vfs_not_implemented.c @@ -171,13 +171,6 @@ int vfs_not_implemented_mkdirat(vfs_handle_struct *handle, return -1; } -int vfs_not_implemented_rmdir(vfs_handle_struct *handle, - const struct smb_filename *smb_fname) -{ - errno = ENOSYS; - return -1; -} - int vfs_not_implemented_closedir(vfs_handle_struct *handle, DIR *dir) { errno = ENOSYS; @@ -1066,7 +1059,6 @@ static struct vfs_fn_pointers vfs_not_implemented_fns = { .telldir_fn = vfs_not_implemented_telldir, .rewind_dir_fn = vfs_not_implemented_rewind_dir, .mkdirat_fn = vfs_not_implemented_mkdirat, - .rmdir_fn = vfs_not_implemented_rmdir, .closedir_fn = vfs_not_implemented_closedir, /* File operations */ diff --git a/source3/smbd/vfs.c b/source3/smbd/vfs.c index 5332f00e876..34923b62ab4 100644 --- a/source3/smbd/vfs.c +++ b/source3/smbd/vfs.c @@ -1623,13 +1623,6 @@ int smb_vfs_call_mkdirat(struct vfs_handle_struct *handle, mode); } -int smb_vfs_call_rmdir(struct vfs_handle_struct *handle, - const struct smb_filename *smb_fname) -{ - VFS_FIND(rmdir); - return handle->fns->rmdir_fn(handle, smb_fname); -} - int smb_vfs_call_closedir(struct vfs_handle_struct *handle, DIR *dir) { |