s3: VFS: Complete the replacement of SMB_VFS_READLINK() -> SMB_VFS_READLINKAT().
authorJeremy Allison <jra@samba.org>
Thu, 22 Aug 2019 21:59:05 +0000 (14:59 -0700)
committerJeremy Allison <jra@samba.org>
Fri, 23 Aug 2019 20:06:22 +0000 (20:06 +0000)
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

examples/VFS/skel_opaque.c
examples/VFS/skel_transparent.c
source3/include/smbprofile.h
source3/include/vfs.h
source3/include/vfs_macros.h
source3/modules/vfs_default.c
source3/modules/vfs_not_implemented.c
source3/smbd/vfs.c

index 603ddd46446f7f80094ba2ca8d5513548062a0ac..ecc1c920c92bc051745dbd6d1a19f2e386147553 100644 (file)
@@ -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,
index cb240791b663eca66b3a7a2124600bb60b063536..63cf4a4369a74d6c96dcaa6c270958138a4fe058 100644 (file)
@@ -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,
index d4717f5286b06beaddd9025b8b6b134fb1952e47..b6c9002973e423c2caea6473b05d1cfffb1ac0b0 100644 (file)
@@ -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) \
index 70bf50a51192773dd070ac71fe811264d620306d..126ba32aa369aa93fb5fe2b0909267f67fa9648d 100644 (file)
 /* 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,
index 61a45240c1e068421e7a9b61fe2e38ffdd2e0484..247e9c286c7895f6b22f0dea61e09d54b68fbc83 100644 (file)
 #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) \
index 70e7b31e5cbad6494a71c3067163e86e4aceac63..289ceab426638ccde755fdacf93a0d68d67181c9 100644 (file)
@@ -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,
index d8e92849aa4b20b647b4ac6207e2577d2890e460..34b84287d07d3dcd9cd3f133d3d79873c15a850d 100644 (file)
@@ -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,
index 27bb294be7ad9877967129557383dec77c7df1c6..4366e2df0c4ff93eba7c7f9a02cb584babc3797b 100644 (file)
@@ -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,