mirror of
https://github.com/samba-team/samba.git
synced 2025-01-11 05:18:09 +03:00
s3: VFS: Complete the replacement of SMB_VFS_READLINK() -> SMB_VFS_READLINKAT().
Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Böhme <slow@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Fri Aug 23 20:06:22 UTC 2019 on sn-devel-184
This commit is contained in:
parent
5333ac35dd
commit
9b4685242f
@ -464,15 +464,6 @@ static int skel_symlink(vfs_handle_struct *handle,
|
||||
return -1;
|
||||
}
|
||||
|
||||
static int skel_vfs_readlink(vfs_handle_struct *handle,
|
||||
const struct smb_filename *smb_fname,
|
||||
char *buf,
|
||||
size_t bufsiz)
|
||||
{
|
||||
errno = ENOSYS;
|
||||
return -1;
|
||||
}
|
||||
|
||||
static int skel_vfs_readlinkat(vfs_handle_struct *handle,
|
||||
files_struct *dirfsp,
|
||||
const struct smb_filename *smb_fname,
|
||||
@ -1099,7 +1090,6 @@ static struct vfs_fn_pointers skel_opaque_fns = {
|
||||
.linux_setlease_fn = skel_linux_setlease,
|
||||
.getlock_fn = skel_getlock,
|
||||
.symlink_fn = skel_symlink,
|
||||
.readlink_fn = skel_vfs_readlink,
|
||||
.readlinkat_fn = skel_vfs_readlinkat,
|
||||
.linkat_fn = skel_linkat,
|
||||
.mknodat_fn = skel_mknodat,
|
||||
|
@ -563,14 +563,6 @@ static int skel_symlink(vfs_handle_struct *handle,
|
||||
return SMB_VFS_NEXT_SYMLINK(handle, link_contents, new_smb_fname);
|
||||
}
|
||||
|
||||
static int skel_vfs_readlink(vfs_handle_struct *handle,
|
||||
const struct smb_filename *smb_fname,
|
||||
char *buf,
|
||||
size_t bufsiz)
|
||||
{
|
||||
return SMB_VFS_NEXT_READLINK(handle, smb_fname, buf, bufsiz);
|
||||
}
|
||||
|
||||
static int skel_vfs_readlinkat(vfs_handle_struct *handle,
|
||||
files_struct *dirfsp,
|
||||
const struct smb_filename *smb_fname,
|
||||
@ -1377,7 +1369,6 @@ static struct vfs_fn_pointers skel_transparent_fns = {
|
||||
.linux_setlease_fn = skel_linux_setlease,
|
||||
.getlock_fn = skel_getlock,
|
||||
.symlink_fn = skel_symlink,
|
||||
.readlink_fn = skel_vfs_readlink,
|
||||
.readlinkat_fn = skel_vfs_readlinkat,
|
||||
.linkat_fn = skel_linkat,
|
||||
.mknodat_fn = skel_mknodat,
|
||||
|
@ -82,7 +82,6 @@ struct tevent_context;
|
||||
SMBPROFILE_STATS_BASIC(syscall_kernel_flock) \
|
||||
SMBPROFILE_STATS_BASIC(syscall_linux_setlease) \
|
||||
SMBPROFILE_STATS_BASIC(syscall_fcntl_getlock) \
|
||||
SMBPROFILE_STATS_BASIC(syscall_readlink) \
|
||||
SMBPROFILE_STATS_BASIC(syscall_readlinkat) \
|
||||
SMBPROFILE_STATS_BASIC(syscall_symlink) \
|
||||
SMBPROFILE_STATS_BASIC(syscall_linkat) \
|
||||
|
@ -275,7 +275,7 @@
|
||||
/* Version 42 - Move SMB_VFS_RENAME -> SMB_VFS_RENAMEAT */
|
||||
/* Version 42 - Move SMB_VFS_LINK -> SMB_VFS_LINKAT. */
|
||||
/* Version 42 - Move SMB_VFS_MKNOD -> SMB_VFS_MKDNODAT. */
|
||||
/* Version 42 - Add SMB_VFS_READLINKAT. */
|
||||
/* Version 42 - Move SMB_VFS_READLINK -> SMB_VFS_READLINKAT. */
|
||||
|
||||
#define SMB_VFS_INTERFACE_VERSION 42
|
||||
|
||||
@ -798,10 +798,6 @@ struct vfs_fn_pointers {
|
||||
int (*symlink_fn)(struct vfs_handle_struct *handle,
|
||||
const char *link_contents,
|
||||
const struct smb_filename *new_smb_fname);
|
||||
int (*readlink_fn)(struct vfs_handle_struct *handle,
|
||||
const struct smb_filename *smb_fname,
|
||||
char *buf,
|
||||
size_t bufsiz);
|
||||
int (*readlinkat_fn)(struct vfs_handle_struct *handle,
|
||||
struct files_struct *dirfsp,
|
||||
const struct smb_filename *smb_fname,
|
||||
@ -1336,10 +1332,6 @@ bool smb_vfs_call_getlock(struct vfs_handle_struct *handle,
|
||||
int smb_vfs_call_symlink(struct vfs_handle_struct *handle,
|
||||
const char *link_contents,
|
||||
const struct smb_filename *new_smb_fname);
|
||||
int smb_vfs_call_readlink(struct vfs_handle_struct *handle,
|
||||
const struct smb_filename *smb_fname,
|
||||
char *buf,
|
||||
size_t bufsiz);
|
||||
int smb_vfs_call_readlinkat(struct vfs_handle_struct *handle,
|
||||
struct files_struct *dirfsp,
|
||||
const struct smb_filename *smb_fname,
|
||||
@ -1771,10 +1763,6 @@ bool vfs_not_implemented_getlock(vfs_handle_struct *handle, files_struct *fsp,
|
||||
int vfs_not_implemented_symlink(vfs_handle_struct *handle,
|
||||
const char *link_contents,
|
||||
const struct smb_filename *new_smb_fname);
|
||||
int vfs_not_implemented_vfs_readlink(vfs_handle_struct *handle,
|
||||
const struct smb_filename *smb_fname,
|
||||
char *buf,
|
||||
size_t bufsiz);
|
||||
int vfs_not_implemented_vfs_readlinkat(vfs_handle_struct *handle,
|
||||
struct files_struct *dirfsp,
|
||||
const struct smb_filename *smb_fname,
|
||||
|
@ -301,11 +301,6 @@
|
||||
#define SMB_VFS_NEXT_SYMLINK(handle, oldpath, newpath) \
|
||||
smb_vfs_call_symlink((handle)->next, (oldpath), (newpath))
|
||||
|
||||
#define SMB_VFS_READLINK(conn, smb_fname, buf, bufsiz) \
|
||||
smb_vfs_call_readlink((conn)->vfs_handles, (smb_fname), (buf), (bufsiz))
|
||||
#define SMB_VFS_NEXT_READLINK(handle, smb_fname, buf, bufsiz) \
|
||||
smb_vfs_call_readlink((handle)->next, (smb_fname), (buf), (bufsiz))
|
||||
|
||||
#define SMB_VFS_READLINKAT(conn, dirfsp, smb_fname, buf, bufsiz) \
|
||||
smb_vfs_call_readlinkat((conn)->vfs_handles, (dirfsp), (smb_fname), (buf), (bufsiz))
|
||||
#define SMB_VFS_NEXT_READLINKAT(handle, dirfsp, smb_fname, buf, bufsiz) \
|
||||
|
@ -2650,19 +2650,6 @@ static int vfswrap_symlink(vfs_handle_struct *handle,
|
||||
return result;
|
||||
}
|
||||
|
||||
static int vfswrap_readlink(vfs_handle_struct *handle,
|
||||
const struct smb_filename *smb_fname,
|
||||
char *buf,
|
||||
size_t bufsiz)
|
||||
{
|
||||
int result;
|
||||
|
||||
START_PROFILE(syscall_readlink);
|
||||
result = readlink(smb_fname->base_name, buf, bufsiz);
|
||||
END_PROFILE(syscall_readlink);
|
||||
return result;
|
||||
}
|
||||
|
||||
static int vfswrap_readlinkat(vfs_handle_struct *handle,
|
||||
files_struct *dirfsp,
|
||||
const struct smb_filename *smb_fname,
|
||||
@ -3507,7 +3494,6 @@ static struct vfs_fn_pointers vfs_default_fns = {
|
||||
.linux_setlease_fn = vfswrap_linux_setlease,
|
||||
.getlock_fn = vfswrap_getlock,
|
||||
.symlink_fn = vfswrap_symlink,
|
||||
.readlink_fn = vfswrap_readlink,
|
||||
.readlinkat_fn = vfswrap_readlinkat,
|
||||
.linkat_fn = vfswrap_linkat,
|
||||
.mknodat_fn = vfswrap_mknodat,
|
||||
|
@ -462,15 +462,6 @@ int vfs_not_implemented_symlink(vfs_handle_struct *handle,
|
||||
return -1;
|
||||
}
|
||||
|
||||
int vfs_not_implemented_vfs_readlink(vfs_handle_struct *handle,
|
||||
const struct smb_filename *smb_fname,
|
||||
char *buf,
|
||||
size_t bufsiz)
|
||||
{
|
||||
errno = ENOSYS;
|
||||
return -1;
|
||||
}
|
||||
|
||||
int vfs_not_implemented_vfs_readlinkat(vfs_handle_struct *handle,
|
||||
files_struct *dirfsp,
|
||||
const struct smb_filename *smb_fname,
|
||||
@ -1103,7 +1094,6 @@ static struct vfs_fn_pointers vfs_not_implemented_fns = {
|
||||
.linux_setlease_fn = vfs_not_implemented_linux_setlease,
|
||||
.getlock_fn = vfs_not_implemented_getlock,
|
||||
.symlink_fn = vfs_not_implemented_symlink,
|
||||
.readlink_fn = vfs_not_implemented_vfs_readlink,
|
||||
.readlinkat_fn = vfs_not_implemented_vfs_readlinkat,
|
||||
.linkat_fn = vfs_not_implemented_linkat,
|
||||
.mknodat_fn = vfs_not_implemented_mknodat,
|
||||
|
@ -2201,15 +2201,6 @@ int smb_vfs_call_symlink(struct vfs_handle_struct *handle,
|
||||
return handle->fns->symlink_fn(handle, link_target, new_smb_fname);
|
||||
}
|
||||
|
||||
int smb_vfs_call_readlink(struct vfs_handle_struct *handle,
|
||||
const struct smb_filename *smb_fname,
|
||||
char *buf,
|
||||
size_t bufsiz)
|
||||
{
|
||||
VFS_FIND(readlink);
|
||||
return handle->fns->readlink_fn(handle, smb_fname, buf, bufsiz);
|
||||
}
|
||||
|
||||
int smb_vfs_call_readlinkat(struct vfs_handle_struct *handle,
|
||||
struct files_struct *dirfsp,
|
||||
const struct smb_filename *smb_fname,
|
||||
|
Loading…
Reference in New Issue
Block a user