]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: VFS: Complete the replacement of SMB_VFS_RENAME() -> SMB_VFS_RENAMEAT().
authorJeremy Allison <jra@samba.org>
Fri, 9 Aug 2019 23:28:32 +0000 (16:28 -0700)
committerJeremy Allison <jra@samba.org>
Fri, 16 Aug 2019 19:52:37 +0000 (19:52 +0000)
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
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 fa0de6680d63e7035d558211e769c2e944c81319..40e16c342efa74ba3cc589250cc4160997cb27a4 100644 (file)
@@ -290,14 +290,6 @@ static ssize_t skel_recvfile(vfs_handle_struct *handle, int fromfd,
        return -1;
 }
 
-static int skel_rename(vfs_handle_struct *handle,
-                      const struct smb_filename *smb_fname_src,
-                      const struct smb_filename *smb_fname_dst)
-{
-       errno = ENOSYS;
-       return -1;
-}
-
 static int skel_renameat(vfs_handle_struct *handle,
                       files_struct *srcfsp,
                       const struct smb_filename *smb_fname_src,
@@ -1070,7 +1062,6 @@ static struct vfs_fn_pointers skel_opaque_fns = {
        .lseek_fn = skel_lseek,
        .sendfile_fn = skel_sendfile,
        .recvfile_fn = skel_recvfile,
-       .rename_fn = skel_rename,
        .renameat_fn = skel_renameat,
        .fsync_send_fn = skel_fsync_send,
        .fsync_recv_fn = skel_fsync_recv,
index 82ba5525d420ba9be7a76c23b662c367f0a8f708..b5d4437746383b0fcc89bf30668c812850309870 100644 (file)
@@ -369,13 +369,6 @@ static ssize_t skel_recvfile(vfs_handle_struct *handle, int fromfd,
        return SMB_VFS_NEXT_RECVFILE(handle, fromfd, tofsp, offset, n);
 }
 
-static int skel_rename(vfs_handle_struct *handle,
-                      const struct smb_filename *smb_fname_src,
-                      const struct smb_filename *smb_fname_dst)
-{
-       return SMB_VFS_NEXT_RENAME(handle, smb_fname_src, smb_fname_dst);
-}
-
 static int skel_renameat(vfs_handle_struct *handle,
                       files_struct *srcfsp,
                       const struct smb_filename *smb_fname_src,
@@ -1335,7 +1328,6 @@ static struct vfs_fn_pointers skel_transparent_fns = {
        .lseek_fn = skel_lseek,
        .sendfile_fn = skel_sendfile,
        .recvfile_fn = skel_recvfile,
-       .rename_fn = skel_rename,
        .renameat_fn = skel_renameat,
        .fsync_send_fn = skel_fsync_send,
        .fsync_recv_fn = skel_fsync_recv,
index 44335070b3c7e2952b1a2a7d5c84a34dab00ea36..c479c76d508623c40757c02c19bd2a0c281b78a3 100644 (file)
@@ -61,7 +61,6 @@ struct tevent_context;
        SMBPROFILE_STATS_BASIC(syscall_lseek) \
        SMBPROFILE_STATS_BYTES(syscall_sendfile) \
        SMBPROFILE_STATS_BYTES(syscall_recvfile) \
-       SMBPROFILE_STATS_BASIC(syscall_rename) \
        SMBPROFILE_STATS_BASIC(syscall_renameat) \
        SMBPROFILE_STATS_BYTES(syscall_asys_fsync) \
        SMBPROFILE_STATS_BASIC(syscall_stat) \
index 2111173a772c4ab4297497547e1477a8e6dd7df0..dc407772079f437a69d88824bd045424902838b5 100644 (file)
 /* Bump to version 42, Samba 4.12 will ship with that */
 /* Version 42 - Remove share_access member from struct files_struct */
 /* Version 42 - Make "lease" a const* in create_file_fn */
-/* Version 42 - Add SMB_VFS_RENAMEAT. */
+/* Version 42 - Move SMB_VFS_RENAME -> SMB_VFS_RENAMEAT */
 
 #define SMB_VFS_INTERFACE_VERSION 42
 
@@ -745,9 +745,6 @@ struct vfs_fn_pointers {
        off_t (*lseek_fn)(struct vfs_handle_struct *handle, struct files_struct *fsp, off_t offset, int whence);
        ssize_t (*sendfile_fn)(struct vfs_handle_struct *handle, int tofd, files_struct *fromfsp, const DATA_BLOB *header, off_t offset, size_t count);
        ssize_t (*recvfile_fn)(struct vfs_handle_struct *handle, int fromfd, files_struct *tofsp, off_t offset, size_t count);
-       int (*rename_fn)(struct vfs_handle_struct *handle,
-                        const struct smb_filename *smb_fname_src,
-                        const struct smb_filename *smb_fname_dst);
        int (*renameat_fn)(struct vfs_handle_struct *handle,
                         struct files_struct *srcdir_fsp,
                         const struct smb_filename *smb_fname_src,
@@ -1260,9 +1257,6 @@ ssize_t smb_vfs_call_sendfile(struct vfs_handle_struct *handle, int tofd,
 ssize_t smb_vfs_call_recvfile(struct vfs_handle_struct *handle, int fromfd,
                              files_struct *tofsp, off_t offset,
                              size_t count);
-int smb_vfs_call_rename(struct vfs_handle_struct *handle,
-                       const struct smb_filename *smb_fname_src,
-                       const struct smb_filename *smb_fname_dst);
 int smb_vfs_call_renameat(struct vfs_handle_struct *handle,
                        struct files_struct *srcfsp,
                        const struct smb_filename *smb_fname_src,
@@ -1696,9 +1690,6 @@ ssize_t vfs_not_implemented_sendfile(vfs_handle_struct *handle, int tofd,
                                     off_t offset, size_t n);
 ssize_t vfs_not_implemented_recvfile(vfs_handle_struct *handle, int fromfd,
                                     files_struct *tofsp, off_t offset, size_t n);
-int vfs_not_implemented_rename(vfs_handle_struct *handle,
-                              const struct smb_filename *smb_fname_src,
-                              const struct smb_filename *smb_fname_dst);
 int vfs_not_implemented_renameat(vfs_handle_struct *handle,
                               files_struct *srcfsp,
                               const struct smb_filename *smb_fname_src,
index d124b928f44d9ff865e922e0ed18c0ee1e62f7be..7bbdc97a6c6af58159f3f92b29500d5d4b11e930 100644 (file)
 #define SMB_VFS_NEXT_RECVFILE(handle, fromfd, tofsp, offset, count) \
        smb_vfs_call_recvfile((handle)->next, (fromfd), (tofsp), (offset), (count))
 
-#define SMB_VFS_RENAME(conn, old, new) \
-       smb_vfs_call_rename((conn)->vfs_handles, (old), (new))
-#define SMB_VFS_NEXT_RENAME(handle, old, new) \
-       smb_vfs_call_rename((handle)->next, (old), (new))
-
 #define SMB_VFS_RENAMEAT(conn, oldfsp, old, newfsp, new) \
        smb_vfs_call_renameat((conn)->vfs_handles, (oldfsp), (old), (newfsp), (new))
 #define SMB_VFS_NEXT_RENAMEAT(handle, oldfsp, old, newfsp, new) \
index dee8ac39a7103551037cdc461908a8f3c97f9824..3ef94d26b6097e89362800c78006e756558bf463 100644 (file)
@@ -1067,26 +1067,6 @@ static ssize_t vfswrap_recvfile(vfs_handle_struct *handle,
        return result;
 }
 
-static int vfswrap_rename(vfs_handle_struct *handle,
-                         const struct smb_filename *smb_fname_src,
-                         const struct smb_filename *smb_fname_dst)
-{
-       int result = -1;
-
-       START_PROFILE(syscall_rename);
-
-       if (smb_fname_src->stream_name || smb_fname_dst->stream_name) {
-               errno = ENOENT;
-               goto out;
-       }
-
-       result = rename(smb_fname_src->base_name, smb_fname_dst->base_name);
-
- out:
-       END_PROFILE(syscall_rename);
-       return result;
-}
-
 static int vfswrap_renameat(vfs_handle_struct *handle,
                          files_struct *srcfsp,
                          const struct smb_filename *smb_fname_src,
@@ -3463,7 +3443,6 @@ static struct vfs_fn_pointers vfs_default_fns = {
        .lseek_fn = vfswrap_lseek,
        .sendfile_fn = vfswrap_sendfile,
        .recvfile_fn = vfswrap_recvfile,
-       .rename_fn = vfswrap_rename,
        .renameat_fn = vfswrap_renameat,
        .fsync_send_fn = vfswrap_fsync_send,
        .fsync_recv_fn = vfswrap_fsync_recv,
index 1117032c242121ed4e7f5f5afd8e5db71bace780..0a88f9e08cb03a2c18ad5762b5e9204b91e9f3c4 100644 (file)
@@ -288,14 +288,6 @@ ssize_t vfs_not_implemented_recvfile(vfs_handle_struct *handle, int fromfd,
        return -1;
 }
 
-int vfs_not_implemented_rename(vfs_handle_struct *handle,
-                              const struct smb_filename *smb_fname_src,
-                              const struct smb_filename *smb_fname_dst)
-{
-       errno = ENOSYS;
-       return -1;
-}
-
 int vfs_not_implemented_renameat(vfs_handle_struct *handle,
                               files_struct *srcfsp,
                               const struct smb_filename *smb_fname_src,
@@ -1074,7 +1066,6 @@ static struct vfs_fn_pointers vfs_not_implemented_fns = {
        .lseek_fn = vfs_not_implemented_lseek,
        .sendfile_fn = vfs_not_implemented_sendfile,
        .recvfile_fn = vfs_not_implemented_recvfile,
-       .rename_fn = vfs_not_implemented_rename,
        .renameat_fn = vfs_not_implemented_renameat,
        .fsync_send_fn = vfs_not_implemented_fsync_send,
        .fsync_recv_fn = vfs_not_implemented_fsync_recv,
index 5acdb74aa760a06258307771dbaf33599343ff2b..ace5963359807b8460a83ae537a6519703cc244f 100644 (file)
@@ -1823,14 +1823,6 @@ ssize_t smb_vfs_call_recvfile(struct vfs_handle_struct *handle, int fromfd,
        return handle->fns->recvfile_fn(handle, fromfd, tofsp, offset, count);
 }
 
-int smb_vfs_call_rename(struct vfs_handle_struct *handle,
-                       const struct smb_filename *smb_fname_src,
-                       const struct smb_filename *smb_fname_dst)
-{
-       VFS_FIND(rename);
-       return handle->fns->rename_fn(handle, smb_fname_src, smb_fname_dst);
-}
-
 int smb_vfs_call_renameat(struct vfs_handle_struct *handle,
                        files_struct *srcfsp,
                        const struct smb_filename *smb_fname_src,