You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by zw...@apache.org on 2013/04/15 23:20:02 UTC
[33/50] git commit: TS-1760: clean up and fix
--enable-linux-native-aio
TS-1760: clean up and fix --enable-linux-native-aio
Tidy the --enable-linux-native-aio to conform with autoconf
conventions. Use the correct TS_USE_LINUX_NATIVE_AIO macro to enable
Linux AIO support.
Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/12c478a2
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/12c478a2
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/12c478a2
Branch: refs/heads/3.3.x
Commit: 12c478a2a71faf8bc70ea52469532c2947fde922
Parents: a34fb91
Author: James Peach <jp...@apache.org>
Authored: Wed Apr 3 09:59:42 2013 -0700
Committer: James Peach <jp...@apache.org>
Committed: Wed Apr 3 10:01:43 2013 -0700
----------------------------------------------------------------------
configure.ac | 29 ++++++++++++++++-------------
iocore/aio/I_AIO.h | 3 ++-
2 files changed, 18 insertions(+), 14 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/12c478a2/configure.ac
----------------------------------------------------------------------
diff --git a/configure.ac b/configure.ac
index dbf1679..f237ebe 100644
--- a/configure.ac
+++ b/configure.ac
@@ -397,25 +397,28 @@ TS_ARG_ENABLE_VAR([use], [reclaimable_freelist])
AC_SUBST(use_reclaimable_freelist)
#
-# If the OS is linux, we can use '--use_linux_native_aio' option to
+# If the OS is linux, we can use the '--enable-linux-native-aio' option to
# replace the aio thread mode. Effective only on the linux system.
#
-if test "x${host_os_def}" = "xlinux"; then
- AC_MSG_CHECKING([whether to use native aio or not])
- AC_ARG_ENABLE([linux_native_aio],
- [AS_HELP_STRING([--enable-linux-native-aio],
- [turn on linux native aio, only effective on linux system])],
- [],
- [enable_linux_native_aio="yes"])
- AC_MSG_RESULT([$enable_linux_native_aio])
-else
- enable_linux_native_aio="no"
-fi
+AC_MSG_CHECKING([whether to enable Linux native AIO])
+AC_ARG_ENABLE([linux-native-aio],
+ [AS_HELP_STRING([--enable-linux-native-aio], [enable native Linux AIO support @<:@default=no@:>@])],
+ [enable_linux_native_aio="${enableval}"],
+ [enable_linux_native_aio=no]
+)
+
+case $host_os in
+ linux*);;
+ *) AS_IF([test "x$enable_linux_native_aio" = "xyes"], [
+ AC_MSG_ERROR([Linux native AIO can only be enabled on Linux systems])
+ ])
+esac
+
+AC_MSG_RESULT([$enable_linux_native_aio])
TS_ARG_ENABLE_VAR([use], [linux_native_aio])
AC_SUBST(use_linux_native_aio)
-
# Configure how many stats to allocate for plugins. Default is 512.
#
AC_ARG_WITH([max-api-stats],
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/12c478a2/iocore/aio/I_AIO.h
----------------------------------------------------------------------
diff --git a/iocore/aio/I_AIO.h b/iocore/aio/I_AIO.h
index ccdc078..ef49d93 100644
--- a/iocore/aio/I_AIO.h
+++ b/iocore/aio/I_AIO.h
@@ -47,7 +47,8 @@
#define AIO_MODE_SYNC 1
#define AIO_MODE_THREAD 2
#define AIO_MODE_NATIVE 3
-#if use_linux_native_aio
+
+#if TS_USE_LINUX_NATIVE_AIO
#define AIO_MODE AIO_MODE_NATIVE
#else
#define AIO_MODE AIO_MODE_THREAD