From e0e96ae80d21c6b94e05fbf3af457001a005ce09 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 9 Jan 2007 04:04:26 +0000 Subject: r20624: added AIO read to pvfs backend (This used to be commit d6e20d6d8c5c207e7f04b0d0523224437b209917) --- source4/ntvfs/posix/pvfs_read.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'source4/ntvfs/posix/pvfs_read.c') 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, -- cgit