1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-03 13:47:25 +03:00

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>
This commit is contained in:
Jeremy Allison 2019-08-09 16:28:32 -07:00
parent f0ac39d561
commit 6acf4c35b4
8 changed files with 1 additions and 71 deletions

View 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,

View 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,

View 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) \

View File

@ -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,

View File

@ -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) \

View 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,

View 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,

View 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,