version 1.5.14.1, 2012/08/01 08:51:00
|
version 1.5.14.2, 2012/08/01 09:37:20
|
Line 46 SUCH DAMAGE.
|
Line 46 SUCH DAMAGE.
|
#include "global.h" |
#include "global.h" |
|
|
|
|
|
/* default AIO completion request timeout */ |
|
struct timespec aiots = { 10, 0 }; |
|
|
|
|
/* |
/* |
* io_rread() - Raw VFS read function |
* io_rread() - Raw VFS read function |
* |
* |
Line 62 io_rread(int fd, void * __restrict buf, size_t nbytes,
|
Line 66 io_rread(int fd, void * __restrict buf, size_t nbytes,
|
int ret; |
int ret; |
#ifdef AIO_OPS |
#ifdef AIO_OPS |
off_t old = 0; |
off_t old = 0; |
struct aiocb acb; | struct aiocb acb, *racb; |
#endif |
#endif |
|
|
if (!buf) { |
if (!buf) { |
Line 102 io_rread(int fd, void * __restrict buf, size_t nbytes,
|
Line 106 io_rread(int fd, void * __restrict buf, size_t nbytes,
|
return -1; |
return -1; |
} |
} |
|
|
|
#if 0 |
while (aio_error(&acb) == EINPROGRESS); |
while (aio_error(&acb) == EINPROGRESS); |
ret = aio_return(&acb); |
ret = aio_return(&acb); |
|
#endif |
|
ret = aio_waitcomplete(&racb, &aiots); |
if (ret == -1) { |
if (ret == -1) { |
LOGERR; |
LOGERR; |
return -1; |
return -1; |
} /*else | } |
ret = acb.aio_nbytes;*/ | |
#else |
#else |
ret = pread(fd, buf, nbytes, offset); |
ret = pread(fd, buf, nbytes, offset); |
if (ret == -1) { |
if (ret == -1) { |
Line 138 io_rwrite(int fd, void * __restrict buf, size_t nbytes
|
Line 144 io_rwrite(int fd, void * __restrict buf, size_t nbytes
|
{ |
{ |
int ret; |
int ret; |
#ifdef AIO_OPS |
#ifdef AIO_OPS |
struct aiocb acb; | struct aiocb acb, *racb; |
#endif |
#endif |
|
|
if (!buf) { |
if (!buf) { |
Line 167 io_rwrite(int fd, void * __restrict buf, size_t nbytes
|
Line 173 io_rwrite(int fd, void * __restrict buf, size_t nbytes
|
return -1; |
return -1; |
} |
} |
|
|
|
#if 0 |
while (aio_error(&acb) == EINPROGRESS); |
while (aio_error(&acb) == EINPROGRESS); |
ret = aio_return(&acb); |
ret = aio_return(&acb); |
|
#endif |
|
ret = aio_waitcomplete(&racb, &aiots); |
if (ret == -1) { |
if (ret == -1) { |
LOGERR; |
LOGERR; |
return -1; |
return -1; |
} /*else | } |
ret = acb.aio_nbytes;*/ | |
#else |
#else |
ret = pwrite(fd, buf, nbytes, offset); |
ret = pwrite(fd, buf, nbytes, offset); |
if (ret == -1) { |
if (ret == -1) { |