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,
.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,
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,
.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,
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) \
/* 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
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,
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,
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,
#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) \
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,
.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,
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,
.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,
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,