s3: VFS: Complete the replacement of SMB_VFS_UNLINK() -> SMB_VFS_UNLINKAT().
authorJeremy Allison <jra@samba.org>
Wed, 18 Sep 2019 17:04:03 +0000 (10:04 -0700)
committerRalph Boehme <slow@samba.org>
Thu, 26 Sep 2019 18:40:53 +0000 (18:40 +0000)
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 Sep 26 18:40:53 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 2695b82ab45a6d762eb2f5b3b40dab754503b6e7..59804675c8e56eec7891a98353c11fe9bf244fe8 100644 (file)
@@ -344,13 +344,6 @@ static uint64_t skel_get_alloc_size(struct vfs_handle_struct *handle,
        return -1;
 }
 
-static int skel_unlink(vfs_handle_struct *handle,
-                      const struct smb_filename *smb_fname)
-{
-       errno = ENOSYS;
-       return -1;
-}
-
 static int skel_unlinkat(vfs_handle_struct *handle,
                        struct files_struct *dirfsp,
                        const struct smb_filename *smb_fname,
@@ -1085,7 +1078,6 @@ static struct vfs_fn_pointers skel_opaque_fns = {
        .fstat_fn = skel_fstat,
        .lstat_fn = skel_lstat,
        .get_alloc_size_fn = skel_get_alloc_size,
-       .unlink_fn = skel_unlink,
        .unlinkat_fn = skel_unlinkat,
        .chmod_fn = skel_chmod,
        .fchmod_fn = skel_fchmod,
index f760730400b69c8fa3c3df72a38794f7b39a5b06..c73c2a2692b543c24212c3af3143a680d465071b 100644 (file)
@@ -462,12 +462,6 @@ static uint64_t skel_get_alloc_size(struct vfs_handle_struct *handle,
        return SMB_VFS_NEXT_GET_ALLOC_SIZE(handle, fsp, sbuf);
 }
 
-static int skel_unlink(vfs_handle_struct *handle,
-                      const struct smb_filename *smb_fname)
-{
-       return SMB_VFS_NEXT_UNLINK(handle, smb_fname);
-}
-
 static int skel_unlinkat(vfs_handle_struct *handle,
                        struct files_struct *dirfsp,
                        const struct smb_filename *smb_fname,
@@ -1372,7 +1366,6 @@ static struct vfs_fn_pointers skel_transparent_fns = {
        .fstat_fn = skel_fstat,
        .lstat_fn = skel_lstat,
        .get_alloc_size_fn = skel_get_alloc_size,
-       .unlink_fn = skel_unlink,
        .unlinkat_fn = skel_unlinkat,
        .chmod_fn = skel_chmod,
        .fchmod_fn = skel_fchmod,
index cc54669c77216400c2172ca8d9bdb87b0430ed78..cc54dea271092aec19e2f33f40033880da82334d 100644 (file)
@@ -67,7 +67,6 @@ struct tevent_context;
        SMBPROFILE_STATS_BASIC(syscall_fstat) \
        SMBPROFILE_STATS_BASIC(syscall_lstat) \
        SMBPROFILE_STATS_BASIC(syscall_get_alloc_size) \
-       SMBPROFILE_STATS_BASIC(syscall_unlink) \
        SMBPROFILE_STATS_BASIC(syscall_unlinkat) \
        SMBPROFILE_STATS_BASIC(syscall_chmod) \
        SMBPROFILE_STATS_BASIC(syscall_fchmod) \
index 883989c82ad988ba0610338826ca4c6ab3bb7baf..6ba653f56c74ed6fa32a808eaeba105326a82bb7 100644 (file)
 /* Version 42 - Move change_to_user() -> change_to_user_and_service() */
 /* Version 42 - Move change_to_user_by_fsp() -> change_to_user_and_service_by_fsp() */
 /* Version 42 - Move [un]become_user*() -> [un]become_user_without_service*() */
-/* Version 42 - Add SMB_VFS_UNLINKAT. */
+/* Version 42 - Move SMB_VFS_UNLINK -> SMB_VFS_UNLINKAT. */
 
 #define SMB_VFS_INTERFACE_VERSION 42
 
@@ -777,8 +777,6 @@ struct vfs_fn_pointers {
        int (*fstat_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_STAT *sbuf);
        int (*lstat_fn)(struct vfs_handle_struct *handle, struct smb_filename *smb_filename);
        uint64_t (*get_alloc_size_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, const SMB_STRUCT_STAT *sbuf);
-       int (*unlink_fn)(struct vfs_handle_struct *handle,
-                        const struct smb_filename *smb_fname);
        int (*unlinkat_fn)(struct vfs_handle_struct *handle,
                        struct files_struct *srcdir_fsp,
                        const struct smb_filename *smb_fname,
@@ -1308,8 +1306,6 @@ int smb_vfs_call_lstat(struct vfs_handle_struct *handle,
 uint64_t smb_vfs_call_get_alloc_size(struct vfs_handle_struct *handle,
                                     struct files_struct *fsp,
                                     const SMB_STRUCT_STAT *sbuf);
-int smb_vfs_call_unlink(struct vfs_handle_struct *handle,
-                       const struct smb_filename *smb_fname);
 int smb_vfs_call_unlinkat(struct vfs_handle_struct *handle,
                        struct files_struct *dirfsp,
                        const struct smb_filename *smb_fname,
@@ -1749,8 +1745,6 @@ int vfs_not_implemented_lstat(vfs_handle_struct *handle,
 uint64_t vfs_not_implemented_get_alloc_size(struct vfs_handle_struct *handle,
                                            struct files_struct *fsp,
                                            const SMB_STRUCT_STAT *sbuf);
-int vfs_not_implemented_unlink(vfs_handle_struct *handle,
-                              const struct smb_filename *smb_fname);
 int vfs_not_implemented_unlinkat(vfs_handle_struct *handle,
                                struct files_struct *dirfsp,
                                const struct smb_filename *smb_fname,
index 055555a4b07ef6d009d24382e583ffb0c40b2294..2979769e7d5d7990deb8b4f474b8411b6989b5ea 100644 (file)
 #define SMB_VFS_NEXT_GET_ALLOC_SIZE(conn, fsp, sbuf) \
        smb_vfs_call_get_alloc_size((conn)->next, (fsp), (sbuf))
 
-#define SMB_VFS_UNLINK(conn, path) \
-       smb_vfs_call_unlink((conn)->vfs_handles, (path))
-#define SMB_VFS_NEXT_UNLINK(handle, path) \
-       smb_vfs_call_unlink((handle)->next, (path))
-
 #define SMB_VFS_UNLINKAT(conn, dirfsp, path, flags) \
        smb_vfs_call_unlinkat((conn)->vfs_handles, (dirfsp), (path), (flags))
 #define SMB_VFS_NEXT_UNLINKAT(handle, dirfsp, path, flags) \
index de6d7892d5e22e8ce6785f777bfc96980b4d6426..781c5e06fadac892795da0a18cc8877d7417770b 100644 (file)
@@ -2204,24 +2204,6 @@ static uint64_t vfswrap_get_alloc_size(vfs_handle_struct *handle,
        return result;
 }
 
-static int vfswrap_unlink(vfs_handle_struct *handle,
-                         const struct smb_filename *smb_fname)
-{
-       int result = -1;
-
-       START_PROFILE(syscall_unlink);
-
-       if (smb_fname->stream_name) {
-               errno = ENOENT;
-               goto out;
-       }
-       result = unlink(smb_fname->base_name);
-
- out:
-       END_PROFILE(syscall_unlink);
-       return result;
-}
-
 static int vfswrap_unlinkat(vfs_handle_struct *handle,
                        struct files_struct *dirfsp,
                        const struct smb_filename *smb_fname,
@@ -3511,7 +3493,6 @@ static struct vfs_fn_pointers vfs_default_fns = {
        .fstat_fn = vfswrap_fstat,
        .lstat_fn = vfswrap_lstat,
        .get_alloc_size_fn = vfswrap_get_alloc_size,
-       .unlink_fn = vfswrap_unlink,
        .unlinkat_fn = vfswrap_unlinkat,
        .chmod_fn = vfswrap_chmod,
        .fchmod_fn = vfswrap_fchmod,
index 0c7a8e686f0a8e90bdb1cae7b9a443b54ee76268..ffcba7bd8db4411400440b064a06b615487925b1 100644 (file)
@@ -342,13 +342,6 @@ uint64_t vfs_not_implemented_get_alloc_size(struct vfs_handle_struct *handle,
        return -1;
 }
 
-int vfs_not_implemented_unlink(vfs_handle_struct *handle,
-                              const struct smb_filename *smb_fname)
-{
-       errno = ENOSYS;
-       return -1;
-}
-
 int vfs_not_implemented_unlinkat(vfs_handle_struct *handle,
                        struct files_struct *dirfsp,
                        const struct smb_filename *smb_fname,
@@ -1089,7 +1082,6 @@ static struct vfs_fn_pointers vfs_not_implemented_fns = {
        .fstat_fn = vfs_not_implemented_fstat,
        .lstat_fn = vfs_not_implemented_lstat,
        .get_alloc_size_fn = vfs_not_implemented_get_alloc_size,
-       .unlink_fn = vfs_not_implemented_unlink,
        .unlinkat_fn = vfs_not_implemented_unlinkat,
        .chmod_fn = vfs_not_implemented_chmod,
        .fchmod_fn = vfs_not_implemented_fchmod,
index 4a0c375e48e9d05b5cb3f604c6ec4f8745ad2ccd..b83cf1e4d559ba83c6db39ba8aef65916ec9809e 100644 (file)
@@ -1974,13 +1974,6 @@ uint64_t smb_vfs_call_get_alloc_size(struct vfs_handle_struct *handle,
        return handle->fns->get_alloc_size_fn(handle, fsp, sbuf);
 }
 
-int smb_vfs_call_unlink(struct vfs_handle_struct *handle,
-                       const struct smb_filename *smb_fname)
-{
-       VFS_FIND(unlink);
-       return handle->fns->unlink_fn(handle, smb_fname);
-}
-
 int smb_vfs_call_unlinkat(struct vfs_handle_struct *handle,
                        struct files_struct *dirfsp,
                        const struct smb_filename *smb_fname,