diff options
Diffstat (limited to 'sys/kern/vfs_aio.c')
-rw-r--r-- | sys/kern/vfs_aio.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/sys/kern/vfs_aio.c b/sys/kern/vfs_aio.c index 7ae19d78b09a..8b4ee74d5f66 100644 --- a/sys/kern/vfs_aio.c +++ b/sys/kern/vfs_aio.c @@ -13,7 +13,7 @@ * bad that happens because of using this software isn't the responsibility * of the author. This software is distributed AS-IS. * - * $Id: vfs_aio.c,v 1.4 1997/09/02 20:06:00 bde Exp $ + * $Id: vfs_aio.c,v 1.5 1997/10/09 04:14:41 dyson Exp $ */ /* @@ -474,7 +474,12 @@ aio_startproc(void *uproc) TAILQ_INSERT_HEAD(&aio_freeproc, aiop, list); aiop->aioprocflags |= AIOP_FREE; } - tsleep(cp, PRIBIO, "aiordy", 0); + if (tsleep(cp, PRIBIO, "aiordy", hz*30)) { + if ((num_aio_procs > target_aio_procs) && + (TAILQ_FIRST(&aiop->jobtorun) == NULL)) + exit1(curproc, 0); + } + if (aiop->aioprocflags & AIOP_FREE) { TAILQ_REMOVE(&aio_freeproc, aiop, list); TAILQ_INSERT_TAIL(&aio_activeproc, aiop, list); @@ -658,6 +663,17 @@ _aio_aqueue(struct proc *p, struct aiocb *job, int type) { return EBADF; } +#if DEBUGAIO > 0 + if (debugaio > 3) + printf("aio_aqueue: fd: %d, cmd: %d, buf: %d, cnt: %d, fileoffset: %d\n", + aiocbe->uaiocb.aio_fildes, + aiocbe->uaiocb.aio_lio_opcode, + (int) aiocbe->uaiocb.aio_buf & 0xffffffff, + aiocbe->uaiocb.aio_nbytes, + (int) aiocbe->uaiocb.aio_offset & 0xffffffff); +#endif + + fp = fdp->fd_ofiles[fd]; if ((fp == NULL) || ((opcode == LIO_WRITE) && ((fp->f_flag & FWRITE) == 0))) { |