diff options
author | Jeremy Allison <jra@samba.org> | 2019-08-12 16:49:26 -0700 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2019-08-20 21:09:27 +0000 |
commit | 6c3928e4e5b724190843f75bec3e697af77a01a0 (patch) | |
tree | 0d55473b43db8b53d29fc218514efee93adfce2b /source3/include | |
parent | 098486da91bdf431489879154e297591edef7f83 (diff) | |
download | samba-6c3928e4e5b724190843f75bec3e697af77a01a0.tar.gz |
s3: VFS: Add SMB_VFS_LINKAT().
Currently identical to SMB_VFS_LINK().
Next, move add to all VFS modules that implement
link and eventually remove link.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <slow@samba.org>
Diffstat (limited to 'source3/include')
-rw-r--r-- | source3/include/smbprofile.h | 1 | ||||
-rw-r--r-- | source3/include/vfs.h | 19 | ||||
-rw-r--r-- | source3/include/vfs_macros.h | 5 |
3 files changed, 25 insertions, 0 deletions
diff --git a/source3/include/smbprofile.h b/source3/include/smbprofile.h index c479c76d508..82021a22448 100644 --- a/source3/include/smbprofile.h +++ b/source3/include/smbprofile.h @@ -85,6 +85,7 @@ struct tevent_context; SMBPROFILE_STATS_BASIC(syscall_readlink) \ SMBPROFILE_STATS_BASIC(syscall_symlink) \ SMBPROFILE_STATS_BASIC(syscall_link) \ + SMBPROFILE_STATS_BASIC(syscall_linkat) \ SMBPROFILE_STATS_BASIC(syscall_mknod) \ SMBPROFILE_STATS_BASIC(syscall_realpath) \ SMBPROFILE_STATS_BASIC(syscall_get_quota) \ diff --git a/source3/include/vfs.h b/source3/include/vfs.h index dc407772079..4b9c1ed949f 100644 --- a/source3/include/vfs.h +++ b/source3/include/vfs.h @@ -273,6 +273,7 @@ /* Version 42 - Remove share_access member from struct files_struct */ /* Version 42 - Make "lease" a const* in create_file_fn */ /* Version 42 - Move SMB_VFS_RENAME -> SMB_VFS_RENAMEAT */ +/* Version 42 - Add SMB_VFS_LINKAT. */ #define SMB_VFS_INTERFACE_VERSION 42 @@ -802,6 +803,12 @@ struct vfs_fn_pointers { int (*link_fn)(struct vfs_handle_struct *handle, const struct smb_filename *old_smb_fname, const struct smb_filename *new_smb_fname); + int (*linkat_fn)(struct vfs_handle_struct *handle, + struct files_struct *srcfsp, + const struct smb_filename *old_smb_fname, + struct files_struct *dstfsp, + const struct smb_filename *new_smb_fname, + int flags); int (*mknod_fn)(struct vfs_handle_struct *handle, const struct smb_filename *smb_fname, mode_t mode, @@ -1331,6 +1338,12 @@ int smb_vfs_call_readlink(struct vfs_handle_struct *handle, int smb_vfs_call_link(struct vfs_handle_struct *handle, const struct smb_filename *old_smb_fname, const struct smb_filename *new_smb_fname); +int smb_vfs_call_linkat(struct vfs_handle_struct *handle, + struct files_struct *srcfsp, + const struct smb_filename *old_smb_fname, + struct files_struct *dstfsp, + const struct smb_filename *new_smb_fname, + int flags); int smb_vfs_call_mknod(struct vfs_handle_struct *handle, const struct smb_filename *smb_fname, mode_t mode, @@ -1757,6 +1770,12 @@ int vfs_not_implemented_vfs_readlink(vfs_handle_struct *handle, int vfs_not_implemented_link(vfs_handle_struct *handle, const struct smb_filename *old_smb_fname, const struct smb_filename *new_smb_fname); +int vfs_not_implemented_linkat(vfs_handle_struct *handle, + struct files_struct *srcfsp, + const struct smb_filename *old_smb_fname, + struct files_struct *dstfsp, + const struct smb_filename *new_smb_fname, + int flags); int vfs_not_implemented_mknod(vfs_handle_struct *handle, const struct smb_filename *smb_fname, mode_t mode, diff --git a/source3/include/vfs_macros.h b/source3/include/vfs_macros.h index 7bbdc97a6c6..49edadb2786 100644 --- a/source3/include/vfs_macros.h +++ b/source3/include/vfs_macros.h @@ -311,6 +311,11 @@ #define SMB_VFS_NEXT_LINK(handle, oldpath, newpath) \ smb_vfs_call_link((handle)->next, (oldpath), (newpath)) +#define SMB_VFS_LINKAT(conn, srcfsp, oldpath, dstfsp, newpath, flags) \ + smb_vfs_call_linkat((conn)->vfs_handles, (srcfsp), (oldpath), (dstfsp), (newpath), (flags)) +#define SMB_VFS_NEXT_LINKAT(handle, srcfsp, oldpath, dstfsp, newpath, flags) \ + smb_vfs_call_linkat((handle)->next, (srcfsp), (oldpath), (dstfsp), (newpath), (flags)) + #define SMB_VFS_MKNOD(conn, smb_fname, mode, dev) \ smb_vfs_call_mknod((conn)->vfs_handles, (smb_fname), (mode), (dev)) #define SMB_VFS_NEXT_MKNOD(handle, smb_fname, mode, dev) \ |