1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-03 13:47:25 +03:00

vfs_glusterfs: Simplify SMB_VFS_FDOPENDIR implementation

It was unnecessary to construct full directory path as "dir/." which is
same as "dir". We could just directly use fsp->fsp_name->base_name and
return directory stream obtained from glfs_opendir().

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15198

Signed-off-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>

Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Wed Oct 12 12:48:50 UTC 2022 on sn-devel-184
This commit is contained in:
Anoop C S 2022-10-11 23:02:48 +05:30 committed by Ralph Boehme
parent 7af4bfe828
commit cc397175cb

View File

@ -627,38 +627,12 @@ static DIR *vfs_gluster_fdopendir(struct vfs_handle_struct *handle,
uint32_t attributes)
{
glfs_fd_t *glfd = NULL;
struct smb_filename *full_fname = NULL;
struct smb_filename *smb_fname_dot = NULL;
smb_fname_dot = synthetic_smb_fname(fsp->fsp_name,
".",
NULL,
NULL,
0,
0);
if (smb_fname_dot == NULL) {
return NULL;
}
full_fname = full_path_from_dirfsp_atname(talloc_tos(),
fsp,
smb_fname_dot);
if (full_fname == NULL) {
TALLOC_FREE(smb_fname_dot);
return NULL;
}
glfd = glfs_opendir(handle->data, full_fname->base_name);
glfd = glfs_opendir(handle->data, fsp->fsp_name->base_name);
if (glfd == NULL) {
TALLOC_FREE(full_fname);
TALLOC_FREE(smb_fname_dot);
return NULL;
}
TALLOC_FREE(full_fname);
TALLOC_FREE(smb_fname_dot);
return (DIR *)glfd;
}