--- libaitsched/src/hooks.c 2012/08/02 09:36:38 1.10.2.7 +++ libaitsched/src/hooks.c 2012/08/02 12:08:45 1.10.2.8 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: hooks.c,v 1.10.2.7 2012/08/02 09:36:38 misho Exp $ +* $Id: hooks.c,v 1.10.2.8 2012/08/02 12:08:45 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -462,6 +462,7 @@ sched_hook_fetch(void *root, void *arg __unused) register int j; off_t off; struct aiocb **acbs; + struct iovec *iv; #endif /* EVFILT_LIO */ #endif /* EVFILT_AIO */ @@ -812,11 +813,14 @@ sched_hook_fetch(void *root, void *arg __unused) #ifdef EVFILT_LIO if (res[i].filter == EVFILT_LIO) { acbs = (struct aiocb**) TASK_VAL(task); + iv = (struct iovec*) TASK_DATA(task); fd = acbs[0]->aio_fildes; off = acbs[0]->aio_offset; for (j = len = 0; i < TASK_DATLEN(task); len += l, i++) { - if ((l = aio_return(acbs[i])) == -1) + if ((iv[i].iov_len = aio_return(acbs[i])) == -1) l = 0; + else + l = iv[i].iov_len; free(acbs[i]); } free(acbs);