[SCM] Samba Shared Repository - branch master updated

Jeremy Allison jra at samba.org
Wed Jul 18 19:41:02 MDT 2012


The branch, master has been updated
       via  8ef968a s3-aio: Panic if we try to close a fsp with outstanding aio requests
       via  a6b5836 s3-smb2: Postpone close_file until all aio is handled
       via  3e9f58b s3-smb1: Postpone close_file until all aio is handled
       via  3da86cc s3: Add tevent_wait_send/recv
       via  f79fb44 s3: Slightly simplify reply_close()
       via  730d3e8 s3: Compile with pthreadpool by default
       via  4a9b5cc config: The AIO engine is indepent of HAVE_AIO now
       via  d948b1b s3: Add aio_fsync to the aio_linux module
       via  d6cb302 s3: Add aio_fsync to the aio_fork module
       via  38dd5b2 s3-aio-fork: make "read_cmd" an enum
       via  e3f3c09 s3: Add aio_fsync to the aio_posix module
       via  ed31e20 s3-aio: Make the strict sync after write async
       via  56aae9f s3: Add a _nosync version of smb2_write_complete
       via  5d09cec s3-vfs: async fsync
       via  3882113 s3: Fix the build
       via  dc5e3fb s3-libasys: Add asys_fsync() implementation
       via  fd351b6 s3: Make us survive base-delaywrite with aio enabled
       via  c4efaab s3: Move the aio_pthread read/write functionality to vfs_default
       via  9dc78c9 s3-aio: Remove unused VFS functions and more
       via  be05dad s3-vfs: Add pwrite_send/recv to vfs modules
       via  90461aa s3-vfs: Add pread_send/recv to vfs modules
       via  4668398 s3: Convert aio_linux to pread/pwrite_send/recv
       via  9e1c873 s3: Convert aio_fork to pread/pwrite_send/recv
       via  bf8696f s3-aio_fork: Convert get_idle_child from NTSTATUS to errno
       via  b65ab9d s3-aio_fork: Convert create_aio_child from NTSTATUS to errno
       via  ff701ce s3: Add vfs_aio_posix
       via  f9df073 s3: Make smbd/aio.c not depend on aio.h anymore
       via  715653a s3:vfs_aio_pthread: Convert to libasys
       via  66eb7bc s3: Remove the unused completion handling from aio.c
       via  f5dc883 s3: Properly handle shutdown with the _send/_recv based aio
       via  aff6956 s3: Use SMB_VFS_PWRITE_SEND in schedule_smb2_aio_write
       via  6df7ba3 s3: Use SMB_VFS_PREAD_SEND in schedule_smb2_aio_read
       via  2bad405 s3: Use SMB_VFS_PWRITE_SEND in schedule_aio_write_and_X
       via  7c32017 s3: Use SMB_VFS_PREAD_SEND in schedule_aio_read_and_X
       via  e24aed1 s3-vfs: async pread
       via  c6e456d s3-vfs: async pwrite
       via  d44ccdd libasys
      from  24f7085 s3:Really ignore unknown special ids in NFSv4 ACLs.

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 8ef968a23dffb2e1c1518f7489d4ab0b14a71118
Author: Volker Lendecke <vl at samba.org>
Date:   Tue Jul 17 22:43:06 2012 +0200

    s3-aio: Panic if we try to close a fsp with outstanding aio requests
    
    The core smbd must have taken care of this. If we don't do this properly,
    we have a race of the close(2) against a pwrite(2). We might end up
    writing to the wrong file.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    
    Autobuild-User(master): Jeremy Allison <jra at samba.org>
    Autobuild-Date(master): Thu Jul 19 03:40:17 CEST 2012 on sn-devel-104

commit a6b58367410abc85fc079910f3f193eaa386f9f1
Author: Volker Lendecke <vl at samba.org>
Date:   Tue Jul 17 22:24:51 2012 +0200

    s3-smb2: Postpone close_file until all aio is handled
    
    Thanks to Jeremy for this simple idea
    
    Signed-off-by: Jeremy Allison <jra at samba.org>

commit 3e9f58be7e56b7990417e3f97a2d215f3591289e
Author: Volker Lendecke <vl at samba.org>
Date:   Tue Jul 17 22:24:51 2012 +0200

    s3-smb1: Postpone close_file until all aio is handled
    
    Thanks to Jeremy for this simple idea
    
    Signed-off-by: Jeremy Allison <jra at samba.org>

commit 3da86cc23f20e5b852d08aa05dacabb2d6e496e2
Author: Volker Lendecke <vl at samba.org>
Date:   Wed Jul 18 11:25:42 2012 +0200

    s3: Add tevent_wait_send/recv
    
    To me it seems that we might have this functionality already somewere... I
    just can't find it. Metze, do you have an idea?
    
    Signed-off-by: Jeremy Allison <jra at samba.org>

commit f79fb4429c7fb9c2ae81f06fc8f2162a1ccd226c
Author: Volker Lendecke <vl at samba.org>
Date:   Tue Jul 17 21:52:13 2012 +0200

    s3: Slightly simplify reply_close()
    
    Signed-off-by: Jeremy Allison <jra at samba.org>

commit 730d3e8973e3ef99aad126776a1db51282b226cb
Author: Volker Lendecke <vl at samba.org>
Date:   Mon Jul 16 13:26:12 2012 +0200

    s3: Compile with pthreadpool by default
    
    Signed-off-by: Jeremy Allison <jra at samba.org>

commit 4a9b5cce92d65317fee4583f1ece4af7a3ae9558
Author: Volker Lendecke <vl at samba.org>
Date:   Mon Jul 16 12:44:42 2012 +0200

    config: The AIO engine is indepent of HAVE_AIO now
    
    Compile the basic aio engine always, it works via libasys/pthreadpool_sync
    in a sync fashion even if no pthreads are around. Everything else (linux
    aio, posix aio, aio fork) is now compiled as modules based on specific
    system capabilities
    
    Signed-off-by: Jeremy Allison <jra at samba.org>

commit d948b1bfeec02706e8cd08a4f82c0ce54f99491c
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Jul 15 12:08:59 2012 +0200

    s3: Add aio_fsync to the aio_linux module
    
    Signed-off-by: Jeremy Allison <jra at samba.org>

commit d6cb302988294c382d8bd6298e33d71504ff1a90
Author: Volker Lendecke <vl at samba.org>
Date:   Fri Jul 13 14:05:11 2012 +0200

    s3: Add aio_fsync to the aio_fork module
    
    Signed-off-by: Jeremy Allison <jra at samba.org>

commit 38dd5b24bb148e50bc7810f6c20d71a33b5a4199
Author: Volker Lendecke <vl at samba.org>
Date:   Fri Jul 13 13:59:52 2012 +0200

    s3-aio-fork: make "read_cmd" an enum
    
    Signed-off-by: Jeremy Allison <jra at samba.org>

commit e3f3c09504f1c6bdeeeea685b073762170f00e33
Author: Volker Lendecke <vl at samba.org>
Date:   Fri Jul 13 13:53:39 2012 +0200

    s3: Add aio_fsync to the aio_posix module
    
    Signed-off-by: Jeremy Allison <jra at samba.org>

commit ed31e201158591b480404f0b197923751551bc40
Author: Volker Lendecke <vl at samba.org>
Date:   Fri Jul 13 13:41:47 2012 +0200

    s3-aio: Make the strict sync after write async
    
    This restores cb405947caa9f4bdb962483860a9093a364ecbf2, which was
    lost during the refactoring of aio.c and vfs_aio_pthread.c.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>

commit 56aae9f75455b9882501167de5f3804fec67dca5
Author: Volker Lendecke <vl at samba.org>
Date:   Fri Jul 13 13:39:52 2012 +0200

    s3: Add a _nosync version of smb2_write_complete
    
    This will be used in aio.c to avoid a second fsync after write
    
    Signed-off-by: Jeremy Allison <jra at samba.org>

commit 5d09cec6fe499ac0bcc1ac98fd8aaffe7e43faa3
Author: Volker Lendecke <vl at samba.org>
Date:   Fri Jul 13 10:22:25 2012 +0200

    s3-vfs: async fsync
    
    Signed-off-by: Jeremy Allison <jra at samba.org>

commit 3882113e6f44d0adbc321d97931a6e9a37a149b8
Author: Volker Lendecke <vl at samba.org>
Date:   Fri Jul 13 10:22:05 2012 +0200

    s3: Fix the build
    
    Signed-off-by: Jeremy Allison <jra at samba.org>

commit dc5e3fba488fc99dcd984e37d6f05ac22a773b47
Author: Volker Lendecke <vl at samba.org>
Date:   Fri Jul 13 09:37:40 2012 +0200

    s3-libasys: Add asys_fsync() implementation
    
    Signed-off-by: Jeremy Allison <jra at samba.org>

commit fd351b6ebbb1b1447b7f8ab3081b762dde53709e
Author: Volker Lendecke <vl at samba.org>
Date:   Thu Jul 12 16:30:22 2012 +0200

    s3: Make us survive base-delaywrite with aio enabled
    
    Signed-off-by: Jeremy Allison <jra at samba.org>

commit c4efaabbd94ee9139011547499e1a6fa4e43b282
Author: Volker Lendecke <vl at samba.org>
Date:   Thu Jul 12 10:32:39 2012 +0200

    s3: Move the aio_pthread read/write functionality to vfs_default
    
    Signed-off-by: Jeremy Allison <jra at samba.org>

commit 9dc78c90f3c952f5c01686da6601c47565016290
Author: Volker Lendecke <vl at samba.org>
Date:   Mon Jul 9 21:33:57 2012 +0200

    s3-aio: Remove unused VFS functions and more
    
    Signed-off-by: Jeremy Allison <jra at samba.org>

commit be05dad399b7e549997acc79add85f5dbbc3d7b7
Author: Volker Lendecke <vl at samba.org>
Date:   Mon Jul 9 17:17:25 2012 +0200

    s3-vfs: Add pwrite_send/recv to vfs modules
    
    Signed-off-by: Jeremy Allison <jra at samba.org>

commit 90461aa02347805e32a800905d3d0bceaccc7c02
Author: Volker Lendecke <vl at samba.org>
Date:   Mon Jul 9 17:17:25 2012 +0200

    s3-vfs: Add pread_send/recv to vfs modules
    
    Signed-off-by: Jeremy Allison <jra at samba.org>

commit 466839878af765d7e9397fbf460cb1415bf8a996
Author: Volker Lendecke <vl at samba.org>
Date:   Mon Jul 9 11:10:30 2012 +0200

    s3: Convert aio_linux to pread/pwrite_send/recv
    
    Signed-off-by: Jeremy Allison <jra at samba.org>

commit 9e1c873a9e5034244a58940ebd32c7ba0f6b9e01
Author: Volker Lendecke <vl at samba.org>
Date:   Mon Jul 9 11:10:30 2012 +0200

    s3: Convert aio_fork to pread/pwrite_send/recv
    
    Signed-off-by: Jeremy Allison <jra at samba.org>

commit bf8696fe5dee4a829b6f7444cdd4e9a9aad2d110
Author: Volker Lendecke <vl at samba.org>
Date:   Mon Jul 9 09:00:55 2012 +0200

    s3-aio_fork: Convert get_idle_child from NTSTATUS to errno
    
    Signed-off-by: Jeremy Allison <jra at samba.org>

commit b65ab9d5a397089653be976085dfe65c86c14811
Author: Volker Lendecke <vl at samba.org>
Date:   Mon Jul 9 09:00:55 2012 +0200

    s3-aio_fork: Convert create_aio_child from NTSTATUS to errno
    
    Signed-off-by: Jeremy Allison <jra at samba.org>

commit ff701ceae2409c656e1c30c00c728cfa67aeba21
Author: Volker Lendecke <vl at samba.org>
Date:   Fri Jul 6 15:33:47 2012 +0200

    s3: Add vfs_aio_posix
    
    Signed-off-by: Jeremy Allison <jra at samba.org>

commit f9df073a31a813f5ee50d4d8ea3ec590e1a3e970
Author: Volker Lendecke <vl at samba.org>
Date:   Fri Jul 6 15:05:02 2012 +0200

    s3: Make smbd/aio.c not depend on aio.h anymore
    
    Signed-off-by: Jeremy Allison <jra at samba.org>

commit 715653a335acec525e8b0aa6d24d840d9d347eb9
Author: Volker Lendecke <vl at samba.org>
Date:   Fri Jul 6 13:19:20 2012 +0200

    s3:vfs_aio_pthread: Convert to libasys
    
    Signed-off-by: Jeremy Allison <jra at samba.org>

commit 66eb7bc6ecb1d9bada5b738fff6b428c59be29cc
Author: Volker Lendecke <vl at samba.org>
Date:   Fri Jul 6 09:38:33 2012 +0200

    s3: Remove the unused completion handling from aio.c
    
    Signed-off-by: Jeremy Allison <jra at samba.org>

commit f5dc8837d93372ab844028e160580803758204fa
Author: Volker Lendecke <vl at samba.org>
Date:   Fri Jul 6 09:37:57 2012 +0200

    s3: Properly handle shutdown with the _send/_recv based aio
    
    Signed-off-by: Jeremy Allison <jra at samba.org>

commit aff6956d350272bee6f0b968271ec3200c718095
Author: Volker Lendecke <vl at samba.org>
Date:   Mon Jul 2 12:46:03 2012 +0200

    s3: Use SMB_VFS_PWRITE_SEND in schedule_smb2_aio_write
    
    Signed-off-by: Jeremy Allison <jra at samba.org>

commit 6df7ba3af9438bb45baaf156a0b76452c75d86b1
Author: Volker Lendecke <vl at samba.org>
Date:   Mon Jul 2 12:46:03 2012 +0200

    s3: Use SMB_VFS_PREAD_SEND in schedule_smb2_aio_read
    
    Signed-off-by: Jeremy Allison <jra at samba.org>

commit 2bad405a4e55bbe69ce20f850524862fbf20bd57
Author: Volker Lendecke <vl at samba.org>
Date:   Mon Jul 2 12:46:03 2012 +0200

    s3: Use SMB_VFS_PWRITE_SEND in schedule_aio_write_and_X
    
    Signed-off-by: Jeremy Allison <jra at samba.org>

commit 7c320170649cb28c02f7e4f607c14c2ff3d40e87
Author: Volker Lendecke <vl at samba.org>
Date:   Mon Jul 2 12:46:03 2012 +0200

    s3: Use SMB_VFS_PREAD_SEND in schedule_aio_read_and_X
    
    Signed-off-by: Jeremy Allison <jra at samba.org>

commit e24aed15fa3374c6cb51488b029788b3a649d242
Author: Volker Lendecke <vl at samba.org>
Date:   Tue Jun 26 14:30:59 2012 +0200

    s3-vfs: async pread
    
    Signed-off-by: Jeremy Allison <jra at samba.org>

commit c6e456d9c08eb0d05904802e0f23f15676a13e0d
Author: Volker Lendecke <vl at samba.org>
Date:   Tue Jun 26 14:30:59 2012 +0200

    s3-vfs: async pwrite
    
    Signed-off-by: Jeremy Allison <jra at samba.org>

commit d44ccdd4378d6aafd1dd6322e419d1165635f25b
Author: Volker Lendecke <vl at samba.org>
Date:   Thu Jun 21 12:51:12 2012 +0200

    libasys
    
    Signed-off-by: Jeremy Allison <jra at samba.org>

-----------------------------------------------------------------------

Summary of changes:
 docs-xml/manpages-3/vfs_full_audit.8.xml |    7 -
 examples/VFS/skel_opaque.c               |  100 ++--
 examples/VFS/skel_transparent.c          |  207 +++++--
 source3/Makefile.in                      |    7 +
 source3/configure.in                     |   46 +-
 source3/include/includes.h               |   16 -
 source3/include/proto.h                  |   14 -
 source3/include/vfs.h                    |   79 ++-
 source3/include/vfs_macros.h             |   55 +-
 source3/lib/asys/asys.c                  |  317 +++++++++
 source3/lib/asys/asys.h                  |  146 ++++
 source3/lib/asys/tests.c                 |   92 +++
 source3/lib/asys/wscript_build           |    9 +
 source3/lib/system.c                     |  144 ----
 source3/lib/tevent_wait.c                |   83 +++
 source3/lib/tevent_wait.h                |   37 +
 source3/modules/vfs_aio_fork.c           |  666 ++++++++++----------
 source3/modules/vfs_aio_linux.c          |  663 ++++---------------
 source3/modules/vfs_aio_posix.c          |  300 +++++++++
 source3/modules/vfs_aio_pthread.c        |  564 +----------------
 source3/modules/vfs_default.c            |  275 ++++++--
 source3/modules/vfs_full_audit.c         |  324 +++++++---
 source3/modules/vfs_time_audit.c         |  348 ++++++-----
 source3/modules/wscript_build            |   10 +
 source3/smbd/aio.c                       | 1066 ++++++++++++++----------------
 source3/smbd/close.c                     |   23 +-
 source3/smbd/globals.c                   |    4 -
 source3/smbd/globals.h                   |   13 +-
 source3/smbd/proto.h                     |    4 +-
 source3/smbd/reply.c                     |  112 +++-
 source3/smbd/smb2_close.c                |   52 ++
 source3/smbd/smb2_write.c                |   30 +-
 source3/smbd/smbd.h                      |    1 -
 source3/smbd/vfs.c                       |  245 ++++++--
 source3/wscript                          |   27 +-
 source3/wscript_build                    |    3 +
 36 files changed, 3287 insertions(+), 2802 deletions(-)
 create mode 100644 source3/lib/asys/asys.c
 create mode 100644 source3/lib/asys/asys.h
 create mode 100644 source3/lib/asys/tests.c
 create mode 100644 source3/lib/asys/wscript_build
 create mode 100644 source3/lib/tevent_wait.c
 create mode 100644 source3/lib/tevent_wait.h
 create mode 100644 source3/modules/vfs_aio_posix.c


Changeset truncated at 500 lines:

diff --git a/docs-xml/manpages-3/vfs_full_audit.8.xml b/docs-xml/manpages-3/vfs_full_audit.8.xml
index 8dbceb9..0f0d96d 100644
--- a/docs-xml/manpages-3/vfs_full_audit.8.xml
+++ b/docs-xml/manpages-3/vfs_full_audit.8.xml
@@ -38,13 +38,6 @@
 	complete set of Samba VFS operations:</para>
 
 	<simplelist>
-        <member>aio_cancel</member>
-        <member>aio_error</member>
-        <member>aio_fsync</member>
-        <member>aio_read</member>
-        <member>aio_return</member>
-        <member>aio_suspend</member>
-        <member>aio_write</member>
         <member>chdir</member>
         <member>chflags</member>
         <member>chmod</member>
diff --git a/examples/VFS/skel_opaque.c b/examples/VFS/skel_opaque.c
index 89d6992..03a5157 100644
--- a/examples/VFS/skel_opaque.c
+++ b/examples/VFS/skel_opaque.c
@@ -188,6 +188,21 @@ static ssize_t skel_pread(vfs_handle_struct *handle, files_struct *fsp, void *da
 	return -1;
 }
 
+static struct tevent_req *skel_pread_send(struct vfs_handle_struct *handle,
+					  TALLOC_CTX *mem_ctx,
+					  struct tevent_context *ev,
+					  struct files_struct *fsp,
+					  void *data, size_t n, off_t offset)
+{
+	return NULL;
+}
+
+static ssize_t skel_pread_recv(struct tevent_req *req, int *err)
+{
+	*err = ENOSYS;
+	return -1;
+}
+
 static ssize_t skel_write(vfs_handle_struct *handle, files_struct *fsp, const void *data, size_t n)
 {
 	errno = ENOSYS;
@@ -200,6 +215,22 @@ static ssize_t skel_pwrite(vfs_handle_struct *handle, files_struct *fsp, const v
 	return -1;
 }
 
+static struct tevent_req *skel_pwrite_send(struct vfs_handle_struct *handle,
+					   TALLOC_CTX *mem_ctx,
+					   struct tevent_context *ev,
+					   struct files_struct *fsp,
+					   const void *data,
+					   size_t n, off_t offset)
+{
+	return NULL;
+}
+
+static ssize_t skel_pwrite_recv(struct tevent_req *req, int *err)
+{
+	*err = ENOSYS;
+	return -1;
+}
+
 static off_t skel_lseek(vfs_handle_struct *handle, files_struct *fsp, off_t offset, int whence)
 {
 	errno = ENOSYS;
@@ -232,6 +263,20 @@ static int skel_fsync(vfs_handle_struct *handle, files_struct *fsp)
 	return -1;
 }
 
+static struct tevent_req *skel_fsync_send(struct vfs_handle_struct *handle,
+					  TALLOC_CTX *mem_ctx,
+					  struct tevent_context *ev,
+					  struct files_struct *fsp)
+{
+	return NULL;
+}
+
+static int skel_fsync_recv(struct tevent_req *req, int *err)
+{
+	*err = ENOSYS;
+	return -1;
+}
+
 static int skel_stat(vfs_handle_struct *handle, struct smb_filename *smb_fname)
 {
 	errno = ENOSYS;
@@ -710,48 +755,6 @@ static int skel_fsetxattr(vfs_handle_struct *handle, struct files_struct *fsp, c
 	return -1;
 }
 
-static int skel_aio_read(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb)
-{
-	errno = ENOSYS;
-	return -1;
-}
-
-static int skel_aio_write(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb)
-{
-	errno = ENOSYS;
-	return -1;
-}
-
-static ssize_t skel_aio_return_fn(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb)
-{
-	errno = ENOSYS;
-	return -1;
-}
-
-static int skel_aio_cancel(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb)
-{
-	errno = ENOSYS;
-	return -1;
-}
-
-static int skel_aio_error_fn(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb)
-{
-	errno = ENOSYS;
-	return -1;
-}
-
-static int skel_aio_fsync(struct vfs_handle_struct *handle, struct files_struct *fsp, int op, SMB_STRUCT_AIOCB *aiocb)
-{
-	errno = ENOSYS;
-	return -1;
-}
-
-static int skel_aio_suspend(struct vfs_handle_struct *handle, struct files_struct *fsp, const SMB_STRUCT_AIOCB * const aiocb[], int n, const struct timespec *ts)
-{
-	errno = ENOSYS;
-	return -1;
-}
-
 static bool skel_aio_force(struct vfs_handle_struct *handle, struct files_struct *fsp)
 {
 	errno = ENOSYS;
@@ -805,13 +808,19 @@ struct vfs_fn_pointers skel_opaque_fns = {
 	.close_fn = skel_close_fn,
 	.read_fn = skel_vfs_read,
 	.pread_fn = skel_pread,
+	.pread_send_fn = skel_pread_send,
+	.pread_recv_fn = skel_pread_recv,
 	.write_fn = skel_write,
 	.pwrite_fn = skel_pwrite,
+	.pwrite_send_fn = skel_pwrite_send,
+	.pwrite_recv_fn = skel_pwrite_recv,
 	.lseek_fn = skel_lseek,
 	.sendfile_fn = skel_sendfile,
 	.recvfile_fn = skel_recvfile,
 	.rename_fn = skel_rename,
 	.fsync_fn = skel_fsync,
+	.fsync_send_fn = skel_fsync_send,
+	.fsync_recv_fn = skel_fsync_recv,
 	.stat_fn = skel_stat,
 	.fstat_fn = skel_fstat,
 	.lstat_fn = skel_lstat,
@@ -896,13 +905,6 @@ struct vfs_fn_pointers skel_opaque_fns = {
 	.fsetxattr_fn = skel_fsetxattr,
 
 	/* aio operations */
-	.aio_read_fn = skel_aio_read,
-	.aio_write_fn = skel_aio_write,
-	.aio_return_fn = skel_aio_return_fn,
-	.aio_cancel_fn = skel_aio_cancel,
-	.aio_error_fn = skel_aio_error_fn,
-	.aio_fsync_fn = skel_aio_fsync,
-	.aio_suspend_fn = skel_aio_suspend,
 	.aio_force_fn = skel_aio_force,
 
 	/* offline operations */
diff --git a/examples/VFS/skel_transparent.c b/examples/VFS/skel_transparent.c
index 8f55d6a..6981b5d 100644
--- a/examples/VFS/skel_transparent.c
+++ b/examples/VFS/skel_transparent.c
@@ -23,6 +23,7 @@
 
 
 #include "../source3/include/includes.h"
+#include "lib/util/tevent_unix.h"
 
 /* PLEASE,PLEASE READ THE VFS MODULES CHAPTER OF THE 
    SAMBA DEVELOPERS GUIDE!!!!!!
@@ -193,6 +194,59 @@ static ssize_t skel_pread(vfs_handle_struct *handle, files_struct *fsp, void *da
 	return SMB_VFS_NEXT_PREAD(handle, fsp, data, n, offset);
 }
 
+struct skel_pread_state {
+	ssize_t ret;
+	int err;
+};
+
+static void skel_pread_done(struct tevent_req *subreq);
+
+static struct tevent_req *skel_pread_send(struct vfs_handle_struct *handle,
+					  TALLOC_CTX *mem_ctx,
+					  struct tevent_context *ev,
+					  struct files_struct *fsp,
+					  void *data, size_t n, off_t offset)
+{
+	struct tevent_req *req, *subreq;
+	struct skel_pread_state *state;
+
+	req = tevent_req_create(mem_ctx, &state, struct skel_pread_state);
+	if (req == NULL) {
+		return NULL;
+	}
+	subreq = SMB_VFS_NEXT_PREAD_SEND(state, ev, handle, fsp, data,
+					 n, offset);
+	if (tevent_req_nomem(subreq, req)) {
+		return tevent_req_post(req, ev);
+	}
+	tevent_req_set_callback(subreq, skel_pread_done, req);
+	return req;
+}
+
+static void skel_pread_done(struct tevent_req *subreq)
+{
+	struct tevent_req *req = tevent_req_callback_data(
+		subreq, struct tevent_req);
+	struct skel_pread_state *state = tevent_req_data(
+		req, struct skel_pread_state);
+
+	state->ret = SMB_VFS_PREAD_RECV(subreq, &state->err);
+	TALLOC_FREE(subreq);
+	tevent_req_done(req);
+}
+
+static ssize_t skel_pread_recv(struct tevent_req *req, int *err)
+{
+	struct skel_pread_state *state = tevent_req_data(
+		req, struct skel_pread_state);
+
+	if (tevent_req_is_unix_error(req, err)) {
+		return -1;
+	}
+	*err = state->err;
+	return state->ret;
+}
+
 static ssize_t skel_write(vfs_handle_struct *handle, files_struct *fsp, const void *data, size_t n)
 {
 	return SMB_VFS_NEXT_WRITE(handle, fsp, data, n);
@@ -203,6 +257,60 @@ static ssize_t skel_pwrite(vfs_handle_struct *handle, files_struct *fsp, const v
 	return SMB_VFS_NEXT_PWRITE(handle, fsp, data, n, offset);
 }
 
+struct skel_pwrite_state {
+	ssize_t ret;
+	int err;
+};
+
+static void skel_pwrite_done(struct tevent_req *subreq);
+
+static struct tevent_req *skel_pwrite_send(struct vfs_handle_struct *handle,
+					   TALLOC_CTX *mem_ctx,
+					   struct tevent_context *ev,
+					   struct files_struct *fsp,
+					   const void *data,
+					   size_t n, off_t offset)
+{
+	struct tevent_req *req, *subreq;
+	struct skel_pwrite_state *state;
+
+	req = tevent_req_create(mem_ctx, &state, struct skel_pwrite_state);
+	if (req == NULL) {
+		return NULL;
+	}
+	subreq = SMB_VFS_NEXT_PWRITE_SEND(state, ev, handle, fsp, data,
+					 n, offset);
+	if (tevent_req_nomem(subreq, req)) {
+		return tevent_req_post(req, ev);
+	}
+	tevent_req_set_callback(subreq, skel_pwrite_done, req);
+	return req;
+}
+
+static void skel_pwrite_done(struct tevent_req *subreq)
+{
+	struct tevent_req *req = tevent_req_callback_data(
+		subreq, struct tevent_req);
+	struct skel_pwrite_state *state = tevent_req_data(
+		req, struct skel_pwrite_state);
+
+	state->ret = SMB_VFS_PWRITE_RECV(subreq, &state->err);
+	TALLOC_FREE(subreq);
+	tevent_req_done(req);
+}
+
+static ssize_t skel_pwrite_recv(struct tevent_req *req, int *err)
+{
+	struct skel_pwrite_state *state = tevent_req_data(
+		req, struct skel_pwrite_state);
+
+	if (tevent_req_is_unix_error(req, err)) {
+		return -1;
+	}
+	*err = state->err;
+	return state->ret;
+}
+
 static off_t skel_lseek(vfs_handle_struct *handle, files_struct *fsp, off_t offset, int whence)
 {
 	return SMB_VFS_NEXT_LSEEK(handle, fsp, offset, whence);
@@ -230,6 +338,57 @@ static int skel_fsync(vfs_handle_struct *handle, files_struct *fsp)
 	return SMB_VFS_NEXT_FSYNC(handle, fsp);
 }
 
+struct skel_fsync_state {
+	int ret;
+	int err;
+};
+
+static void skel_fsync_done(struct tevent_req *subreq);
+
+static struct tevent_req *skel_fsync_send(struct vfs_handle_struct *handle,
+					  TALLOC_CTX *mem_ctx,
+					  struct tevent_context *ev,
+					  struct files_struct *fsp)
+{
+	struct tevent_req *req, *subreq;
+	struct skel_fsync_state *state;
+
+	req = tevent_req_create(mem_ctx, &state, struct skel_fsync_state);
+	if (req == NULL) {
+		return NULL;
+	}
+	subreq = SMB_VFS_NEXT_FSYNC_SEND(state, ev, handle, fsp);
+	if (tevent_req_nomem(subreq, req)) {
+		return tevent_req_post(req, ev);
+	}
+	tevent_req_set_callback(subreq, skel_fsync_done, req);
+	return req;
+}
+
+static void skel_fsync_done(struct tevent_req *subreq)
+{
+	struct tevent_req *req = tevent_req_callback_data(
+		subreq, struct tevent_req);
+	struct skel_fsync_state *state = tevent_req_data(
+		req, struct skel_fsync_state);
+
+	state->ret = SMB_VFS_FSYNC_RECV(subreq, &state->err);
+	TALLOC_FREE(subreq);
+	tevent_req_done(req);
+}
+
+static int skel_fsync_recv(struct tevent_req *req, int *err)
+{
+	struct skel_fsync_state *state = tevent_req_data(
+		req, struct skel_fsync_state);
+
+	if (tevent_req_is_unix_error(req, err)) {
+		return -1;
+	}
+	*err = state->err;
+	return state->ret;
+}
+
 static int skel_stat(vfs_handle_struct *handle, struct smb_filename *smb_fname)
 {
 	return SMB_VFS_NEXT_STAT(handle, smb_fname);
@@ -680,41 +839,6 @@ static int skel_fsetxattr(vfs_handle_struct *handle, struct files_struct *fsp, c
         return SMB_VFS_NEXT_FSETXATTR(handle, fsp, name, value, size, flags);
 }
 
-static int skel_aio_read(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb)
-{
-	return SMB_VFS_NEXT_AIO_READ(handle, fsp, aiocb);
-}
-
-static int skel_aio_write(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb)
-{
-	return SMB_VFS_NEXT_AIO_WRITE(handle, fsp, aiocb);
-}
-
-static ssize_t skel_aio_return_fn(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb)
-{
-	return SMB_VFS_NEXT_AIO_RETURN(handle, fsp, aiocb);
-}
-
-static int skel_aio_cancel(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb)
-{
-	return SMB_VFS_NEXT_AIO_CANCEL(handle, fsp, aiocb);
-}
-
-static int skel_aio_error_fn(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb)
-{
-	return SMB_VFS_NEXT_AIO_ERROR(handle, fsp, aiocb);
-}
-
-static int skel_aio_fsync(struct vfs_handle_struct *handle, struct files_struct *fsp, int op, SMB_STRUCT_AIOCB *aiocb)
-{
-	return SMB_VFS_NEXT_AIO_FSYNC(handle, fsp, op, aiocb);
-}
-
-static int skel_aio_suspend(struct vfs_handle_struct *handle, struct files_struct *fsp, const SMB_STRUCT_AIOCB * const aiocb[], int n, const struct timespec *ts)
-{
-	return SMB_VFS_NEXT_AIO_SUSPEND(handle, fsp, aiocb, n, ts);
-}
-
 static bool skel_aio_force(struct vfs_handle_struct *handle, struct files_struct *fsp)
 {
         return SMB_VFS_NEXT_AIO_FORCE(handle, fsp);
@@ -765,13 +889,19 @@ struct vfs_fn_pointers skel_transparent_fns = {
 	.close_fn = skel_close_fn,
 	.read_fn = skel_vfs_read,
 	.pread_fn = skel_pread,
+	.pread_send_fn = skel_pread_send,
+	.pread_recv_fn = skel_pread_recv,
 	.write_fn = skel_write,
 	.pwrite_fn = skel_pwrite,
+	.pwrite_send_fn = skel_pwrite_send,
+	.pwrite_recv_fn = skel_pwrite_recv,
 	.lseek_fn = skel_lseek,
 	.sendfile_fn = skel_sendfile,
 	.recvfile_fn = skel_recvfile,
 	.rename_fn = skel_rename,
 	.fsync_fn = skel_fsync,
+	.fsync_send_fn = skel_fsync_send,
+	.fsync_recv_fn = skel_fsync_recv,
 	.stat_fn = skel_stat,
 	.fstat_fn = skel_fstat,
 	.lstat_fn = skel_lstat,
@@ -856,13 +986,6 @@ struct vfs_fn_pointers skel_transparent_fns = {
 	.fsetxattr_fn = skel_fsetxattr,
 
 	/* aio operations */
-	.aio_read_fn = skel_aio_read,
-	.aio_write_fn = skel_aio_write,
-	.aio_return_fn = skel_aio_return_fn,
-	.aio_cancel_fn = skel_aio_cancel,
-	.aio_error_fn = skel_aio_error_fn,
-	.aio_fsync_fn = skel_aio_fsync,
-	.aio_suspend_fn = skel_aio_suspend,
 	.aio_force_fn = skel_aio_force,
 
 	/* offline operations */
diff --git a/source3/Makefile.in b/source3/Makefile.in
index 672f2ac..dc3817f 100644
--- a/source3/Makefile.in
+++ b/source3/Makefile.in
@@ -453,6 +453,7 @@ LIB_OBJ = $(LIBSAMBAUTIL_OBJ) $(UTIL_OBJ) $(CRYPTO_OBJ) $(LIBTSOCKET_OBJ) \
 	  ../lib/socket/interfaces.o lib/memcache.o \
 	  lib/talloc_dict.o \
 	  lib/serverid.o \
+	  lib/asys/asys.o \
 	  lib/util_transfer_file.o ../lib/async_req/async_sock.o \
 	  lib/addrchange.o \
 	  $(TDB_LIB_OBJ) \
@@ -494,6 +495,7 @@ LIB_OBJ = $(LIBSAMBAUTIL_OBJ) $(UTIL_OBJ) $(CRYPTO_OBJ) $(LIBTSOCKET_OBJ) \
 	  lib/fncall.o \
 	  libads/krb5_errs.o lib/system_smbd.o lib/audit.o $(LIBNDR_OBJ) \
 	  lib/file_id.o lib/idmap_cache.o \
+	  lib/tevent_wait.o \
 	  ../libcli/security/dom_sid.o ../libcli/security/security_descriptor.o \
 	  ../libcli/security/security_token.o ../libcli/security/util_sid.o \
 	  ../libcli/smb/util.o ../lib/util/idtree.o
@@ -887,6 +889,7 @@ VFS_TSMSM_OBJ = modules/vfs_tsmsm.o
 VFS_FILEID_OBJ = modules/vfs_fileid.o
 VFS_AIO_FORK_OBJ = modules/vfs_aio_fork.o
 VFS_AIO_PTHREAD_OBJ = modules/vfs_aio_pthread.o
+VFS_AIO_POSIX_OBJ = modules/vfs_aio_posix.o
 VFS_AIO_LINUX_OBJ = modules/vfs_aio_linux.o
 VFS_PREOPEN_OBJ = modules/vfs_preopen.o
 VFS_SYNCOPS_OBJ = modules/vfs_syncops.o
@@ -2900,6 +2903,10 @@ bin/aio_pthread. at SHLIBEXT@: $(BINARY_PREREQS) $(VFS_AIO_PTHREAD_OBJ)
 	@echo "Building plugin $@"
 	@$(SHLD_MODULE) $(VFS_AIO_PTHREAD_OBJ)
 
+bin/aio_posix. at SHLIBEXT@: $(BINARY_PREREQS) $(VFS_AIO_POSIX_OBJ)
+	@echo "Building plugin $@"
+	@$(SHLD_MODULE) $(VFS_AIO_POSIX_OBJ)
+
 bin/aio_linux. at SHLIBEXT@: $(BINARY_PREREQS) $(VFS_AIO_LINUX_OBJ)
 	@echo "Building plugin $@"
 	@$(SHLD_MODULE) $(VFS_AIO_LINUX_OBJ)
diff --git a/source3/configure.in b/source3/configure.in
index 150f189..6a26038 100644
--- a/source3/configure.in
+++ b/source3/configure.in
@@ -5542,20 +5542,19 @@ int main() { struct aiocb a; return aio_suspend(&a, 1, NULL); }])],
 		fi
 fi
 
-if test x"$samba_cv_HAVE_AIO" = x"yes"; then
-	if test x"$samba_cv_msghdr_msg_control" = x"yes" -o \
-		x"$samba_cv_msghdr_msg_acctright" = x"yes"; then
-		default_shared_modules="$default_shared_modules vfs_aio_fork"
-	fi
+if test x"$samba_cv_msghdr_msg_control" = x"yes" -o \
+	x"$samba_cv_msghdr_msg_acctright" = x"yes"; then
+	default_shared_modules="$default_shared_modules vfs_aio_fork"
+fi
 
 # Check for Linux kernel aio support.
-	case "$host_os" in
-	*linux*)
-	    AC_CHECK_LIB(aio,io_submit,[AIO_LIBS="$LIBS -laio"])
-	    AC_CACHE_CHECK([for Linux kernel asynchronous io support],samba_cv_HAVE_LINUX_KERNEL_AIO,[


-- 
Samba Shared Repository


More information about the samba-cvs mailing list