1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

vfs_ceph: Use ceph_fdopendir() when available for SMB_VFS_FDOPENDIR

Signed-off-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>

Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Sat Jan 27 00:01:12 UTC 2024 on atb-devel-224
This commit is contained in:
Anoop C S 2024-01-16 11:47:27 +05:30 committed by Günther Deschner
parent 447e131ebf
commit 6e6d8384f3
2 changed files with 9 additions and 2 deletions

View File

@ -438,9 +438,15 @@ static DIR *cephwrap_fdopendir(struct vfs_handle_struct *handle,
{
int ret = 0;
struct ceph_dir_result *result = NULL;
DBG_DEBUG("[CEPH] fdopendir(%p, %p)\n", handle, fsp);
#ifdef HAVE_CEPH_FDOPENDIR
int dirfd = fsp_get_io_fd(fsp);
DBG_DEBUG("[CEPH] fdopendir(%p, %d)\n", handle, dirfd);
ret = ceph_fdopendir(handle->data, dirfd, &result);
#else
DBG_DEBUG("[CEPH] fdopendir(%p, %p)\n", handle, fsp);
ret = ceph_opendir(handle->data, fsp->fsp_name->base_name, &result);
#endif
if (ret < 0) {
result = NULL;
errno = -ret; /* We return result which is NULL in this case */

View File

@ -1681,7 +1681,8 @@ int main(void) {
headers='cephfs/libcephfs.h')
conf.DEFINE('HAVE_MANDATORY_CEPH_API', '1')
for api in ['ceph_mkdirat', 'ceph_openat', 'ceph_unlinkat',
'ceph_symlinkat', 'ceph_readlinkat', 'ceph_statxat']:
'ceph_symlinkat', 'ceph_readlinkat', 'ceph_statxat',
'ceph_fdopendir']:
if not conf.CHECK_FUNCS_IN(api, 'cephfs',
headers='cephfs/libcephfs.h'):
conf.undefine('HAVE_MANDATORY_CEPH_API')