Fixed aio_read/write/suspend for AIX w/o _AIO_AIX_SOURCE
This commit was SVN r5255.
Этот коммит содержится в:
родитель
7a0c7a24cb
Коммит
3a27c53d19
@ -200,13 +200,21 @@ int error_code, this_errno;
|
|||||||
aiocbp->aio_nbytes = len;
|
aiocbp->aio_nbytes = len;
|
||||||
if (wr) {
|
if (wr) {
|
||||||
ADIOI_WRITE_LOCK(fd, offset, SEEK_SET, len);
|
ADIOI_WRITE_LOCK(fd, offset, SEEK_SET, len);
|
||||||
|
#if !defined(_AIO_AIX_SOURCE) && !defined(_NO_PROTO)
|
||||||
|
err = aio_write(aiocbp);
|
||||||
|
#else
|
||||||
err = aio_write(fd_sys, aiocbp);
|
err = aio_write(fd_sys, aiocbp);
|
||||||
|
#endif
|
||||||
this_errno = errno;
|
this_errno = errno;
|
||||||
ADIOI_UNLOCK(fd, offset, SEEK_SET, len);
|
ADIOI_UNLOCK(fd, offset, SEEK_SET, len);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ADIOI_READ_LOCK(fd, offset, SEEK_SET, len);
|
ADIOI_READ_LOCK(fd, offset, SEEK_SET, len);
|
||||||
|
#if !defined(_AIO_AIX_SOURCE) && !defined(_NO_PROTO)
|
||||||
|
err = aio_read(aiocbp);
|
||||||
|
#else
|
||||||
err = aio_read(fd_sys, aiocbp);
|
err = aio_read(fd_sys, aiocbp);
|
||||||
|
#endif
|
||||||
this_errno = errno;
|
this_errno = errno;
|
||||||
ADIOI_UNLOCK(fd, offset, SEEK_SET, len);
|
ADIOI_UNLOCK(fd, offset, SEEK_SET, len);
|
||||||
}
|
}
|
||||||
@ -219,13 +227,21 @@ int error_code, this_errno;
|
|||||||
ADIOI_Complete_async(&error_code);
|
ADIOI_Complete_async(&error_code);
|
||||||
if (wr) {
|
if (wr) {
|
||||||
ADIOI_WRITE_LOCK(fd, offset, SEEK_SET, len);
|
ADIOI_WRITE_LOCK(fd, offset, SEEK_SET, len);
|
||||||
|
#if !defined(_AIO_AIX_SOURCE) && !defined(_NO_PROTO)
|
||||||
|
err = aio_write(aiocbp);
|
||||||
|
#else
|
||||||
err = aio_write(fd_sys, aiocbp);
|
err = aio_write(fd_sys, aiocbp);
|
||||||
|
#endif
|
||||||
this_errno = errno;
|
this_errno = errno;
|
||||||
ADIOI_UNLOCK(fd, offset, SEEK_SET, len);
|
ADIOI_UNLOCK(fd, offset, SEEK_SET, len);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ADIOI_READ_LOCK(fd, offset, SEEK_SET, len);
|
ADIOI_READ_LOCK(fd, offset, SEEK_SET, len);
|
||||||
|
#if !defined(_AIO_AIX_SOURCE) && !defined(_NO_PROTO)
|
||||||
|
err = aio_read(aiocbp);
|
||||||
|
#else
|
||||||
err = aio_read(fd_sys, aiocbp);
|
err = aio_read(fd_sys, aiocbp);
|
||||||
|
#endif
|
||||||
this_errno = errno;
|
this_errno = errno;
|
||||||
ADIOI_UNLOCK(fd, offset, SEEK_SET, len);
|
ADIOI_UNLOCK(fd, offset, SEEK_SET, len);
|
||||||
}
|
}
|
||||||
@ -236,13 +252,21 @@ int error_code, this_errno;
|
|||||||
sleep(1);
|
sleep(1);
|
||||||
if (wr) {
|
if (wr) {
|
||||||
ADIOI_WRITE_LOCK(fd, offset, SEEK_SET, len);
|
ADIOI_WRITE_LOCK(fd, offset, SEEK_SET, len);
|
||||||
|
#if !defined(_AIO_AIX_SOURCE) && !defined(_NO_PROTO)
|
||||||
|
err = aio_write(aiocbp);
|
||||||
|
#else
|
||||||
err = aio_write(fd_sys, aiocbp);
|
err = aio_write(fd_sys, aiocbp);
|
||||||
|
#endif
|
||||||
this_errno = errno;
|
this_errno = errno;
|
||||||
ADIOI_UNLOCK(fd, offset, SEEK_SET, len);
|
ADIOI_UNLOCK(fd, offset, SEEK_SET, len);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ADIOI_READ_LOCK(fd, offset, SEEK_SET, len);
|
ADIOI_READ_LOCK(fd, offset, SEEK_SET, len);
|
||||||
|
#if !defined(_AIO_AIX_SOURCE) && !defined(_NO_PROTO)
|
||||||
|
err = aio_read(aiocbp);
|
||||||
|
#else
|
||||||
err = aio_read(fd_sys, aiocbp);
|
err = aio_read(fd_sys, aiocbp);
|
||||||
|
#endif
|
||||||
this_errno = errno;
|
this_errno = errno;
|
||||||
ADIOI_UNLOCK(fd, offset, SEEK_SET, len);
|
ADIOI_UNLOCK(fd, offset, SEEK_SET, len);
|
||||||
}
|
}
|
||||||
|
@ -69,7 +69,11 @@ void ADIOI_NFS_ReadComplete(ADIO_Request *request, ADIO_Status *status, int *err
|
|||||||
/* IBM */
|
/* IBM */
|
||||||
if ((*request)->queued) {
|
if ((*request)->queued) {
|
||||||
do {
|
do {
|
||||||
|
#if !defined(_AIO_AIX_SOURCE) && !defined(_NO_PROTO)
|
||||||
|
err = aio_suspend((*request)->handle,1,NULL);
|
||||||
|
#else
|
||||||
err = aio_suspend(1, (struct aiocb **) &((*request)->handle));
|
err = aio_suspend(1, (struct aiocb **) &((*request)->handle));
|
||||||
|
#endif
|
||||||
} while ((err == -1) && (errno == EINTR));
|
} while ((err == -1) && (errno == EINTR));
|
||||||
|
|
||||||
tmp1 = (struct aiocb *) (*request)->handle;
|
tmp1 = (struct aiocb *) (*request)->handle;
|
||||||
|
@ -169,8 +169,13 @@ int ADIOI_UFS_aio(ADIO_File fd, void *buf, int len, ADIO_Offset offset,
|
|||||||
aiocbp->aio_offset = offset;
|
aiocbp->aio_offset = offset;
|
||||||
aiocbp->aio_buf = buf;
|
aiocbp->aio_buf = buf;
|
||||||
aiocbp->aio_nbytes = len;
|
aiocbp->aio_nbytes = len;
|
||||||
|
#if !defined(_AIO_AIX_SOURCE) && !defined(_NO_PROTO)
|
||||||
|
if (wr) err = aio_write(aiocbp);
|
||||||
|
else err = aio_read(aiocbp);
|
||||||
|
#else
|
||||||
if (wr) err = aio_write(fd_sys, aiocbp);
|
if (wr) err = aio_write(fd_sys, aiocbp);
|
||||||
else err = aio_read(fd_sys, aiocbp);
|
else err = aio_read(fd_sys, aiocbp);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (err == -1) {
|
if (err == -1) {
|
||||||
if (errno == EAGAIN) {
|
if (errno == EAGAIN) {
|
||||||
@ -178,15 +183,25 @@ int ADIOI_UFS_aio(ADIO_File fd, void *buf, int len, ADIO_Offset offset,
|
|||||||
complete all previous async. requests and try again. */
|
complete all previous async. requests and try again. */
|
||||||
|
|
||||||
ADIOI_Complete_async(&error_code);
|
ADIOI_Complete_async(&error_code);
|
||||||
|
#if !defined(_AIO_AIX_SOURCE) && !defined(_NO_PROTO)
|
||||||
|
if (wr) err = aio_write(aiocbp);
|
||||||
|
else err = aio_read(aiocbp);
|
||||||
|
#else
|
||||||
if (wr) err = aio_write(fd_sys, aiocbp);
|
if (wr) err = aio_write(fd_sys, aiocbp);
|
||||||
else err = aio_read(fd_sys, aiocbp);
|
else err = aio_read(fd_sys, aiocbp);
|
||||||
|
#endif
|
||||||
|
|
||||||
while (err == -1) {
|
while (err == -1) {
|
||||||
if (errno == EAGAIN) {
|
if (errno == EAGAIN) {
|
||||||
/* sleep and try again */
|
/* sleep and try again */
|
||||||
sleep(1);
|
sleep(1);
|
||||||
|
#if !defined(_AIO_AIX_SOURCE) && !defined(_NO_PROTO)
|
||||||
|
if (wr) err = aio_write(aiocbp);
|
||||||
|
else err = aio_read(aiocbp);
|
||||||
|
#else
|
||||||
if (wr) err = aio_write(fd_sys, aiocbp);
|
if (wr) err = aio_write(fd_sys, aiocbp);
|
||||||
else err = aio_read(fd_sys, aiocbp);
|
else err = aio_read(fd_sys, aiocbp);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
FPRINTF(stderr, "Unknown errno %d in ADIOI_UFS_aio\n", errno);
|
FPRINTF(stderr, "Unknown errno %d in ADIOI_UFS_aio\n", errno);
|
||||||
|
@ -69,7 +69,11 @@ void ADIOI_UFS_ReadComplete(ADIO_Request *request, ADIO_Status *status, int *err
|
|||||||
/* IBM */
|
/* IBM */
|
||||||
if ((*request)->queued) {
|
if ((*request)->queued) {
|
||||||
do {
|
do {
|
||||||
|
#if !defined(_AIO_AIX_SOURCE) && !defined(_NO_PROTO)
|
||||||
|
err = aio_suspend((*request)->handle,1,NULL);
|
||||||
|
#else
|
||||||
err = aio_suspend(1, (struct aiocb **) &((*request)->handle));
|
err = aio_suspend(1, (struct aiocb **) &((*request)->handle));
|
||||||
|
#endif
|
||||||
} while ((err == -1) && (errno == EINTR));
|
} while ((err == -1) && (errno == EINTR));
|
||||||
|
|
||||||
tmp1 = (struct aiocb *) (*request)->handle;
|
tmp1 = (struct aiocb *) (*request)->handle;
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user