struct timeval s, e;
char *buf, *ptr;
unsigned long blocks, msec, usec;
- int max_depth = 0;
ptr = malloc(td->bs * td->aio_depth + MASK);
buf = ALIGN(ptr);
for (blocks = 0; blocks < td->blocks; blocks++) {
struct timespec ts = { .tv_sec = 0, .tv_nsec = 0};
struct timespec *timeout;
- struct iocb *iocb = aio_get_iocb(td, buf);
int ret, i, min_evts = 0;
+ struct iocb *iocb;
if (td->terminate)
break;
gettimeofday(&s, NULL);
+ iocb = aio_get_iocb(td, buf);
+
ret = io_submit(*td->aio_ctx, 1, &iocb);
if (ret < 0) {
td->error = errno;
}
td->aio_cur_depth++;
- if (td->aio_cur_depth > max_depth) {
- max_depth = td->aio_cur_depth;
- printf("max now %d\n", max_depth);
- }
if (td->aio_cur_depth < td->aio_depth) {
timeout = &ts;