return -1;
}
-static int skel_link(vfs_handle_struct *handle,
- const struct smb_filename *old_smb_fname,
- const struct smb_filename *new_smb_fname)
-{
- errno = ENOSYS;
- return -1;
-}
-
static int skel_linkat(vfs_handle_struct *handle,
files_struct *srcfsp,
const struct smb_filename *old_smb_fname,
.getlock_fn = skel_getlock,
.symlink_fn = skel_symlink,
.readlink_fn = skel_vfs_readlink,
- .link_fn = skel_link,
.linkat_fn = skel_linkat,
.mknod_fn = skel_mknod,
.realpath_fn = skel_realpath,
return SMB_VFS_NEXT_READLINK(handle, smb_fname, buf, bufsiz);
}
-static int skel_link(vfs_handle_struct *handle,
- const struct smb_filename *old_smb_fname,
- const struct smb_filename *new_smb_fname)
-{
- return SMB_VFS_NEXT_LINK(handle, old_smb_fname, new_smb_fname);
-}
-
static int skel_linkat(vfs_handle_struct *handle,
files_struct *srcfsp,
const struct smb_filename *old_smb_fname,
.getlock_fn = skel_getlock,
.symlink_fn = skel_symlink,
.readlink_fn = skel_vfs_readlink,
- .link_fn = skel_link,
.linkat_fn = skel_linkat,
.mknod_fn = skel_mknod,
.realpath_fn = skel_realpath,
SMBPROFILE_STATS_BASIC(syscall_fcntl_getlock) \
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) \
/* 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. */
+/* Version 42 - Move SMB_VFS_LINK -> SMB_VFS_LINKAT. */
#define SMB_VFS_INTERFACE_VERSION 42
const struct smb_filename *smb_fname,
char *buf,
size_t bufsiz);
- 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,
const struct smb_filename *smb_fname,
char *buf,
size_t bufsiz);
-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,
const struct smb_filename *smb_fname,
char *buf,
size_t bufsiz);
-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,
#define SMB_VFS_NEXT_READLINK(handle, smb_fname, buf, bufsiz) \
smb_vfs_call_readlink((handle)->next, (smb_fname), (buf), (bufsiz))
-#define SMB_VFS_LINK(conn, oldpath, newpath) \
- smb_vfs_call_link((conn)->vfs_handles, (oldpath), (newpath))
-#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) \
return result;
}
-static int vfswrap_link(vfs_handle_struct *handle,
- const struct smb_filename *old_smb_fname,
- const struct smb_filename *new_smb_fname)
-{
- int result;
-
- START_PROFILE(syscall_link);
- result = link(old_smb_fname->base_name, new_smb_fname->base_name);
- END_PROFILE(syscall_link);
- return result;
-}
-
static int vfswrap_linkat(vfs_handle_struct *handle,
files_struct *srcfsp,
const struct smb_filename *old_smb_fname,
.getlock_fn = vfswrap_getlock,
.symlink_fn = vfswrap_symlink,
.readlink_fn = vfswrap_readlink,
- .link_fn = vfswrap_link,
.linkat_fn = vfswrap_linkat,
.mknod_fn = vfswrap_mknod,
.realpath_fn = vfswrap_realpath,
return -1;
}
-int vfs_not_implemented_link(vfs_handle_struct *handle,
- const struct smb_filename *old_smb_fname,
- const struct smb_filename *new_smb_fname)
-{
- errno = ENOSYS;
- return -1;
-}
-
int vfs_not_implemented_linkat(vfs_handle_struct *handle,
files_struct *srcfsp,
const struct smb_filename *old_smb_fname,
.getlock_fn = vfs_not_implemented_getlock,
.symlink_fn = vfs_not_implemented_symlink,
.readlink_fn = vfs_not_implemented_vfs_readlink,
- .link_fn = vfs_not_implemented_link,
.linkat_fn = vfs_not_implemented_linkat,
.mknod_fn = vfs_not_implemented_mknod,
.realpath_fn = vfs_not_implemented_realpath,
return handle->fns->readlink_fn(handle, smb_fname, buf, bufsiz);
}
-int smb_vfs_call_link(struct vfs_handle_struct *handle,
- const struct smb_filename *old_smb_fname,
- const struct smb_filename *new_smb_fname)
-{
- VFS_FIND(link);
- return handle->fns->link_fn(handle, old_smb_fname, new_smb_fname);
-}
-
int smb_vfs_call_linkat(struct vfs_handle_struct *handle,
struct files_struct *srcfsp,
const struct smb_filename *old_smb_fname,