summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2019-08-22 14:59:05 -0700
committerJeremy Allison <jra@samba.org>2019-08-23 20:06:22 +0000
commit9b4685242fc7aeeae05d50566b428fc003848365 (patch)
treedcde407c96f1f78894e1bf0f1410281ede95699e
parent5333ac35dde2b904ac520ac80eee54042c33b39f (diff)
downloadsamba-9b4685242fc7aeeae05d50566b428fc003848365.tar.gz
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
-rw-r--r--examples/VFS/skel_opaque.c10
-rw-r--r--examples/VFS/skel_transparent.c9
-rw-r--r--source3/include/smbprofile.h1
-rw-r--r--source3/include/vfs.h14
-rw-r--r--source3/include/vfs_macros.h5
-rw-r--r--source3/modules/vfs_default.c14
-rw-r--r--source3/modules/vfs_not_implemented.c10
-rw-r--r--source3/smbd/vfs.c9
8 files changed, 1 insertions, 71 deletions
diff --git a/examples/VFS/skel_opaque.c b/examples/VFS/skel_opaque.c
index 603ddd46446..ecc1c920c92 100644
--- a/examples/VFS/skel_opaque.c
+++ b/examples/VFS/skel_opaque.c
@@ -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,
diff --git a/examples/VFS/skel_transparent.c b/examples/VFS/skel_transparent.c
index cb240791b66..63cf4a4369a 100644
--- a/examples/VFS/skel_transparent.c
+++ b/examples/VFS/skel_transparent.c
@@ -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,
diff --git a/source3/include/smbprofile.h b/source3/include/smbprofile.h
index d4717f5286b..b6c9002973e 100644
--- a/source3/include/smbprofile.h
+++ b/source3/include/smbprofile.h
@@ -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) \
diff --git a/source3/include/vfs.h b/source3/include/vfs.h
index 70bf50a5119..126ba32aa36 100644
--- a/source3/include/vfs.h
+++ b/source3/include/vfs.h
@@ -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,
diff --git a/source3/include/vfs_macros.h b/source3/include/vfs_macros.h
index 61a45240c1e..247e9c286c7 100644
--- a/source3/include/vfs_macros.h
+++ b/source3/include/vfs_macros.h
@@ -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) \
diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c
index 70e7b31e5cb..289ceab4266 100644
--- a/source3/modules/vfs_default.c
+++ b/source3/modules/vfs_default.c
@@ -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,
diff --git a/source3/modules/vfs_not_implemented.c b/source3/modules/vfs_not_implemented.c
index d8e92849aa4..34b84287d07 100644
--- a/source3/modules/vfs_not_implemented.c
+++ b/source3/modules/vfs_not_implemented.c
@@ -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,
diff --git a/source3/smbd/vfs.c b/source3/smbd/vfs.c
index 27bb294be7a..4366e2df0c4 100644
--- a/source3/smbd/vfs.c
+++ b/source3/smbd/vfs.c
@@ -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,