VFS: Remove SMB_VFS_CHMOD, no longer used
authorNoel Power <noel.power@suse.com>
Thu, 8 Apr 2021 12:03:57 +0000 (13:03 +0100)
committerNoel Power <npower@samba.org>
Sun, 11 Apr 2021 23:25:31 +0000 (23:25 +0000)
                               ---------------
                              /               \
                             /      REST       \
                            /        IN         \
                           /        PEACE        \
                          /                       \
                          |                       |
                          |     SMB_VFS_CHMOD     |
                          |                       |
                          |                       |
                          |       08 April        |
                          |         2021          |
                          |                       |
                          |                       |
                         *|     *  *  *           | *
                _________)/\\_//(\/(/\)/\//\/\////|_)_______

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Noel Power <npower@samba.org>
Autobuild-Date(master): Sun Apr 11 23:25:31 UTC 2021 on sn-devel-184

examples/VFS/skel_opaque.c
examples/VFS/skel_transparent.c
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 79ed98897be6a290370c229426c18a48404b7c5b..d0b14aaaae712d3fb86193327742ed6bab19c179 100644 (file)
@@ -362,14 +362,6 @@ static int skel_unlinkat(vfs_handle_struct *handle,
        return -1;
 }
 
-static int skel_chmod(vfs_handle_struct *handle,
-                       const struct smb_filename *smb_fname,
-                       mode_t mode)
-{
-       errno = ENOSYS;
-       return -1;
-}
-
 static int skel_fchmod(vfs_handle_struct *handle, files_struct *fsp,
                       mode_t mode)
 {
@@ -1037,7 +1029,6 @@ static struct vfs_fn_pointers skel_opaque_fns = {
        .lstat_fn = skel_lstat,
        .get_alloc_size_fn = skel_get_alloc_size,
        .unlinkat_fn = skel_unlinkat,
-       .chmod_fn = skel_chmod,
        .fchmod_fn = skel_fchmod,
        .fchown_fn = skel_fchown,
        .lchown_fn = skel_lchown,
index 6c5e9002e1670876b2fd7e2b7f87d0676dcd5b9a..c73e04fd58b5c5d124cc768fb180d63f12d257a2 100644 (file)
@@ -491,13 +491,6 @@ static int skel_unlinkat(vfs_handle_struct *handle,
                        flags);
 }
 
-static int skel_chmod(vfs_handle_struct *handle,
-                       const struct smb_filename *smb_fname,
-                       mode_t mode)
-{
-       return SMB_VFS_NEXT_CHMOD(handle, smb_fname, mode);
-}
-
 static int skel_fchmod(vfs_handle_struct *handle, files_struct *fsp,
                       mode_t mode)
 {
@@ -1342,7 +1335,6 @@ static struct vfs_fn_pointers skel_transparent_fns = {
        .lstat_fn = skel_lstat,
        .get_alloc_size_fn = skel_get_alloc_size,
        .unlinkat_fn = skel_unlinkat,
-       .chmod_fn = skel_chmod,
        .fchmod_fn = skel_fchmod,
        .fchown_fn = skel_fchown,
        .lchown_fn = skel_lchown,
index 3357f681b98f79b9573968bbc83124485ecf7a5a..7bbd5e189a8a31885fc93989b466602f14e3e367 100644 (file)
  * Version 45 - Remove SMB_VFS_SETXATTR
  * Version 45 - Remove SMB_VFS_REMOVEXATTR
  * Version 45 - Remove SMB_VFS_GET_DOS_ATTRIBUTES()
+ * Version 45 - Remove SMB_VFS_CHMOD
  */
 
 #define SMB_VFS_INTERFACE_VERSION 45
@@ -1005,9 +1006,6 @@ struct vfs_fn_pointers {
                        struct files_struct *srcdir_fsp,
                        const struct smb_filename *smb_fname,
                        int flags);
-       int (*chmod_fn)(struct vfs_handle_struct *handle,
-                       const struct smb_filename *smb_fname,
-                       mode_t mode);
        int (*fchmod_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, mode_t mode);
        int (*fchown_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, uid_t uid, gid_t gid);
        int (*lchown_fn)(struct vfs_handle_struct *handle,
@@ -1518,9 +1516,6 @@ int smb_vfs_call_unlinkat(struct vfs_handle_struct *handle,
                        struct files_struct *dirfsp,
                        const struct smb_filename *smb_fname,
                        int flags);
-int smb_vfs_call_chmod(struct vfs_handle_struct *handle,
-                       const struct smb_filename *smb_fname,
-                       mode_t mode);
 int smb_vfs_call_fchmod(struct vfs_handle_struct *handle,
                        struct files_struct *fsp, mode_t mode);
 int smb_vfs_call_fchown(struct vfs_handle_struct *handle,
@@ -1949,9 +1944,6 @@ int vfs_not_implemented_unlinkat(vfs_handle_struct *handle,
                                struct files_struct *dirfsp,
                                const struct smb_filename *smb_fname,
                                int flags);
-int vfs_not_implemented_chmod(vfs_handle_struct *handle,
-                             const struct smb_filename *smb_fname,
-                             mode_t mode);
 int vfs_not_implemented_fchmod(vfs_handle_struct *handle, files_struct *fsp,
                               mode_t mode);
 int vfs_not_implemented_fchown(vfs_handle_struct *handle, files_struct *fsp,
index 9ec9330095a819699f7630bea54005555383c7be..5247d56bfc908cccc6a18f5db41aeefd66116252 100644 (file)
 #define SMB_VFS_NEXT_UNLINKAT(handle, dirfsp, path, flags) \
        smb_vfs_call_unlinkat((handle)->next, (dirfsp), (path), (flags))
 
-#define SMB_VFS_CHMOD(conn, smb_fname, mode) \
-       smb_vfs_call_chmod((conn)->vfs_handles, (smb_fname), (mode))
-#define SMB_VFS_NEXT_CHMOD(handle, smb_fname, mode) \
-       smb_vfs_call_chmod((handle)->next, (smb_fname), (mode))
-
 #define SMB_VFS_FCHMOD(fsp, mode) \
        smb_vfs_call_fchmod((fsp)->conn->vfs_handles, (fsp), (mode))
 #define SMB_VFS_NEXT_FCHMOD(handle, fsp, mode) \
index 8e98b467bd5520e748e5fbcff105e39a90135771..376d7f51ea18caaf98b3e0a115b35cf1d985ae9a 100644 (file)
@@ -2408,18 +2408,6 @@ static int vfswrap_unlinkat(vfs_handle_struct *handle,
        return result;
 }
 
-static int vfswrap_chmod(vfs_handle_struct *handle,
-                       const struct smb_filename *smb_fname,
-                       mode_t mode)
-{
-       int result;
-
-       START_PROFILE(syscall_chmod);
-       result = chmod(smb_fname->base_name, mode);
-       END_PROFILE(syscall_chmod);
-       return result;
-}
-
 static int vfswrap_fchmod(vfs_handle_struct *handle, files_struct *fsp, mode_t mode)
 {
        int result;
@@ -3819,7 +3807,6 @@ static struct vfs_fn_pointers vfs_default_fns = {
        .lstat_fn = vfswrap_lstat,
        .get_alloc_size_fn = vfswrap_get_alloc_size,
        .unlinkat_fn = vfswrap_unlinkat,
-       .chmod_fn = vfswrap_chmod,
        .fchmod_fn = vfswrap_fchmod,
        .fchown_fn = vfswrap_fchown,
        .lchown_fn = vfswrap_lchown,
index 0163bed084e822a265d9a64a711b7ba02ca80158..8659524c7296eec410b2f9a8a2ef70f9db4b684a 100644 (file)
@@ -359,14 +359,6 @@ int vfs_not_implemented_unlinkat(vfs_handle_struct *handle,
        return -1;
 }
 
-int vfs_not_implemented_chmod(vfs_handle_struct *handle,
-                             const struct smb_filename *smb_fname,
-                             mode_t mode)
-{
-       errno = ENOSYS;
-       return -1;
-}
-
 int vfs_not_implemented_fchmod(vfs_handle_struct *handle, files_struct *fsp,
                               mode_t mode)
 {
@@ -1041,7 +1033,6 @@ static struct vfs_fn_pointers vfs_not_implemented_fns = {
        .lstat_fn = vfs_not_implemented_lstat,
        .get_alloc_size_fn = vfs_not_implemented_get_alloc_size,
        .unlinkat_fn = vfs_not_implemented_unlinkat,
-       .chmod_fn = vfs_not_implemented_chmod,
        .fchmod_fn = vfs_not_implemented_fchmod,
        .fchown_fn = vfs_not_implemented_fchown,
        .lchown_fn = vfs_not_implemented_lchown,
index ed138514c22bafd28f509a326fdab0d3971a6b55..90d88cef9a18756782ba3bb3dd9234159c0e9c9c 100644 (file)
@@ -2208,14 +2208,6 @@ int smb_vfs_call_unlinkat(struct vfs_handle_struct *handle,
                        flags);
 }
 
-int smb_vfs_call_chmod(struct vfs_handle_struct *handle,
-                       const struct smb_filename *smb_fname,
-                       mode_t mode)
-{
-       VFS_FIND(chmod);
-       return handle->fns->chmod_fn(handle, smb_fname, mode);
-}
-
 int smb_vfs_call_fchmod(struct vfs_handle_struct *handle,
                        struct files_struct *fsp, mode_t mode)
 {