summaryrefslogtreecommitdiff
path: root/source4/ntvfs/posix/pvfs_write.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2007-01-12 05:47:00 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:40:24 -0500
commit427fa23ca536f0a0388460f05bd2422e13e04414 (patch)
treebc899f4a4e3062a18d00a6e125a6804f53944d84 /source4/ntvfs/posix/pvfs_write.c
parent34fe5027d04e8ad1fa379ee1413b6e331b585d24 (diff)
downloadsamba-427fa23ca536f0a0388460f05bd2422e13e04414.tar.gz
samba-427fa23ca536f0a0388460f05bd2422e13e04414.tar.bz2
samba-427fa23ca536f0a0388460f05bd2422e13e04414.zip
r20698: added AIO writing support
(This used to be commit dbf54c7b49d427af8112414760369cd21c8b5941)
Diffstat (limited to 'source4/ntvfs/posix/pvfs_write.c')
-rw-r--r--source4/ntvfs/posix/pvfs_write.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/source4/ntvfs/posix/pvfs_write.c b/source4/ntvfs/posix/pvfs_write.c
index 9f58281919..d433a80cc6 100644
--- a/source4/ntvfs/posix/pvfs_write.c
+++ b/source4/ntvfs/posix/pvfs_write.c
@@ -66,6 +66,16 @@ NTSTATUS pvfs_write(struct ntvfs_module_context *ntvfs,
wr->writex.in.count,
wr->writex.in.offset);
} else {
+#if HAVE_LINUX_AIO
+ /* possibly try an aio write */
+ if ((req->async_states->state & NTVFS_ASYNC_STATE_MAY_ASYNC) &&
+ (pvfs->flags & PVFS_FLAG_LINUX_AIO)) {
+ status = pvfs_aio_pwrite(req, wr, f);
+ if (NT_STATUS_IS_OK(status)) {
+ return NT_STATUS_OK;
+ }
+ }
+#endif
ret = pwrite(f->handle->fd,
wr->writex.in.data,
wr->writex.in.count,