s3: VFS: Complete the removal of SMB_VFS_RMDIR()
authorJeremy Allison <jra@samba.org>
Fri, 4 Oct 2019 22:41:21 +0000 (15:41 -0700)
committerRalph Boehme <slow@samba.org>
Thu, 10 Oct 2019 07:26:43 +0000 (07:26 +0000)
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

examples/VFS/skel_opaque.c
examples/VFS/skel_transparent.c
source3/include/smbprofile.h
source3/include/vfs.h
source3/include/vfs_macros.h
source3/modules/vfs_default.c
source3/modules/vfs_not_implemented.c
source3/smbd/vfs.c

index be3773965e78747611fa669e3c654f785434b02f..497ec90760e7437fee7402871bfa8482038f9fa4 100644 (file)
@@ -174,13 +174,6 @@ static int skel_mkdirat(vfs_handle_struct *handle,
        return -1;
 }
 
-static int skel_rmdir(vfs_handle_struct *handle,
-               const struct smb_filename *smb_fname)
-{
-       errno = ENOSYS;
-       return -1;
-}
-
 static int skel_closedir(vfs_handle_struct *handle, DIR *dir)
 {
        errno = ENOSYS;
@@ -1061,7 +1054,6 @@ static struct vfs_fn_pointers skel_opaque_fns = {
        .telldir_fn = skel_telldir,
        .rewind_dir_fn = skel_rewind_dir,
        .mkdirat_fn = skel_mkdirat,
-       .rmdir_fn = skel_rmdir,
        .closedir_fn = skel_closedir,
 
        /* File operations */
index 063af8f3aed69c0e2e918cfbb02a853a3fcce672..c827701756523c87f3d039e7de1a7b9e90002781 100644 (file)
@@ -175,12 +175,6 @@ static int skel_mkdirat(vfs_handle_struct *handle,
                        mode);
 }
 
-static int skel_rmdir(vfs_handle_struct *handle,
-               const struct smb_filename *smb_fname)
-{
-       return SMB_VFS_NEXT_RMDIR(handle, smb_fname);
-}
-
 static int skel_closedir(vfs_handle_struct *handle, DIR *dir)
 {
        return SMB_VFS_NEXT_CLOSEDIR(handle, dir);
@@ -1357,7 +1351,6 @@ static struct vfs_fn_pointers skel_transparent_fns = {
        .telldir_fn = skel_telldir,
        .rewind_dir_fn = skel_rewind_dir,
        .mkdirat_fn = skel_mkdirat,
-       .rmdir_fn = skel_rmdir,
        .closedir_fn = skel_closedir,
 
        /* File operations */
index ea2a29a0758c319ad4b3f2b4a807883b5464fffa..41621c4e862ef98e80eaf9b19c4c9f07f870c3c6 100644 (file)
@@ -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) \
index 326687f5ee109ce62d8c9ed52ec2629213bf3faa..5ea4f8058174500bf7860b96d4d1a30bb192f3b8 100644 (file)
 /* 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,
index 2dd59711e190b6f465ebc60d09987aff9416dda6..95cf4cf3088f14619f05ccaabfac63850a132713 100644 (file)
 #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) \
index 9bf8005bcd7a31df5019c54eb80e9b2319716d30..13d849c5084d7dd68b052def9ce887f07f36ec40 100644 (file)
@@ -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 */
index 2b906b3cf281ee1d1af6a2b83ed44755db893ca1..083ebc9e1f183901dd07a412852945cd8d6a6799 100644 (file)
@@ -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 */
index 5332f00e876291bf8c7129b15a663464a717d12c..34923b62ab42982c0f99bc0e8f8da92aea89c989 100644 (file)
@@ -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)
 {