[SCM] Samba Shared Repository - branch master updated

Jeremy Allison jra at samba.org
Sat Nov 11 07:45:04 UTC 2017


The branch, master has been updated
       via  a0f6ea8 libsmbclient: Allow server (NetApp) to return STATUS_INVALID_PARAMETER from an echo.
       via  37ac8ad vfs: remove SMB_VFS_INIT_SEARCH_OP
       via  bb40fa8 vfs_unityed_media: remove handling of init_search_op
       via  7a34ed8 vfs_media_harmony: remove handling of init_search_op
       via  fba8bd6 vfs_time_audit: remove init_search_op implementation
       via  0f1dede vfs_glusterfs: remove init_search_op handling
       via  fd1aa4a VFS examples: remove init_search_ops
       via  1d9e8ff smbd: remove dptr_init_search_op()
       via  b8aa599 smbd: remove calls to dptr_init_search_op() from TRANS2 search code
       via  f53ee12 smbd: remove calls to dptr_init_search_op()
       via  6381044 vfs: Remove aio_linux
      from  20cfcb7 tevent: Fix a race condition

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


- Log -----------------------------------------------------------------
commit a0f6ea8dec1ab3d19bc93da12a9b0a1c0ccf6142
Author: Jeremy Allison <jra at samba.org>
Date:   Fri Sep 8 16:20:34 2017 -0700

    libsmbclient: Allow server (NetApp) to return STATUS_INVALID_PARAMETER from an echo.
    
    It does this if we send a session ID of zero. The server still replied.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=13007
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    
    Autobuild-User(master): Jeremy Allison <jra at samba.org>
    Autobuild-Date(master): Sat Nov 11 08:44:37 CET 2017 on sn-devel-144

commit 37ac8ad4bf3122c369eec6f213bb8a62f8e92884
Author: Uri Simchoni <uri at samba.org>
Date:   Fri Nov 10 21:53:58 2017 +0200

    vfs: remove SMB_VFS_INIT_SEARCH_OP
    
    This VFS is no longer being called, hence removed.
    
    Signed-off-by: Uri Simchoni <uri at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit bb40fa8445d650e6d840abe96b0143950da037ca
Author: Uri Simchoni <uri at samba.org>
Date:   Fri Nov 10 21:50:17 2017 +0200

    vfs_unityed_media: remove handling of init_search_op
    
    init_search_op is about to be removed from the VFS in
    a following commit. In the meantime, removing it poses
    no issue because he underlying impementation is a no-op.
    
    Signed-off-by: Uri Simchoni <uri at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 7a34ed88c88036942d955fcc1e303e147f2001fb
Author: Uri Simchoni <uri at samba.org>
Date:   Fri Nov 10 21:48:26 2017 +0200

    vfs_media_harmony: remove handling of init_search_op
    
    This VFS function is about to be removed in a following commit.
    In the meantime, not handling it by vfs_media_harmony poses no
    issue because the underlying implenentation is a no-op.
    
    Signed-off-by: Uri Simchoni <uri at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit fba8bd6cb8315cfbab8883b12eb818a0f8fddfa7
Author: Uri Simchoni <uri at samba.org>
Date:   Fri Nov 10 21:47:29 2017 +0200

    vfs_time_audit: remove init_search_op implementation
    
    This VFS call is about to be removed in a following commit.
    
    Signed-off-by: Uri Simchoni <uri at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 0f1dede9a90996d0a0cbbe91c2a0389b47b706b7
Author: Uri Simchoni <uri at samba.org>
Date:   Fri Nov 10 21:39:54 2017 +0200

    vfs_glusterfs: remove init_search_op handling
    
    This VFS function is about to be removed. It can be
    removed by a separate commit because both the glusterfs
    and the default implementations are no-ops.
    
    Signed-off-by: Uri Simchoni <uri at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit fd1aa4a6b0f58882e3ae6a53f9116d254e036cdf
Author: Uri Simchoni <uri at samba.org>
Date:   Fri Nov 10 21:20:47 2017 +0200

    VFS examples: remove init_search_ops
    
    Signed-off-by: Uri Simchoni <uri at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 1d9e8ff87b1c0e7e495ebbfb230a3f0ac7c57285
Author: Uri Simchoni <uri at samba.org>
Date:   Fri Nov 10 21:38:41 2017 +0200

    smbd: remove dptr_init_search_op()
    
    This function is now not being used.
    
    Signed-off-by: Uri Simchoni <uri at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit b8aa599f060ea6de7277b0af42659a09f4469165
Author: Uri Simchoni <uri at samba.org>
Date:   Fri Nov 10 21:35:54 2017 +0200

    smbd: remove calls to dptr_init_search_op() from TRANS2 search code
    
    dptr_init_search_op() invokes VFS operations which are no-op in all
    in-tree VFS modules. Furthermore, it's not being called by the SMB2
    search code, so probably it's not being used by any out-of-tree VFS
    module either.
    
    Signed-off-by: Uri Simchoni <uri at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit f53ee1284f785e85fea33506263f76757335ee20
Author: Uri Simchoni <uri at samba.org>
Date:   Fri Nov 10 21:32:49 2017 +0200

    smbd: remove calls to dptr_init_search_op()
    
    dptr_init_search_op() invokes a VFS operation which is
    a no-op in all in-tree VFS modules. Furthermore,
    dptr_init_search_op() is not being called from SMB2 search
    code, which hints that no out-of-tree VFS module needs it.
    
    Signed-off-by: Uri Simchoni <uri at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

commit 6381044c0270a647c20935d22fd23f235d19b328
Author: Volker Lendecke <vl at samba.org>
Date:   Fri Nov 10 12:09:36 2017 +0100

    vfs: Remove aio_linux
    
    Triggered by https://bugzilla.samba.org/show_bug.cgi?id=13128 I think
    this module should go. Once Linux aio will do what Samba needs, this
    might be worth another look.
    
    What we should instead do soon is support Linux preadv2 and the
    RWF_NOWAIT flag to avoid the thread context switch whenever possible.
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

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

Summary of changes:
 WHATSNEW.txt                          |   9 +
 docs-xml/manpages/vfs_aio_linux.8.xml | 115 -----------
 docs-xml/wscript_build                |   1 -
 examples/VFS/skel_opaque.c            |   6 -
 examples/VFS/skel_transparent.c       |   6 -
 source3/client/client.c               |   8 +-
 source3/include/vfs.h                 |   6 +-
 source3/include/vfs_macros.h          |   5 -
 source3/libsmb/libsmb_server.c        |  11 +-
 source3/modules/vfs_aio_linux.c       | 346 ----------------------------------
 source3/modules/vfs_default.c         |   7 -
 source3/modules/vfs_full_audit.c      |  11 --
 source3/modules/vfs_glusterfs.c       |   7 -
 source3/modules/vfs_media_harmony.c   |  13 --
 source3/modules/vfs_time_audit.c      |  17 --
 source3/modules/vfs_unityed_media.c   |  10 -
 source3/modules/wscript_build         |   8 -
 source3/smbd/dir.c                    |   8 -
 source3/smbd/proto.h                  |   1 -
 source3/smbd/reply.c                  |   3 -
 source3/smbd/trans2.c                 |   6 -
 source3/smbd/vfs.c                    |   7 -
 source3/wscript                       |  26 ---
 23 files changed, 28 insertions(+), 609 deletions(-)
 delete mode 100644 docs-xml/manpages/vfs_aio_linux.8.xml
 delete mode 100644 source3/modules/vfs_aio_linux.c


Changeset truncated at 500 lines:

diff --git a/WHATSNEW.txt b/WHATSNEW.txt
index cc03f20..475ebcb 100644
--- a/WHATSNEW.txt
+++ b/WHATSNEW.txt
@@ -65,6 +65,15 @@ commands have been removed from rpcclient.
 "net rpc vampire keytab" from Active Directory domains continues to be
 supported.
 
+vfs_aio_linux module removed
+============================
+
+The current Linux kernel aio does not match what Samba would
+do. Shipping code that uses it leads people to false
+assumptions. Samba implements async I/O based on threads by default,
+there is no special module required to see benefits of read and write
+request being sent do the disk in parallel.
+
 KNOWN ISSUES
 ============
 
diff --git a/docs-xml/manpages/vfs_aio_linux.8.xml b/docs-xml/manpages/vfs_aio_linux.8.xml
deleted file mode 100644
index 3a00950..0000000
--- a/docs-xml/manpages/vfs_aio_linux.8.xml
+++ /dev/null
@@ -1,115 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!DOCTYPE refentry PUBLIC "-//Samba-Team//DTD DocBook V4.2-Based Variant V1.0//EN" "http://www.samba.org/samba/DTD/samba-doc">
-<refentry id="vfs_aio_linux.8">
-
-<refmeta>
-	<refentrytitle>vfs_aio_linux</refentrytitle>
-	<manvolnum>8</manvolnum>
-	<refmiscinfo class="source">Samba</refmiscinfo>
-	<refmiscinfo class="manual">System Administration tools</refmiscinfo>
-	<refmiscinfo class="version">4.7</refmiscinfo>
-</refmeta>
-
-
-<refnamediv>
-	<refname>vfs_aio_linux</refname>
-	<refpurpose>implement async I/O in Samba vfs using Linux kernel aio calls</refpurpose>
-</refnamediv>
-
-<refsynopsisdiv>
-	<cmdsynopsis>
-		<command>vfs objects = aio_linux</command>
-	</cmdsynopsis>
-</refsynopsisdiv>
-
-<refsect1>
-	<title>DESCRIPTION</title>
-
-	<para>This VFS module is part of the
-	<citerefentry><refentrytitle>samba</refentrytitle>
-	<manvolnum>7</manvolnum></citerefentry> suite.</para>
-
-	<para>The <command>aio_linux</command> VFS module enables asynchronous
-	I/O for Samba on Linux kernels that have the kernel AIO calls available
-	without using the Posix AIO interface. Posix AIO can suffer from severe
-	limitations.  For example, on some Linux versions the
-	real-time signals that it uses are broken under heavy load.
-	Other systems only allow AIO when special kernel modules are
-	loaded or only allow a certain system-wide amount of async
-	requests being scheduled. Systems based on glibc (most Linux
-	systems) only allow a single outstanding request per file
-	descriptor which essentially makes Posix AIO useless on systems
-	using the glibc implementation.</para>
-
-	<para>To work around all these limitations, the aio_linux module
-	was written. It uses the Linux kernel AIO interface instead of the
-	internal Posix AIO interface to allow read and write calls
-	to be processed asynchronously. A queue size of 128 events
-	is used by default. To change this limit set the "aio num events"
-	parameter below.
-	</para>
-
-	<para>
-	Note that the smb.conf parameters <command>aio read size</command>
-	and <command>aio write size</command> must also be set appropriately
-	for this module to be active.
-	</para>
-
-	<para>This module MUST be listed last in any module stack as
-	the Samba VFS pread/pwrite interface is not thread-safe. This
-	module makes direct pread and pwrite system calls and does
-	NOT call the Samba VFS pread and pwrite interfaces.</para>
-
-</refsect1>
-
-
-<refsect1>
-	<title>EXAMPLES</title>
-
-	<para>Straight forward use:</para>
-
-<programlisting>
-        <smbconfsection name="[cooldata]"/>
-	<smbconfoption name="path">/data/ice</smbconfoption>
-	<smbconfoption name="aio read size">1024</smbconfoption>
-	<smbconfoption name="aio write size">1024</smbconfoption>
-	<smbconfoption name="vfs objects">aio_linux</smbconfoption>
-</programlisting>
-
-</refsect1>
-
-<refsect1>
-	<title>OPTIONS</title>
-
-	<variablelist>
-
-		<varlistentry>
-		<term>aio_linux:aio num events = INTEGER</term>
-		<listitem>
-		<para>Set the maximum size of the event queue
-		that is used to limit outstanding IO requests.
-		</para>
-		<para>By default this is set to 128.</para>
-		</listitem>
-		</varlistentry>
-
-	</variablelist>
-</refsect1>
-<refsect1>
-	<title>VERSION</title>
-
-	<para>This man page is correct for version 4.0 of the Samba suite.
-	</para>
-</refsect1>
-
-<refsect1>
-	<title>AUTHOR</title>
-
-	<para>The original Samba software and related utilities
-	were created by Andrew Tridgell. Samba is now developed
-	by the Samba Team as an Open Source project similar
-	to the way the Linux kernel is developed.</para>
-
-</refsect1>
-
-</refentry>
diff --git a/docs-xml/wscript_build b/docs-xml/wscript_build
index afba0b9..0bd08d1 100644
--- a/docs-xml/wscript_build
+++ b/docs-xml/wscript_build
@@ -52,7 +52,6 @@ manpages='''
          manpages/vfs_acl_tdb.8
          manpages/vfs_acl_xattr.8
          manpages/vfs_aio_fork.8
-         manpages/vfs_aio_linux.8
          manpages/vfs_aio_pthread.8
          manpages/vfs_audit.8
 	 manpages/vfs_btrfs.8
diff --git a/examples/VFS/skel_opaque.c b/examples/VFS/skel_opaque.c
index 614dcff..e6c066d 100644
--- a/examples/VFS/skel_opaque.c
+++ b/examples/VFS/skel_opaque.c
@@ -185,11 +185,6 @@ static int skel_closedir(vfs_handle_struct *handle, DIR *dir)
 	return -1;
 }
 
-static void skel_init_search_op(struct vfs_handle_struct *handle, DIR *dirp)
-{
-	;
-}
-
 static int skel_open(vfs_handle_struct *handle, struct smb_filename *smb_fname,
 		     files_struct *fsp, int flags, mode_t mode)
 {
@@ -954,7 +949,6 @@ struct vfs_fn_pointers skel_opaque_fns = {
 	.mkdir_fn = skel_mkdir,
 	.rmdir_fn = skel_rmdir,
 	.closedir_fn = skel_closedir,
-	.init_search_op_fn = skel_init_search_op,
 
 	/* File operations */
 
diff --git a/examples/VFS/skel_transparent.c b/examples/VFS/skel_transparent.c
index 2f59a3d..59d1634 100644
--- a/examples/VFS/skel_transparent.c
+++ b/examples/VFS/skel_transparent.c
@@ -182,11 +182,6 @@ static int skel_closedir(vfs_handle_struct *handle, DIR *dir)
 	return SMB_VFS_NEXT_CLOSEDIR(handle, dir);
 }
 
-static void skel_init_search_op(struct vfs_handle_struct *handle, DIR *dirp)
-{
-	SMB_VFS_NEXT_INIT_SEARCH_OP(handle, dirp);
-}
-
 static int skel_open(vfs_handle_struct *handle, struct smb_filename *smb_fname,
 		     files_struct *fsp, int flags, mode_t mode)
 {
@@ -1127,7 +1122,6 @@ struct vfs_fn_pointers skel_transparent_fns = {
 	.mkdir_fn = skel_mkdir,
 	.rmdir_fn = skel_rmdir,
 	.closedir_fn = skel_closedir,
-	.init_search_op_fn = skel_init_search_op,
 
 	/* File operations */
 
diff --git a/source3/client/client.c b/source3/client/client.c
index 8f449e8..754907d 100644
--- a/source3/client/client.c
+++ b/source3/client/client.c
@@ -6027,7 +6027,13 @@ static void readline_callback(void)
 	/* Ping the server to keep the connection alive using SMBecho. */
 	memset(garbage, 0xf0, sizeof(garbage));
 	status = cli_echo(cli, 1, data_blob_const(garbage, sizeof(garbage)));
-	if (NT_STATUS_IS_OK(status)) {
+	if (NT_STATUS_IS_OK(status) ||
+			NT_STATUS_EQUAL(status, NT_STATUS_INVALID_PARAMETER)) {
+		/*
+		 * Even if server returns NT_STATUS_INVALID_PARAMETER
+		 * it still responded.
+		 * BUG: https://bugzilla.samba.org/show_bug.cgi?id=13007
+		 */
 		return;
 	}
 
diff --git a/source3/include/vfs.h b/source3/include/vfs.h
index d71d7cc..7372440 100644
--- a/source3/include/vfs.h
+++ b/source3/include/vfs.h
@@ -244,8 +244,9 @@
 /* Version 37 - Remove SMB_VFS_STRICT_UNLOCK */
 /* Version 37 - Rename SMB_VFS_STRICT_LOCK to
                 SMB_VFS_STRICT_LOCK_CHECK */
+/* Version 38 - Remove SMB_VFS_INIT_SEARCH_OP */
 
-#define SMB_VFS_INTERFACE_VERSION 37
+#define SMB_VFS_INTERFACE_VERSION 38
 
 /*
     All intercepted VFS operations must be declared as static functions inside module source
@@ -656,7 +657,6 @@ struct vfs_fn_pointers {
 	int (*rmdir_fn)(struct vfs_handle_struct *handle,
 			const struct smb_filename *smb_fname);
 	int (*closedir_fn)(struct vfs_handle_struct *handle, DIR *dir);
-	void (*init_search_op_fn)(struct vfs_handle_struct *handle, DIR *dirp);
 
 	/* File operations */
 
@@ -1145,8 +1145,6 @@ int smb_vfs_call_rmdir(struct vfs_handle_struct *handle,
 			const struct smb_filename *smb_fname);
 int smb_vfs_call_closedir(struct vfs_handle_struct *handle,
 			  DIR *dir);
-void smb_vfs_call_init_search_op(struct vfs_handle_struct *handle,
-				 DIR *dirp);
 int smb_vfs_call_open(struct vfs_handle_struct *handle,
 		      struct smb_filename *smb_fname, struct files_struct *fsp,
 		      int flags, mode_t mode);
diff --git a/source3/include/vfs_macros.h b/source3/include/vfs_macros.h
index 3cce192..dcf788e 100644
--- a/source3/include/vfs_macros.h
+++ b/source3/include/vfs_macros.h
@@ -124,11 +124,6 @@
 #define SMB_VFS_NEXT_CLOSEDIR(handle, dir) \
 	smb_vfs_call_closedir((handle)->next, (dir))
 
-#define SMB_VFS_INIT_SEARCH_OP(conn, dirp) \
-	smb_vfs_call_init_search_op((conn)->vfs_handles, (dirp))
-#define SMB_VFS_NEXT_INIT_SEARCH_OP(handle, dirp) \
-	smb_vfs_call_init_search_op((handle)->next, (dirp))
-
 /* File operations */
 #define SMB_VFS_OPEN(conn, fname, fsp, flags, mode) \
 	smb_vfs_call_open((conn)->vfs_handles, (fname), (fsp), (flags), (mode))
diff --git a/source3/libsmb/libsmb_server.c b/source3/libsmb/libsmb_server.c
index 93b9e80..e6067be 100644
--- a/source3/libsmb/libsmb_server.c
+++ b/source3/libsmb/libsmb_server.c
@@ -61,7 +61,16 @@ SMBC_check_server(SMBCCTX * context,
 					1,
 					data_blob_const(data, sizeof(data)));
 		if (!NT_STATUS_IS_OK(status)) {
-			return 1;
+			/*
+			 * Some NetApp servers return
+			 * NT_STATUS_INVALID_PARAMETER.That's OK, they still
+			 * replied.
+			 * BUG: https://bugzilla.samba.org/show_bug.cgi?id=13007
+			 */
+			if (!NT_STATUS_EQUAL(status,
+					NT_STATUS_INVALID_PARAMETER)) {
+				return 1;
+			}
 		}
 		server->last_echo_time = now;
 	}
diff --git a/source3/modules/vfs_aio_linux.c b/source3/modules/vfs_aio_linux.c
deleted file mode 100644
index e89c290..0000000
--- a/source3/modules/vfs_aio_linux.c
+++ /dev/null
@@ -1,346 +0,0 @@
-/*
- * Simulate Posix AIO using Linux kernel AIO.
- *
- * Copyright (C) Jeremy Allison 2012
- * Copyright (C) Volker Lendecke 2012
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-#include "includes.h"
-#include "system/filesys.h"
-#include "smbd/smbd.h"
-#include "smbd/globals.h"
-#include "lib/util/tevent_unix.h"
-#include "lib/util/sys_rw.h"
-#include <sys/eventfd.h>
-#include <libaio.h>
-#include "smbprofile.h"
-
-static int event_fd = -1;
-static io_context_t io_ctx;
-static struct tevent_fd *aio_read_event;
-static bool used;
-static unsigned num_busy;
-
-static void aio_linux_done(struct tevent_context *event_ctx,
-			   struct tevent_fd *event,
-			   uint16_t flags, void *private_data);
-
-/************************************************************************
- Housekeeping. Cleanup if no activity for 30 seconds.
-***********************************************************************/
-
-static void aio_linux_housekeeping(struct tevent_context *event_ctx,
-                                        struct tevent_timer *te,
-                                        struct timeval now,
-                                        void *private_data)
-{
-	/* Remove this timed event handler. */
-	TALLOC_FREE(te);
-
-	if ((num_busy != 0) || used) {
-		used = false;
-
-		/* Still busy. Look again in 30 seconds. */
-		(void)tevent_add_timer(event_ctx,
-					NULL,
-					timeval_current_ofs(30, 0),
-					aio_linux_housekeeping,
-					NULL);
-		return;
-	}
-
-	/* No activity for 30 seconds. Close out kernel resources. */
-	io_queue_release(io_ctx);
-	memset(&io_ctx, '\0', sizeof(io_ctx));
-
-	if (event_fd != -1) {
-		close(event_fd);
-		event_fd = -1;
-	}
-
-	TALLOC_FREE(aio_read_event);
-}
-
-/************************************************************************
- Ensure event fd and aio context are initialized.
-***********************************************************************/
-
-static bool init_aio_linux(struct vfs_handle_struct *handle)
-{
-	struct tevent_timer *te = NULL;
-
-	if (event_fd != -1) {
-		/* Already initialized. */
-		return true;
-	}
-
-	/* Schedule a shutdown event for 30 seconds from now. */
-	te = tevent_add_timer(handle->conn->sconn->ev_ctx,
-				NULL,
-				timeval_current_ofs(30, 0),
-				aio_linux_housekeeping,
-				NULL);
-
-	if (te == NULL) {
-		goto fail;
-	}
-
-	event_fd = eventfd(0, EFD_NONBLOCK | EFD_CLOEXEC);
-	if (event_fd == -1) {
-		goto fail;
-	}
-
-	aio_read_event = tevent_add_fd(server_event_context(),
-				NULL,
-				event_fd,
-				TEVENT_FD_READ,
-				aio_linux_done,
-				NULL);
-	if (aio_read_event == NULL) {
-		goto fail;
-	}
-
-	if (io_queue_init(lp_aio_max_threads(), &io_ctx)) {
-		goto fail;
-	}
-
-	DEBUG(10,("init_aio_linux: initialized with up to %d events\n",
-		  (int)lp_aio_max_threads()));
-
-	return true;
-
-  fail:
-
-	DEBUG(10,("init_aio_linux: initialization failed\n"));
-
-	TALLOC_FREE(te);
-	TALLOC_FREE(aio_read_event);
-	if (event_fd != -1) {
-		close(event_fd);
-		event_fd = -1;
-	}
-	memset(&io_ctx, '\0', sizeof(io_ctx));
-	return false;
-}
-
-struct aio_linux_state {
-	struct iocb event_iocb;
-	ssize_t ret;
-	struct vfs_aio_state vfs_aio_state;
-	struct timespec start;
-};
-
-static struct tevent_req *aio_linux_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;
-	struct aio_linux_state *state;
-	struct iocb *piocb;
-	int ret;
-
-	req = tevent_req_create(mem_ctx, &state, struct aio_linux_state);
-	if (req == NULL) {
-		return NULL;
-	}
-	if (!init_aio_linux(handle)) {
-		tevent_req_error(req, EIO);
-		return tevent_req_post(req, ev);
-	}
-
-	io_prep_pread(&state->event_iocb, fsp->fh->fd, data, n, offset);
-	io_set_eventfd(&state->event_iocb, event_fd);
-	state->event_iocb.data = req;
-
-	piocb = &state->event_iocb;
-
-	PROFILE_TIMESTAMP(&state->start);
-	ret = io_submit(io_ctx, 1, &piocb);
-	if (ret < 0) {
-		tevent_req_error(req, -ret);
-		return tevent_req_post(req, ev);
-	}
-	num_busy += 1;
-	used = true;
-	return req;
-}
-
-static struct tevent_req *aio_linux_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;
-	struct aio_linux_state *state;
-	struct iocb *piocb;
-	int ret;
-
-	req = tevent_req_create(mem_ctx, &state, struct aio_linux_state);
-	if (req == NULL) {
-		return NULL;
-	}
-	if (!init_aio_linux(handle)) {
-		tevent_req_error(req, EIO);
-		return tevent_req_post(req, ev);
-	}
-
-	io_prep_pwrite(&state->event_iocb, fsp->fh->fd, discard_const(data),
-		       n, offset);
-	io_set_eventfd(&state->event_iocb, event_fd);


-- 
Samba Shared Repository



More information about the samba-cvs mailing list