Commit 18c42123 authored by inaam's avatar inaam

branches/zip:

Clean up the POSIX_ASYNC_IO code which is currently not used and is unlikely to be ever used.
parent 979ccab9
...@@ -4492,8 +4492,6 @@ fil_aio_wait( ...@@ -4492,8 +4492,6 @@ fil_aio_wait(
#ifdef WIN_ASYNC_IO #ifdef WIN_ASYNC_IO
ret = os_aio_windows_handle(segment, 0, &fil_node, ret = os_aio_windows_handle(segment, 0, &fil_node,
&message, &type); &message, &type);
#elif defined(POSIX_ASYNC_IO)
ret = os_aio_posix_handle(segment, &fil_node, &message);
#else #else
ret = 0; /* Eliminate compiler warning */ ret = 0; /* Eliminate compiler warning */
ut_error; ut_error;
......
...@@ -663,24 +663,6 @@ os_aio_windows_handle( ...@@ -663,24 +663,6 @@ os_aio_windows_handle(
ulint* type); /* out: OS_FILE_WRITE or ..._READ */ ulint* type); /* out: OS_FILE_WRITE or ..._READ */
#endif #endif
/* Currently we do not use Posix async i/o */
#ifdef POSIX_ASYNC_IO
/**************************************************************************
This function is only used in Posix asynchronous i/o. Waits for an aio
operation to complete. */
UNIV_INTERN
ibool
os_aio_posix_handle(
/*================*/
/* out: TRUE if the aio operation succeeded */
ulint array_no, /* in: array number 0 - 3 */
fil_node_t**message1, /* out: the messages passed with the aio
request; note that also in the case where
the aio operation failed, these output
parameters are valid and can be used to
restart the operation, for example */
void** message2);
#endif
/************************************************************************** /**************************************************************************
Does simulated aio. This function should be called by an i/o-handler Does simulated aio. This function should be called by an i/o-handler
thread. */ thread. */
......
...@@ -22,12 +22,6 @@ Created 10/21/1995 Heikki Tuuri ...@@ -22,12 +22,6 @@ Created 10/21/1995 Heikki Tuuri
#include <errno.h> #include <errno.h>
#endif /* UNIV_HOTBACKUP */ #endif /* UNIV_HOTBACKUP */
#ifdef POSIX_ASYNC_IO
/* We assume in this case that the OS has standard Posix aio (at least SunOS
2.6, HP-UX 11i and AIX 4.3 have) */
#endif
/* This specifies the file permissions InnoDB uses when it creates files in /* This specifies the file permissions InnoDB uses when it creates files in
Unix; the value of os_innodb_umask is initialized in ha_innodb.cc to Unix; the value of os_innodb_umask is initialized in ha_innodb.cc to
my_umask */ my_umask */
...@@ -96,9 +90,6 @@ struct os_aio_slot_struct{ ...@@ -96,9 +90,6 @@ struct os_aio_slot_struct{
OVERLAPPED struct */ OVERLAPPED struct */
OVERLAPPED control; /* Windows control block for the OVERLAPPED control; /* Windows control block for the
aio request */ aio request */
#elif defined(POSIX_ASYNC_IO)
struct aiocb control; /* Posix control block for aio
request */
#endif #endif
}; };
...@@ -331,10 +322,6 @@ os_file_get_last_error( ...@@ -331,10 +322,6 @@ os_file_get_last_error(
if (err == ENOSPC) { if (err == ENOSPC) {
return(OS_FILE_DISK_FULL); return(OS_FILE_DISK_FULL);
#ifdef POSIX_ASYNC_IO
} else if (err == EAGAIN) {
return(OS_FILE_AIO_RESOURCES_RESERVED);
#endif
} else if (err == ENOENT) { } else if (err == ENOENT) {
return(OS_FILE_NOT_FOUND); return(OS_FILE_NOT_FOUND);
} else if (err == EEXIST) { } else if (err == EEXIST) {
...@@ -2921,9 +2908,7 @@ os_aio_init( ...@@ -2921,9 +2908,7 @@ os_aio_init(
ulint n_write_segs; ulint n_write_segs;
ulint n_per_seg; ulint n_per_seg;
ulint i; ulint i;
#ifdef POSIX_ASYNC_IO
sigset_t sigset;
#endif
ut_ad(n % n_segments == 0); ut_ad(n % n_segments == 0);
ut_ad(n_segments >= 4); ut_ad(n_segments >= 4);
...@@ -2975,23 +2960,7 @@ os_aio_init( ...@@ -2975,23 +2960,7 @@ os_aio_init(
os_last_printout = time(NULL); os_last_printout = time(NULL);
#ifdef POSIX_ASYNC_IO }
/* Block aio signals from the current thread and its children:
for this to work, the current thread must be the first created
in the database, so that all its children will inherit its
signal mask */
/* TODO: to work MySQL needs the SIGALARM signal; the following
will not work yet! */
sigemptyset(&sigset);
sigaddset(&sigset, SIGRTMIN + 1 + 0);
sigaddset(&sigset, SIGRTMIN + 1 + 1);
sigaddset(&sigset, SIGRTMIN + 1 + 2);
sigaddset(&sigset, SIGRTMIN + 1 + 3);
pthread_sigmask(SIG_BLOCK, &sigset, NULL); */
#endif
}
#ifdef WIN_ASYNC_IO #ifdef WIN_ASYNC_IO
/**************************************************************************** /****************************************************************************
...@@ -3125,7 +3094,7 @@ os_aio_get_array_and_local_segment( ...@@ -3125,7 +3094,7 @@ os_aio_get_array_and_local_segment(
Gets an integer value designating a specified aio array. This is used Gets an integer value designating a specified aio array. This is used
to give numbers to signals in Posix aio. */ to give numbers to signals in Posix aio. */
#if !defined(WIN_ASYNC_IO) && defined(POSIX_ASYNC_IO) #if !defined(WIN_ASYNC_IO)
static static
ulint ulint
os_aio_get_array_no( os_aio_get_array_no(
...@@ -3179,7 +3148,7 @@ os_aio_get_array_from_no( ...@@ -3179,7 +3148,7 @@ os_aio_get_array_from_no(
return(NULL); return(NULL);
} }
} }
#endif /* if !defined(WIN_ASYNC_IO) && defined(POSIX_ASYNC_IO) */ #endif /* if !defined(WIN_ASYNC_IO) */
/*********************************************************************** /***********************************************************************
Requests for a slot in the aio array. If no slot is available, waits until Requests for a slot in the aio array. If no slot is available, waits until
...@@ -3209,10 +3178,6 @@ os_aio_array_reserve_slot( ...@@ -3209,10 +3178,6 @@ os_aio_array_reserve_slot(
os_aio_slot_t* slot; os_aio_slot_t* slot;
#ifdef WIN_ASYNC_IO #ifdef WIN_ASYNC_IO
OVERLAPPED* control; OVERLAPPED* control;
#elif defined(POSIX_ASYNC_IO)
struct aiocb* control;
#endif #endif
ulint i; ulint i;
loop: loop:
...@@ -3269,30 +3234,8 @@ loop: ...@@ -3269,30 +3234,8 @@ loop:
control->Offset = (DWORD)offset; control->Offset = (DWORD)offset;
control->OffsetHigh = (DWORD)offset_high; control->OffsetHigh = (DWORD)offset_high;
os_event_reset(slot->event); os_event_reset(slot->event);
#elif defined(POSIX_ASYNC_IO)
#if (UNIV_WORD_SIZE == 8)
offset = offset + (offset_high << 32);
#else
ut_a(offset_high == 0);
#endif
control = &(slot->control);
control->aio_fildes = file;
control->aio_buf = buf;
control->aio_nbytes = len;
control->aio_offset = offset;
control->aio_reqprio = 0;
control->aio_sigevent.sigev_notify = SIGEV_SIGNAL;
control->aio_sigevent.sigev_signo
= SIGRTMIN + 1 + os_aio_get_array_no(array);
/* TODO: How to choose the signal numbers? */
/*
fprintf(stderr, "AIO signal number %lu\n",
(ulint) control->aio_sigevent.sigev_signo);
*/
control->aio_sigevent.sigev_value.sival_ptr = slot;
#endif #endif
os_mutex_exit(array->mutex); os_mutex_exit(array->mutex);
return(slot); return(slot);
...@@ -3540,10 +3483,6 @@ try_again: ...@@ -3540,10 +3483,6 @@ try_again:
ret = ReadFile(file, buf, (DWORD)n, &len, ret = ReadFile(file, buf, (DWORD)n, &len,
&(slot->control)); &(slot->control));
#elif defined(POSIX_ASYNC_IO)
slot->control.aio_lio_opcode = LIO_READ;
err = (ulint) aio_read(&(slot->control));
fprintf(stderr, "Starting POSIX aio read %lu\n", err);
#endif #endif
} else { } else {
if (!wake_later) { if (!wake_later) {
...@@ -3558,10 +3497,6 @@ try_again: ...@@ -3558,10 +3497,6 @@ try_again:
os_n_file_writes++; os_n_file_writes++;
ret = WriteFile(file, buf, (DWORD)n, &len, ret = WriteFile(file, buf, (DWORD)n, &len,
&(slot->control)); &(slot->control));
#elif defined(POSIX_ASYNC_IO)
slot->control.aio_lio_opcode = LIO_WRITE;
err = (ulint) aio_write(&(slot->control));
fprintf(stderr, "Starting POSIX aio write %lu\n", err);
#endif #endif
} else { } else {
if (!wake_later) { if (!wake_later) {
...@@ -3706,12 +3641,12 @@ os_aio_windows_handle( ...@@ -3706,12 +3641,12 @@ os_aio_windows_handle(
if (ret && len == slot->len) { if (ret && len == slot->len) {
ret_val = TRUE; ret_val = TRUE;
# ifdef UNIV_DO_FLUSH #ifdef UNIV_DO_FLUSH
if (slot->type == OS_FILE_WRITE if (slot->type == OS_FILE_WRITE
&& !os_do_not_call_flush_at_each_write) { && !os_do_not_call_flush_at_each_write) {
ut_a(TRUE == os_file_flush(slot->file)); ut_a(TRUE == os_file_flush(slot->file));
} }
# endif /* UNIV_DO_FLUSH */ #endif /* UNIV_DO_FLUSH */
} else { } else {
os_file_handle_error(slot->name, "Windows aio"); os_file_handle_error(slot->name, "Windows aio");
...@@ -3726,87 +3661,6 @@ os_aio_windows_handle( ...@@ -3726,87 +3661,6 @@ os_aio_windows_handle(
} }
#endif #endif
#ifdef POSIX_ASYNC_IO
/**************************************************************************
This function is only used in Posix asynchronous i/o. Waits for an aio
operation to complete. */
UNIV_INTERN
ibool
os_aio_posix_handle(
/*================*/
/* out: TRUE if the aio operation succeeded */
ulint array_no, /* in: array number 0 - 3 */
fil_node_t**message1, /* out: the messages passed with the aio
request; note that also in the case where
the aio operation failed, these output
parameters are valid and can be used to
restart the operation, for example */
void** message2)
{
os_aio_array_t* array;
os_aio_slot_t* slot;
siginfo_t info;
sigset_t sigset;
sigset_t proc_sigset;
sigset_t thr_sigset;
int ret;
int i;
int sig;
sigemptyset(&sigset);
sigaddset(&sigset, SIGRTMIN + 1 + array_no);
pthread_sigmask(SIG_UNBLOCK, &sigset, NULL);
#if 0
sigprocmask(0, NULL, &proc_sigset);
pthread_sigmask(0, NULL, &thr_sigset);
for (i = 32 ; i < 40; i++) {
fprintf(stderr, "%lu : %lu %lu\n", (ulint)i,
(ulint) sigismember(&proc_sigset, i),
(ulint) sigismember(&thr_sigset, i));
}
#endif
ret = sigwaitinfo(&sigset, &info);
if (sig != SIGRTMIN + 1 + array_no) {
ut_error;
return(FALSE);
}
fputs("Handling POSIX aio\n", stderr);
array = os_aio_get_array_from_no(array_no);
os_mutex_enter(array->mutex);
slot = info.si_value.sival_ptr;
ut_a(slot->reserved);
*message1 = slot->message1;
*message2 = slot->message2;
# ifdef UNIV_DO_FLUSH
if (slot->type == OS_FILE_WRITE
&& !os_do_not_call_flush_at_each_write) {
ut_a(TRUE == os_file_flush(slot->file));
}
# endif /* UNIV_DO_FLUSH */
os_mutex_exit(array->mutex);
os_aio_array_free_slot(array, slot);
return(TRUE);
}
#endif
/************************************************************************** /**************************************************************************
Does simulated aio. This function should be called by an i/o-handler Does simulated aio. This function should be called by an i/o-handler
thread. */ thread. */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment