summaryrefslogtreecommitdiff
path: root/source3/include
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2019-08-08 15:22:31 -0700
committerJeremy Allison <jra@samba.org>2019-08-16 19:52:32 +0000
commit606398a3a6da349877eb1d6f585e3f58778624b2 (patch)
tree11b1e92570bd0b38b460123710d9bfc8c4e11a1e /source3/include
parent75f98a19537c4d0791108ebfea82f3f9d4606cb3 (diff)
downloadsamba-606398a3a6da349877eb1d6f585e3f58778624b2.tar.gz
s3: VFS: Add SMB_VFS_RENAMEAT().
Currently identical to SMB_VFS_RENAME() - uses AT_FDCWD for both src and dst directories. Next, move add to all VFS modules that implement rename and eventually remove rename. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
Diffstat (limited to 'source3/include')
-rw-r--r--source3/include/smbprofile.h2
-rw-r--r--source3/include/vfs.h16
-rw-r--r--source3/include/vfs_macros.h5
3 files changed, 22 insertions, 1 deletions
diff --git a/source3/include/smbprofile.h b/source3/include/smbprofile.h
index 8888ae3eaa8..44335070b3c 100644
--- a/source3/include/smbprofile.h
+++ b/source3/include/smbprofile.h
@@ -62,7 +62,7 @@ struct tevent_context;
SMBPROFILE_STATS_BYTES(syscall_sendfile) \
SMBPROFILE_STATS_BYTES(syscall_recvfile) \
SMBPROFILE_STATS_BASIC(syscall_rename) \
- SMBPROFILE_STATS_BASIC(syscall_rename_at) \
+ SMBPROFILE_STATS_BASIC(syscall_renameat) \
SMBPROFILE_STATS_BYTES(syscall_asys_fsync) \
SMBPROFILE_STATS_BASIC(syscall_stat) \
SMBPROFILE_STATS_BASIC(syscall_fstat) \
diff --git a/source3/include/vfs.h b/source3/include/vfs.h
index d3e6ec258c3..2111173a772 100644
--- a/source3/include/vfs.h
+++ b/source3/include/vfs.h
@@ -272,6 +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. */
#define SMB_VFS_INTERFACE_VERSION 42
@@ -747,6 +748,11 @@ struct vfs_fn_pointers {
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,
+ struct files_struct *dstdir_fsp,
+ const struct smb_filename *smb_fname_dst);
struct tevent_req *(*fsync_send_fn)(struct vfs_handle_struct *handle,
TALLOC_CTX *mem_ctx,
struct tevent_context *ev,
@@ -1257,6 +1263,11 @@ ssize_t smb_vfs_call_recvfile(struct vfs_handle_struct *handle, int fromfd,
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,
+ struct files_struct *dstfsp,
+ const struct smb_filename *smb_fname_dst);
struct tevent_req *smb_vfs_call_fsync_send(struct vfs_handle_struct *handle,
TALLOC_CTX *mem_ctx,
@@ -1688,6 +1699,11 @@ ssize_t vfs_not_implemented_recvfile(vfs_handle_struct *handle, int fromfd,
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,
+ files_struct *dstfsp,
+ const struct smb_filename *smb_fname_dst);
struct tevent_req *vfs_not_implemented_fsync_send(struct vfs_handle_struct *handle,
TALLOC_CTX *mem_ctx,
struct tevent_context *ev,
diff --git a/source3/include/vfs_macros.h b/source3/include/vfs_macros.h
index fd0d9681084..d124b928f44 100644
--- a/source3/include/vfs_macros.h
+++ b/source3/include/vfs_macros.h
@@ -190,6 +190,11 @@
#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) \
+ smb_vfs_call_renameat((handle)->next, (oldfsp), (old), (newfsp), (new))
+
#define SMB_VFS_FSYNC(fsp) \
smb_vfs_call_fsync((fsp)->conn->vfs_handles, (fsp))
#define SMB_VFS_NEXT_FSYNC(handle, fsp) \