summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnoop C S <anoopcs@samba.org>2022-08-19 12:12:43 +0530
committerJule Anger <janger@samba.org>2022-08-30 09:48:11 +0000
commit41eb80482b34ec91306ca73a43ee21d3898b2c55 (patch)
tree68cc89ff183114f7cdb3de93282f48c312306b9d
parentc9b0459a1755832f6279f955e1cbca2d74b08f8d (diff)
downloadsamba-41eb80482b34ec91306ca73a43ee21d3898b2c55.tar.gz
vfs_glusterfs: Use glfs_symlinkat() for SMB_VFS_SYMLINKAT
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15157 Signed-off-by: Anoop C S <anoopcs@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> (cherry picked from commit b2746eb5fa64e0ec58e99eed5be10c98ea4e1c1e)
-rw-r--r--source3/modules/vfs_glusterfs.c28
1 files changed, 23 insertions, 5 deletions
diff --git a/source3/modules/vfs_glusterfs.c b/source3/modules/vfs_glusterfs.c
index dfed5c739cc..808dc72f902 100644
--- a/source3/modules/vfs_glusterfs.c
+++ b/source3/modules/vfs_glusterfs.c
@@ -2017,24 +2017,42 @@ static int vfs_gluster_symlinkat(struct vfs_handle_struct *handle,
struct files_struct *dirfsp,
const struct smb_filename *new_smb_fname)
{
- struct smb_filename *full_fname = NULL;
int ret;
+#ifdef HAVE_GFAPI_VER_7_11
+ glfs_fd_t *pglfd = NULL;
+
+ START_PROFILE(syscall_symlinkat);
+
+ pglfd = vfs_gluster_fetch_glfd(handle, dirfsp);
+ if (pglfd == NULL) {
+ END_PROFILE(syscall_symlinkat);
+ DBG_ERR("Failed to fetch gluster fd\n");
+ return -1;
+ }
+
+ ret = glfs_symlinkat(link_target->base_name,
+ pglfd,
+ new_smb_fname->base_name);
+#else
+ struct smb_filename *full_fname = NULL;
+
START_PROFILE(syscall_symlinkat);
full_fname = full_path_from_dirfsp_atname(talloc_tos(),
- dirfsp,
- new_smb_fname);
+ dirfsp,
+ new_smb_fname);
if (full_fname == NULL) {
END_PROFILE(syscall_symlinkat);
return -1;
}
ret = glfs_symlink(handle->data,
- link_target->base_name,
- full_fname->base_name);
+ link_target->base_name,
+ full_fname->base_name);
TALLOC_FREE(full_fname);
+#endif
END_PROFILE(syscall_symlinkat);