Skip to content

Commit

Permalink
Removed the obsolete aio module.
Browse files Browse the repository at this point in the history
  • Loading branch information
mdocguard committed Apr 22, 2015
1 parent 39386c9 commit c1882d9
Show file tree
Hide file tree
Showing 20 changed files with 14 additions and 630 deletions.
2 changes: 0 additions & 2 deletions auto/options
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ EVENT_FOUND=NO
EVENT_RTSIG=NO
EVENT_SELECT=NO
EVENT_POLL=NO
EVENT_AIO=NO

USE_THREADS=NO

Expand Down Expand Up @@ -195,7 +194,6 @@ do
--without-select_module) EVENT_SELECT=NONE ;;
--with-poll_module) EVENT_POLL=YES ;;
--without-poll_module) EVENT_POLL=NONE ;;
--with-aio_module) EVENT_AIO=YES ;;

--with-threads) USE_THREADS=YES ;;

Expand Down
20 changes: 0 additions & 20 deletions auto/os/freebsd
Original file line number Diff line number Diff line change
Expand Up @@ -99,26 +99,6 @@ then
fi


if [ $EVENT_AIO = YES ]; then
if [ \( $version -lt 500000 -a $version -ge 430000 \) \
-o $version -ge 500014 ]
then
have=NGX_HAVE_AIO . auto/have
EVENT_MODULES="$EVENT_MODULES $AIO_MODULE"
CORE_SRCS="$CORE_SRCS $AIO_SRCS"
else

cat << END

$0: error: the kqueue does not support AIO on this FreeBSD version

END

exit 1
fi
fi


# cpuset_setaffinity()

if [ $version -ge 701000 ]; then
Expand Down
1 change: 0 additions & 1 deletion auto/os/win32
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,4 @@ if [ $NGX_IPV6 = YES ]; then
have=NGX_HAVE_INET6 . auto/have
fi

have=NGX_HAVE_AIO . auto/have
have=NGX_HAVE_IOCP . auto/have
7 changes: 0 additions & 7 deletions auto/sources
Original file line number Diff line number Diff line change
Expand Up @@ -130,13 +130,6 @@ RTSIG_SRCS=src/event/modules/ngx_rtsig_module.c
IOCP_MODULE=ngx_iocp_module
IOCP_SRCS=src/event/modules/ngx_iocp_module.c

AIO_MODULE=ngx_aio_module
AIO_SRCS="src/event/modules/ngx_aio_module.c \
src/os/unix/ngx_aio_read.c \
src/os/unix/ngx_aio_write.c \
src/os/unix/ngx_aio_read_chain.c \
src/os/unix/ngx_aio_write_chain.c"

FILE_AIO_SRCS="src/os/unix/ngx_file_aio_read.c"
LINUX_AIO_SRCS="src/os/unix/ngx_linux_aio_read.c"

Expand Down
2 changes: 1 addition & 1 deletion src/core/ngx_connection.c
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ ngx_open_listening_sockets(ngx_cycle_t *cycle)
#endif
/* TODO: close on exit */

if (!(ngx_event_flags & NGX_USE_AIO_EVENT)) {
if (!(ngx_event_flags & NGX_USE_IOCP_EVENT)) {
if (ngx_nonblocking(s) == -1) {
ngx_log_error(NGX_LOG_EMERG, log, ngx_socket_errno,
ngx_nonblocking_n " %V failed",
Expand Down
2 changes: 1 addition & 1 deletion src/core/ngx_resolver.c
Original file line number Diff line number Diff line change
Expand Up @@ -3092,7 +3092,7 @@ ngx_udp_connect(ngx_udp_connection_t *uc)

rc = connect(s, uc->sockaddr, uc->socklen);

/* TODO: aio, iocp */
/* TODO: iocp */

if (rc == -1) {
ngx_log_error(NGX_LOG_CRIT, &uc->log, ngx_socket_errno,
Expand Down
171 changes: 0 additions & 171 deletions src/event/modules/ngx_aio_module.c

This file was deleted.

2 changes: 1 addition & 1 deletion src/event/modules/ngx_iocp_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ ngx_iocp_init(ngx_cycle_t *cycle, ngx_msec_t timer)

ngx_event_actions = ngx_iocp_module_ctx.actions;

ngx_event_flags = NGX_USE_AIO_EVENT|NGX_USE_IOCP_EVENT;
ngx_event_flags = NGX_USE_IOCP_EVENT;

if (timer == 0) {
return NGX_OK;
Expand Down
4 changes: 2 additions & 2 deletions src/event/ngx_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ ngx_handle_read_event(ngx_event_t *rev, ngx_uint_t flags)
}
}

/* aio, iocp, rtsig */
/* iocp, rtsig */

return NGX_OK;
}
Expand Down Expand Up @@ -409,7 +409,7 @@ ngx_handle_write_event(ngx_event_t *wev, size_t lowat)
}
}

/* aio, iocp, rtsig */
/* iocp, rtsig */

return NGX_OK;
}
Expand Down
10 changes: 1 addition & 9 deletions src/event/ngx_event.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,8 @@ struct ngx_event_s {
ngx_event_handler_pt handler;


#if (NGX_HAVE_AIO)

#if (NGX_HAVE_IOCP)
ngx_event_ovlp_t ovlp;
#else
struct aiocb aiocb;
#endif

#endif

ngx_uint_t index;
Expand Down Expand Up @@ -251,14 +245,12 @@ extern ngx_event_actions_t ngx_event_actions;
#define NGX_USE_RTSIG_EVENT 0x00000080

/*
* No need to add or delete the event filters: overlapped, aio_read,
* aioread, io_submit.
* Obsolete.
*/
#define NGX_USE_AIO_EVENT 0x00000100

/*
* Need to add socket or handle only once: i/o completion port.
* It also requires NGX_HAVE_AIO and NGX_USE_AIO_EVENT to be set.
*/
#define NGX_USE_IOCP_EVENT 0x00000200

Expand Down
9 changes: 4 additions & 5 deletions src/event/ngx_event_accept.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,10 +176,10 @@ ngx_event_accept(ngx_event_t *ev)
return;
}

/* set a blocking mode for aio and non-blocking mode for others */
/* set a blocking mode for iocp and non-blocking mode for others */

if (ngx_inherited_nonblocking) {
if (ngx_event_flags & NGX_USE_AIO_EVENT) {
if (ngx_event_flags & NGX_USE_IOCP_EVENT) {
if (ngx_blocking(s) == -1) {
ngx_log_error(NGX_LOG_ALERT, ev->log, ngx_socket_errno,
ngx_blocking_n " failed");
Expand All @@ -189,7 +189,7 @@ ngx_event_accept(ngx_event_t *ev)
}

} else {
if (!(ngx_event_flags & (NGX_USE_AIO_EVENT|NGX_USE_RTSIG_EVENT))) {
if (!(ngx_event_flags & (NGX_USE_IOCP_EVENT|NGX_USE_RTSIG_EVENT))) {
if (ngx_nonblocking(s) == -1) {
ngx_log_error(NGX_LOG_ALERT, ev->log, ngx_socket_errno,
ngx_nonblocking_n " failed");
Expand Down Expand Up @@ -232,8 +232,7 @@ ngx_event_accept(ngx_event_t *ev)

wev->ready = 1;

if (ngx_event_flags & (NGX_USE_AIO_EVENT|NGX_USE_RTSIG_EVENT)) {
/* rtsig, aio, iocp */
if (ngx_event_flags & (NGX_USE_IOCP_EVENT|NGX_USE_RTSIG_EVENT)) {
rev->ready = 1;
}

Expand Down
4 changes: 1 addition & 3 deletions src/event/ngx_event_connect.c
Original file line number Diff line number Diff line change
Expand Up @@ -171,13 +171,11 @@ ngx_event_connect_peer(ngx_peer_connection_t *pc)
return NGX_OK;
}

if (ngx_event_flags & NGX_USE_AIO_EVENT) {
if (ngx_event_flags & NGX_USE_IOCP_EVENT) {

ngx_log_debug1(NGX_LOG_DEBUG_EVENT, pc->log, ngx_socket_errno,
"connect(): %d", rc);

/* aio, iocp */

if (ngx_blocking(s) == -1) {
ngx_log_error(NGX_LOG_ALERT, pc->log, ngx_socket_errno,
ngx_blocking_n " failed");
Expand Down
2 changes: 1 addition & 1 deletion src/http/ngx_http_request.c
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ ngx_http_init_connection(ngx_connection_t *c)
}

if (rev->ready) {
/* the deferred accept(), rtsig, aio, iocp */
/* the deferred accept(), rtsig, iocp */

if (ngx_use_accept_mutex) {
ngx_post_event(rev, &ngx_posted_events);
Expand Down
2 changes: 1 addition & 1 deletion src/http/ngx_http_upstream.c
Original file line number Diff line number Diff line change
Expand Up @@ -2911,7 +2911,7 @@ ngx_http_upstream_send_response(ngx_http_request_t *r, ngx_http_upstream_t *u)
p->buf_to_file->temporary = 1;
}

if (ngx_event_flags & NGX_USE_AIO_EVENT) {
if (ngx_event_flags & NGX_USE_IOCP_EVENT) {
/* the posted aio operation may corrupt a shadow buffer */
p->single_buf = 1;
}
Expand Down
Loading

0 comments on commit c1882d9

Please sign in to comment.