vfs: Use fsp_get_pathref_fd() in aio_pthread
authorVolker Lendecke <vl@samba.org>
Mon, 14 Feb 2022 12:30:43 +0000 (13:30 +0100)
committerJeremy Allison <jra@samba.org>
Thu, 17 Feb 2022 17:13:34 +0000 (17:13 +0000)
We only use the fd as "dirfd" in openat, so we don't need an I/O fd
here.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/modules/vfs_aio_pthread.c

index 685f91d9f2baec33f0e241fd3bbf06156593ce1c..e16537ff17ed33dee018b7ccead609110b773f20 100644 (file)
@@ -302,8 +302,8 @@ static struct aio_open_private_data *create_private_open_data(
                return NULL;
        }
 
-       if (fsp_get_io_fd(dirfsp) != AT_FDCWD) {
-               opd->dir_fd = fsp_get_io_fd(dirfsp);
+       if (fsp_get_pathref_fd(dirfsp) != AT_FDCWD) {
+               opd->dir_fd = fsp_get_pathref_fd(dirfsp);
        } else {
 #if defined(O_DIRECTORY)
                opd->dir_fd = open(".", O_RDONLY|O_DIRECTORY);
@@ -473,7 +473,7 @@ static int aio_pthread_openat_fn(vfs_handle_struct *handle,
 
        if (!aio_allow_open) {
                /* aio opens turned off. */
-               return openat(fsp_get_io_fd(dirfsp),
+               return openat(fsp_get_pathref_fd(dirfsp),
                              smb_fname->base_name,
                              flags,
                              mode);
@@ -481,7 +481,7 @@ static int aio_pthread_openat_fn(vfs_handle_struct *handle,
 
        if (!(flags & O_CREAT)) {
                /* Only creates matter. */
-               return openat(fsp_get_io_fd(dirfsp),
+               return openat(fsp_get_pathref_fd(dirfsp),
                              smb_fname->base_name,
                              flags,
                              mode);
@@ -489,7 +489,7 @@ static int aio_pthread_openat_fn(vfs_handle_struct *handle,
 
        if (!(flags & O_EXCL)) {
                /* Only creates with O_EXCL matter. */
-               return openat(fsp_get_io_fd(dirfsp),
+               return openat(fsp_get_pathref_fd(dirfsp),
                              smb_fname->base_name,
                              flags,
                              mode);