From: Anoop C S Date: Fri, 19 Aug 2022 06:40:16 +0000 (+0530) Subject: vfs_glusterfs: Use glfs_mkdirat() for SMB_VFS_MKDIRAT X-Git-Tag: talloc-2.4.0~1290 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=56c4aab11190b8d48a5b92babea7fc7e78b54b4e;p=thirdparty%2Fsamba.git vfs_glusterfs: Use glfs_mkdirat() for SMB_VFS_MKDIRAT BUG: https://bugzilla.samba.org/show_bug.cgi?id=15157 Signed-off-by: Anoop C S Reviewed-by: Jeremy Allison --- diff --git a/source3/modules/vfs_glusterfs.c b/source3/modules/vfs_glusterfs.c index 3503dfc251f..ae11e81ad17 100644 --- a/source3/modules/vfs_glusterfs.c +++ b/source3/modules/vfs_glusterfs.c @@ -737,9 +737,24 @@ static int vfs_gluster_mkdirat(struct vfs_handle_struct *handle, const struct smb_filename *smb_fname, mode_t mode) { - struct smb_filename *full_fname = NULL; int ret; +#ifdef HAVE_GFAPI_VER_7_11 + glfs_fd_t *pglfd = NULL; + + START_PROFILE(syscall_mkdirat); + + pglfd = vfs_gluster_fetch_glfd(handle, dirfsp); + if (pglfd == NULL) { + END_PROFILE(syscall_mkdirat); + DBG_ERR("Failed to fetch gluster fd\n"); + return -1; + } + + ret = glfs_mkdirat(pglfd, smb_fname->base_name, mode); +#else + struct smb_filename *full_fname = NULL; + START_PROFILE(syscall_mkdirat); full_fname = full_path_from_dirfsp_atname(talloc_tos(), @@ -753,6 +768,7 @@ static int vfs_gluster_mkdirat(struct vfs_handle_struct *handle, ret = glfs_mkdir(handle->data, full_fname->base_name, mode); TALLOC_FREE(full_fname); +#endif END_PROFILE(syscall_mkdirat);