[SCM] Samba Shared Repository - branch master updated

Jeremy Allison jra at samba.org
Fri Oct 4 18:19:04 UTC 2019


The branch, master has been updated
       via  4b62c4f7add lib/replace: Remove libaio support
       via  bcbadeb8265 ntvfs: Remove pvfs_aio.c
      from  0bddee8dac0 ctdb-tests: Rename functions to test_header() and test_footer()

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


- Log -----------------------------------------------------------------
commit 4b62c4f7addba3ce47f1d0d5f2b64103602b7ca2
Author: Volker Lendecke <vl at samba.org>
Date:   Fri Oct 4 10:40:18 2019 +0200

    lib/replace: Remove libaio support
    
    io_uring is the way to go these days, libaio was never really useful
    for Samba
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    
    Autobuild-User(master): Jeremy Allison <jra at samba.org>
    Autobuild-Date(master): Fri Oct  4 18:18:41 UTC 2019 on sn-devel-184

commit bcbadeb82656fafb68b506a3067999c03c481cd2
Author: Volker Lendecke <vl at samba.org>
Date:   Fri Oct 4 10:36:30 2019 +0200

    ntvfs: Remove pvfs_aio.c
    
    This uses the Linux libaio that does not meet Samba's needs. If
    someone wanted to add async I/O to ntvfs, the io_uring API is the way
    to go. Second option would be to use a pthreads-based API.
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

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

Summary of changes:
 lib/replace/system/aio.h          |  32 --------
 lib/replace/tests/testsuite.c     |   1 -
 lib/replace/wscript               |   2 +-
 source4/ntvfs/posix/pvfs_aio.c    | 166 --------------------------------------
 source4/ntvfs/posix/pvfs_read.c   |  10 ---
 source4/ntvfs/posix/pvfs_write.c  |  10 ---
 source4/ntvfs/posix/vfs_posix.c   |   2 -
 source4/ntvfs/posix/vfs_posix.h   |   7 --
 source4/ntvfs/posix/wscript_build |   9 +--
 9 files changed, 2 insertions(+), 237 deletions(-)
 delete mode 100644 lib/replace/system/aio.h
 delete mode 100644 source4/ntvfs/posix/pvfs_aio.c


Changeset truncated at 500 lines:

diff --git a/lib/replace/system/aio.h b/lib/replace/system/aio.h
deleted file mode 100644
index 784d77fa280..00000000000
--- a/lib/replace/system/aio.h
+++ /dev/null
@@ -1,32 +0,0 @@
-#ifndef _system_aio_h
-#define _system_aio_h
-/* 
-   Unix SMB/CIFS implementation.
-
-   AIO system include wrappers
-
-   Copyright (C) Andrew Tridgell 2006
-   
-     ** NOTE! The following LGPL license applies to the replace
-     ** library. This does NOT imply that all of Samba is released
-     ** under the LGPL
-   
-   This library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 3 of the License, or (at your option) any later version.
-
-   This library 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
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with this library; if not, see <http://www.gnu.org/licenses/>.
-*/
-
-#ifdef HAVE_LIBAIO_H
-#include <libaio.h>
-#endif
-
-#endif
diff --git a/lib/replace/tests/testsuite.c b/lib/replace/tests/testsuite.c
index dba545e27a2..7f9801e9f98 100644
--- a/lib/replace/tests/testsuite.c
+++ b/lib/replace/tests/testsuite.c
@@ -46,7 +46,6 @@
 #include "system/terminal.h"
 #include "system/time.h"
 #include "system/wait.h"
-#include "system/aio.h"
 
 #define TESTFILE "testfile.dat"
 
diff --git a/lib/replace/wscript b/lib/replace/wscript
index 93379a7aefe..c9d27e13df8 100644
--- a/lib/replace/wscript
+++ b/lib/replace/wscript
@@ -37,7 +37,7 @@ def configure(conf):
     conf.CHECK_HEADERS('linux/types.h crypt.h locale.h acl/libacl.h compat.h')
     conf.CHECK_HEADERS('acl/libacl.h attr/xattr.h compat.h ctype.h dustat.h')
     conf.CHECK_HEADERS('fcntl.h fnmatch.h glob.h history.h krb5.h langinfo.h')
-    conf.CHECK_HEADERS('libaio.h locale.h ndir.h pwd.h')
+    conf.CHECK_HEADERS('locale.h ndir.h pwd.h')
     conf.CHECK_HEADERS('shadow.h sys/acl.h')
     conf.CHECK_HEADERS('sys/attributes.h attr/attributes.h sys/capability.h sys/dir.h sys/epoll.h')
     conf.CHECK_HEADERS('port.h')
diff --git a/source4/ntvfs/posix/pvfs_aio.c b/source4/ntvfs/posix/pvfs_aio.c
deleted file mode 100644
index e2028d00172..00000000000
--- a/source4/ntvfs/posix/pvfs_aio.c
+++ /dev/null
@@ -1,166 +0,0 @@
-/* 
-   Unix SMB/CIFS implementation.
-
-   POSIX NTVFS backend - Linux AIO calls
-
-   Copyright (C) Andrew Tridgell 2006
-
-   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, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "includes.h"
-#include <tevent.h>
-#include "vfs_posix.h"
-#include "system/aio.h"
-
-struct pvfs_aio_read_state {
-	struct ntvfs_request *req;
-	union smb_read *rd;
-	struct pvfs_file *f;
-	struct tevent_aio *ae;
-};
-
-struct pvfs_aio_write_state {
-	struct ntvfs_request *req;
-	union smb_write *wr;
-	struct pvfs_file *f;
-	struct tevent_aio *ae;
-};
-
-/*
-  called when an aio read has finished
-*/
-static void pvfs_aio_read_handler(struct tevent_context *ev, struct tevent_aio *ae,
-			     int ret, void *private_data)
-{
-	struct pvfs_aio_read_state *state = talloc_get_type(private_data,
-							    struct pvfs_aio_read_state);
-	struct pvfs_file *f = state->f;
-	union smb_read *rd = state->rd;
-
-	if (ret < 0) {
-		/* errno is -ret on error */
-		state->req->async_states->status = pvfs_map_errno(f->pvfs, -ret);
-		state->req->async_states->send_fn(state->req);
-		return;
-	}
-
-	f->handle->position = f->handle->seek_offset = rd->readx.in.offset + ret;
-
-	rd->readx.out.nread = ret;
-	rd->readx.out.remaining = 0xFFFF;
-	rd->readx.out.compaction_mode = 0; 
-
-	talloc_steal(ev, state->ae);
-
-	state->req->async_states->status = NT_STATUS_OK;
-	state->req->async_states->send_fn(state->req);
-}
-
-
-/*
-  read from a file
-*/
-NTSTATUS pvfs_aio_pread(struct ntvfs_request *req, union smb_read *rd,
-			struct pvfs_file *f, uint32_t maxcnt)
-{
-	struct iocb iocb;
-	struct pvfs_aio_read_state *state;
-
-	state = talloc(req, struct pvfs_aio_read_state);
-	NT_STATUS_HAVE_NO_MEMORY(state);
-
-        io_prep_pread(&iocb, f->handle->fd, rd->readx.out.data,
-		      maxcnt, rd->readx.in.offset);
-	state->ae = tevent_add_aio(req->ctx->event_ctx, req->ctx->event_ctx, &iocb,
-				   pvfs_aio_read_handler, state);
-	if (state->ae == NULL) {
-		DEBUG(0,("Failed tevent_add_aio\n"));
-		talloc_free(state);
-		return NT_STATUS_NOT_IMPLEMENTED;
-	}
-
-	state->req  = req;
-	state->rd   = rd;
-	state->f    = f;
-
-	req->async_states->state |= NTVFS_ASYNC_STATE_ASYNC;
-
-	return NT_STATUS_OK;
-}
-
-
-
-
-/*
-  called when an aio write has finished
-*/
-static void pvfs_aio_write_handler(struct tevent_context *ev, struct tevent_aio *ae,
-			     int ret, void *private_data)
-{
-	struct pvfs_aio_write_state *state = talloc_get_type(private_data,
-							    struct pvfs_aio_write_state);
-	struct pvfs_file *f = state->f;
-	union smb_write *wr = state->wr;
-
-	if (ret < 0) {
-		/* errno is -ret on error */
-		state->req->async_states->status = pvfs_map_errno(f->pvfs, -ret);
-		state->req->async_states->send_fn(state->req);
-		return;
-	}
-
-	f->handle->seek_offset = wr->writex.in.offset + ret;
-
-	wr->writex.out.nwritten = ret;
-	wr->writex.out.remaining = 0;
-
-	talloc_steal(ev, state->ae);
-
-	state->req->async_states->status = NT_STATUS_OK;
-	state->req->async_states->send_fn(state->req);
-}
-
-
-/*
-  write to a file
-*/
-NTSTATUS pvfs_aio_pwrite(struct ntvfs_request *req, union smb_write *wr,
-			 struct pvfs_file *f)
-{
-	struct iocb iocb;
-	struct pvfs_aio_write_state *state;
-
-	state = talloc(req, struct pvfs_aio_write_state);
-	NT_STATUS_HAVE_NO_MEMORY(state);
-
-	io_prep_pwrite(&iocb, f->handle->fd, discard_const(wr->writex.in.data),
-		       wr->writex.in.count, wr->writex.in.offset);
-	state->ae = tevent_add_aio(req->ctx->event_ctx, req->ctx->event_ctx, &iocb,
-				   pvfs_aio_write_handler, state);
-	if (state->ae == NULL) {
-		DEBUG(0,("Failed tevent_add_aio\n"));
-		talloc_free(state);
-		return NT_STATUS_NOT_IMPLEMENTED;
-	}
-
-	state->req  = req;
-	state->wr   = wr;
-	state->f    = f;
-
-	req->async_states->state |= NTVFS_ASYNC_STATE_ASYNC;
-
-	return NT_STATUS_OK;
-}
-
diff --git a/source4/ntvfs/posix/pvfs_read.c b/source4/ntvfs/posix/pvfs_read.c
index 23cbe458ed6..09eedd570f3 100644
--- a/source4/ntvfs/posix/pvfs_read.c
+++ b/source4/ntvfs/posix/pvfs_read.c
@@ -76,16 +76,6 @@ 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 {
-#ifdef 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,
diff --git a/source4/ntvfs/posix/pvfs_write.c b/source4/ntvfs/posix/pvfs_write.c
index e4725ec579f..97733255e29 100644
--- a/source4/ntvfs/posix/pvfs_write.c
+++ b/source4/ntvfs/posix/pvfs_write.c
@@ -124,16 +124,6 @@ NTSTATUS pvfs_write(struct ntvfs_module_context *ntvfs,
 					wr->writex.in.count,
 					wr->writex.in.offset);
 	} else {
-#ifdef 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,
diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c
index c69e979c31c..9f131581762 100644
--- a/source4/ntvfs/posix/vfs_posix.c
+++ b/source4/ntvfs/posix/vfs_posix.c
@@ -58,8 +58,6 @@ static void pvfs_setup_options(struct pvfs_state *pvfs)
 		pvfs->flags |= PVFS_FLAG_CI_FILESYSTEM;
 	if (share_bool_option(scfg, PVFS_FAKE_OPLOCKS, PVFS_FAKE_OPLOCKS_DEFAULT))
 		pvfs->flags |= PVFS_FLAG_FAKE_OPLOCKS;
-	if (share_bool_option(scfg, PVFS_AIO, false))
-		pvfs->flags |= PVFS_FLAG_LINUX_AIO;
 
 #if defined(O_DIRECTORY) && defined(O_NOFOLLOW)
 	/* set PVFS_PERM_OVERRIDE by default only if the system
diff --git a/source4/ntvfs/posix/vfs_posix.h b/source4/ntvfs/posix/vfs_posix.h
index 04d78f29189..3dbd785b9b8 100644
--- a/source4/ntvfs/posix/vfs_posix.h
+++ b/source4/ntvfs/posix/vfs_posix.h
@@ -245,7 +245,6 @@ struct pvfs_search_state {
 #define PVFS_FLAG_STRICT_LOCKING (1<<6)
 #define PVFS_FLAG_XATTR_ENABLE   (1<<7)
 #define PVFS_FLAG_FAKE_OPLOCKS   (1<<8)
-#define PVFS_FLAG_LINUX_AIO      (1<<9)
 #define PVFS_FLAG_PERM_OVERRIDE  (1<<10)
 
 /* forward declare some anonymous structures */
@@ -268,7 +267,6 @@ struct pvfs_odb_retry;
 #define PVFS_ALLOCATION_ROUNDING	"posix:allocationrounding"
 #define PVFS_SEARCH_INACTIVITY		"posix:searchinactivity"
 #define PVFS_ACL			"posix:acl"
-#define PVFS_AIO			"posix:aio"
 #define PVFS_PERM_OVERRIDE		"posix:permission override"
 
 #define PVFS_XATTR_DEFAULT			true
@@ -289,9 +287,4 @@ struct pvfs_acl_ops {
 #include "ntvfs/posix/vfs_posix_proto.h"
 #include "ntvfs/posix/vfs_acl_proto.h"
 
-NTSTATUS pvfs_aio_pread(struct ntvfs_request *req, union smb_read *rd,
-			struct pvfs_file *f, uint32_t maxcnt);
-NTSTATUS pvfs_aio_pwrite(struct ntvfs_request *req, union smb_write *wr,
-			 struct pvfs_file *f);
-
 #endif /* _VFS_POSIX_H_ */
diff --git a/source4/ntvfs/posix/wscript_build b/source4/ntvfs/posix/wscript_build
index 96c6b35441b..649dea68adf 100644
--- a/source4/ntvfs/posix/wscript_build
+++ b/source4/ntvfs/posix/wscript_build
@@ -24,19 +24,12 @@ if bld.CONFIG_SET('WITH_NTVFS_FILESERVER'):
     )
 
 
-    bld.SAMBA_SUBSYSTEM('pvfs_aio',
-	                source='pvfs_aio.c',
-	                deps='tevent',
-                    enabled=False
-    )
-
-
     bld.SAMBA_MODULE('ntvfs_posix',
 	             source='vfs_posix.c pvfs_util.c pvfs_search.c pvfs_dirlist.c pvfs_fileinfo.c pvfs_unlink.c pvfs_mkdir.c pvfs_open.c pvfs_read.c pvfs_flush.c pvfs_write.c pvfs_fsinfo.c pvfs_qfileinfo.c pvfs_setfileinfo.c pvfs_rename.c pvfs_resolve.c pvfs_shortname.c pvfs_lock.c pvfs_oplock.c pvfs_wait.c pvfs_seek.c pvfs_ioctl.c pvfs_xattr.c pvfs_streams.c pvfs_notify.c pvfs_sys.c xattr_system.c',
 	             autoproto='vfs_posix_proto.h',
 	             subsystem='ntvfs',
 	            init_function='ntvfs_posix_init',
-	             deps='NDR_XATTR attr ntvfs_common MESSAGING LIBWBCLIENT_OLD pvfs_acl pvfs_aio posix_eadb',
+	             deps='NDR_XATTR attr ntvfs_common MESSAGING LIBWBCLIENT_OLD pvfs_acl posix_eadb',
 	             internal_module=True
     )
 


-- 
Samba Shared Repository



More information about the samba-cvs mailing list