1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

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@samba.org>
This commit is contained in:
Volker Lendecke 2012-07-16 12:44:42 +02:00 committed by Jeremy Allison
parent d948b1bfee
commit 4a9b5cce92
3 changed files with 31 additions and 30 deletions

View File

@ -5542,20 +5542,19 @@ int main() { struct aiocb a; return aio_suspend(&a, 1, NULL); }])],
fi fi
fi fi
if test x"$samba_cv_HAVE_AIO" = x"yes"; then if test x"$samba_cv_msghdr_msg_control" = x"yes" -o \
if test x"$samba_cv_msghdr_msg_control" = x"yes" -o \ x"$samba_cv_msghdr_msg_acctright" = x"yes"; then
x"$samba_cv_msghdr_msg_acctright" = x"yes"; then default_shared_modules="$default_shared_modules vfs_aio_fork"
default_shared_modules="$default_shared_modules vfs_aio_fork" fi
fi
# Check for Linux kernel aio support. # Check for Linux kernel aio support.
case "$host_os" in case "$host_os" in
*linux*) *linux*)
AC_CHECK_LIB(aio,io_submit,[AIO_LIBS="$LIBS -laio"]) 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,[ AC_CACHE_CHECK([for Linux kernel asynchronous io support],samba_cv_HAVE_LINUX_KERNEL_AIO,[
aio_LIBS=$LIBS aio_LIBS=$LIBS
LIBS=$AIO_LIBS LIBS=$AIO_LIBS
AC_TRY_LINK([#include <unistd.h> AC_TRY_LINK([#include <unistd.h>
#include <stdlib.h> #include <stdlib.h>
#include <sys/types.h> #include <sys/types.h>
#include <fcntl.h> #include <fcntl.h>
@ -5577,13 +5576,11 @@ io_submit(ctx, 1, &ioc);
io_getevents(ctx, 1, 1, &ioev, &ts);], io_getevents(ctx, 1, 1, &ioev, &ts);],
samba_cv_HAVE_LINUX_KERNEL_AIO=yes,samba_cv_HAVE_LINUX_KERNEL_AIO=no) samba_cv_HAVE_LINUX_KERNEL_AIO=yes,samba_cv_HAVE_LINUX_KERNEL_AIO=no)
LIBS=$aio_LIBS]) LIBS=$aio_LIBS])
if test x"$samba_cv_HAVE_LINUX_KERNEL_AIO" = x"yes"; then if test x"$samba_cv_HAVE_LINUX_KERNEL_AIO" = x"yes"; then
AC_DEFINE(HAVE_AIO, 1, [Using asynchronous io]) default_shared_modules="$default_shared_modules vfs_aio_linux"
default_shared_modules="$default_shared_modules vfs_aio_linux" fi
fi ;;
;; esac
esac
fi
if test x"$samba_cv_HAVE_AIO" = x"yes"; then if test x"$samba_cv_HAVE_AIO" = x"yes"; then
default_shared_modules="$default_shared_modules vfs_aio_posix" default_shared_modules="$default_shared_modules vfs_aio_posix"

View File

@ -27,6 +27,8 @@
#include "lib/async_req/async_sock.h" #include "lib/async_req/async_sock.h"
#include "lib/util/tevent_unix.h" #include "lib/util/tevent_unix.h"
#undef recvmsg
#ifndef MAP_FILE #ifndef MAP_FILE
#define MAP_FILE 0 #define MAP_FILE 0
#endif #endif

View File

@ -374,9 +374,14 @@ return acl_get_perm_np(permset_d, perm);
conf.CHECK_CODE('struct aiocb a; return aio_error(&a);', 'HAVE_AIO_ERROR', msg='Checking for aio_error', headers='aio.h', lib='aio rt') conf.CHECK_CODE('struct aiocb a; return aio_error(&a);', 'HAVE_AIO_ERROR', msg='Checking for aio_error', headers='aio.h', lib='aio rt')
conf.CHECK_CODE('struct aiocb a; return aio_cancel(1, &a);', 'HAVE_AIO_CANCEL', msg='Checking for aio_cancel', headers='aio.h', lib='aio rt') conf.CHECK_CODE('struct aiocb a; return aio_cancel(1, &a);', 'HAVE_AIO_CANCEL', msg='Checking for aio_cancel', headers='aio.h', lib='aio rt')
conf.CHECK_CODE('struct aiocb a; return aio_suspend(&a, 1, NULL);', 'HAVE_AIO_SUSPEND', msg='Checking for aio_suspend', headers='aio.h', lib='aio rt') conf.CHECK_CODE('struct aiocb a; return aio_suspend(&a, 1, NULL);', 'HAVE_AIO_SUSPEND', msg='Checking for aio_suspend', headers='aio.h', lib='aio rt')
if host_os.rfind('linux') > -1: if not conf.CONFIG_SET('HAVE_AIO'):
conf.CHECK_FUNCS_IN('io_submit', 'aio') conf.DEFINE('HAVE_NO_AIO', '1')
conf.CHECK_CODE(''' else:
conf.DEFINE('HAVE_NO_AIO', '1')
if host_os.rfind('linux') > -1:
conf.CHECK_FUNCS_IN('io_submit', 'aio')
conf.CHECK_CODE('''
struct io_event ioev; struct io_event ioev;
struct iocb *ioc; struct iocb *ioc;
io_context_t ctx; io_context_t ctx;
@ -397,11 +402,6 @@ io_getevents(ctx, 1, 1, &ioev, &ts);
headers='unistd.h stdlib.h sys/types.h fcntl.h sys/eventfd.h libaio.h', headers='unistd.h stdlib.h sys/types.h fcntl.h sys/eventfd.h libaio.h',
lib='aio') lib='aio')
if not conf.CONFIG_SET('HAVE_AIO'):
conf.DEFINE('HAVE_NO_AIO', '1')
else:
conf.DEFINE('HAVE_NO_AIO', '1')
conf.CHECK_CODE(''' conf.CHECK_CODE('''
struct msghdr msg; struct msghdr msg;
union { union {
@ -1463,14 +1463,16 @@ main() {
if conf.CONFIG_SET('HAVE_STATFS_F_FSID'): if conf.CONFIG_SET('HAVE_STATFS_F_FSID'):
default_shared_modules.extend(TO_LIST('vfs_fileid')) default_shared_modules.extend(TO_LIST('vfs_fileid'))
if conf.CONFIG_SET('HAVE_AIO') and (conf.CONFIG_SET('HAVE_MSGHDR_MSG_CONTROL') or conf.CONFIG_SET('HAVE_MSGHDR_MSG_ACCTRIGHTS')): if (conf.CONFIG_SET('HAVE_MSGHDR_MSG_CONTROL') or conf.CONFIG_SET('HAVE_MSGHDR_MSG_ACCTRIGHTS')):
default_shared_modules.extend(TO_LIST('vfs_aio_fork')) default_shared_modules.extend(TO_LIST('vfs_aio_fork'))
if conf.CONFIG_SET('HAVE_AIO') and Options.options.with_pthreadpool: if Options.options.with_pthreadpool:
default_shared_modules.extend(TO_LIST('vfs_aio_pthread')) default_shared_modules.extend(TO_LIST('vfs_aio_pthread'))
if conf.CONFIG_SET('HAVE_AIO'):
default_shared_modules.extend(TO_LIST('vfs_aio_posix')) default_shared_modules.extend(TO_LIST('vfs_aio_posix'))
if conf.CONFIG_SET('HAVE_AIO') and conf.CONFIG_SET('HAVE_LINUX_KERNEL_AIO'): if conf.CONFIG_SET('HAVE_LINUX_KERNEL_AIO'):
default_shared_modules.extend(TO_LIST('vfs_aio_linux')) default_shared_modules.extend(TO_LIST('vfs_aio_linux'))
if conf.CONFIG_SET('HAVE_LDAP'): if conf.CONFIG_SET('HAVE_LDAP'):