summaryrefslogtreecommitdiff
path: root/source4/ntvfs/posix/pvfs_read.c
diff options
context:
space:
mode:
Diffstat (limited to 'source4/ntvfs/posix/pvfs_read.c')
-rw-r--r--source4/ntvfs/posix/pvfs_read.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/source4/ntvfs/posix/pvfs_read.c b/source4/ntvfs/posix/pvfs_read.c
index c36d8ca2a3..91945dbb0f 100644
--- a/source4/ntvfs/posix/pvfs_read.c
+++ b/source4/ntvfs/posix/pvfs_read.c
@@ -22,7 +22,7 @@
#include "includes.h"
#include "vfs_posix.h"
-#include "librpc/gen_ndr/security.h"
+#include "lib/events/events.h"
/*
read from a file
@@ -75,6 +75,16 @@ NTSTATUS pvfs_read(struct ntvfs_module_context *ntvfs,
ret = pvfs_stream_read(pvfs, f->handle,
rd->readx.out.data, maxcnt, rd->readx.in.offset);
} else {
+#if HAVE_LINUX_AIO
+ /* possibly try an aio read */
+ if ((req->async_states->state & NTVFS_ASYNC_STATE_MAY_ASYNC) &&
+ (pvfs->flags & PVFS_FLAG_LINUX_AIO)) {
+ status = pvfs_aio_pread(req, rd, f, maxcnt);
+ if (NT_STATUS_IS_OK(status)) {
+ return NT_STATUS_OK;
+ }
+ }
+#endif
ret = pread(f->handle->fd,
rd->readx.out.data,
maxcnt,