diff options
author | Jeremy Allison <jra@samba.org> | 2019-08-09 16:28:32 -0700 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2019-08-16 19:52:37 +0000 |
commit | 6acf4c35b46e8e7860209be00b688c631f0155bf (patch) | |
tree | f20272d40e14b01cc07968fe1d774960344e7b7d | |
parent | f0ac39d56156257275048a55f101665e32905da9 (diff) | |
download | samba-6acf4c35b46e8e7860209be00b688c631f0155bf.tar.gz |
s3: VFS: Complete the replacement of SMB_VFS_RENAME() -> SMB_VFS_RENAMEAT().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
-rw-r--r-- | examples/VFS/skel_opaque.c | 9 | ||||
-rw-r--r-- | examples/VFS/skel_transparent.c | 8 | ||||
-rw-r--r-- | source3/include/smbprofile.h | 1 | ||||
-rw-r--r-- | source3/include/vfs.h | 11 | ||||
-rw-r--r-- | source3/include/vfs_macros.h | 5 | ||||
-rw-r--r-- | source3/modules/vfs_default.c | 21 | ||||
-rw-r--r-- | source3/modules/vfs_not_implemented.c | 9 | ||||
-rw-r--r-- | source3/smbd/vfs.c | 8 |
8 files changed, 1 insertions, 71 deletions
diff --git a/examples/VFS/skel_opaque.c b/examples/VFS/skel_opaque.c index fa0de6680d6..40e16c342ef 100644 --- a/examples/VFS/skel_opaque.c +++ b/examples/VFS/skel_opaque.c @@ -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, diff --git a/examples/VFS/skel_transparent.c b/examples/VFS/skel_transparent.c index 82ba5525d42..b5d44377463 100644 --- a/examples/VFS/skel_transparent.c +++ b/examples/VFS/skel_transparent.c @@ -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, diff --git a/source3/include/smbprofile.h b/source3/include/smbprofile.h index 44335070b3c..c479c76d508 100644 --- a/source3/include/smbprofile.h +++ b/source3/include/smbprofile.h @@ -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) \ diff --git a/source3/include/vfs.h b/source3/include/vfs.h index 2111173a772..dc407772079 100644 --- a/source3/include/vfs.h +++ b/source3/include/vfs.h @@ -272,7 +272,7 @@ /* 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, diff --git a/source3/include/vfs_macros.h b/source3/include/vfs_macros.h index d124b928f44..7bbdc97a6c6 100644 --- a/source3/include/vfs_macros.h +++ b/source3/include/vfs_macros.h @@ -185,11 +185,6 @@ #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) \ diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c index dee8ac39a71..3ef94d26b60 100644 --- a/source3/modules/vfs_default.c +++ b/source3/modules/vfs_default.c @@ -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, diff --git a/source3/modules/vfs_not_implemented.c b/source3/modules/vfs_not_implemented.c index 1117032c242..0a88f9e08cb 100644 --- a/source3/modules/vfs_not_implemented.c +++ b/source3/modules/vfs_not_implemented.c @@ -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, diff --git a/source3/smbd/vfs.c b/source3/smbd/vfs.c index 5acdb74aa76..ace59633598 100644 --- a/source3/smbd/vfs.c +++ b/source3/smbd/vfs.c @@ -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, |