diff options
author | alc <alc@FreeBSD.org> | 2001-12-09 08:16:36 +0000 |
---|---|---|
committer | alc <alc@FreeBSD.org> | 2001-12-09 08:16:36 +0000 |
commit | be4cbfd0296b742e019aae13b2d1be2267760cef (patch) | |
tree | f72032de93eaf5b1e5a34ef1b52217176410910f /sys/kern/vfs_aio.c | |
parent | 8687e8db79c8be6c92dca0aedaf053aa1a11ad31 (diff) | |
download | FreeBSD-src-be4cbfd0296b742e019aae13b2d1be2267760cef.zip FreeBSD-src-be4cbfd0296b742e019aae13b2d1be2267760cef.tar.gz |
o Eliminate unnecessary synchronization from filt_aiodetach().
o The manual page for kevent says that EVFILT_AIO returns under the same
conditions as aio_error(). With that in mind, set the data field
of the returned struct kevent to the value that would be returned
by aio_error().
o Fix two compilation warnings.
Diffstat (limited to 'sys/kern/vfs_aio.c')
-rw-r--r-- | sys/kern/vfs_aio.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/sys/kern/vfs_aio.c b/sys/kern/vfs_aio.c index f7e00f5..774c2f3 100644 --- a/sys/kern/vfs_aio.c +++ b/sys/kern/vfs_aio.c @@ -596,7 +596,7 @@ aio_process(struct aiocblist *aiocbe) return; } - aiov.iov_base = cb->aio_buf; + aiov.iov_base = (void *)(uintptr_t)cb->aio_buf; aiov.iov_len = cb->aio_nbytes; auio.uio_iov = &aiov; @@ -1035,7 +1035,7 @@ aio_qphysio(struct proc *p, struct aiocblist *aiocbe) bp->b_flags = B_PHYS; bp->b_iodone = aio_physwakeup; bp->b_saveaddr = bp->b_data; - bp->b_data = cb->aio_buf; + bp->b_data = (void *)(uintptr_t)cb->aio_buf; bp->b_blkno = btodb(cb->aio_offset); if (cb->aio_lio_opcode == LIO_WRITE) { @@ -2297,10 +2297,8 @@ static void filt_aiodetach(struct knote *kn) { struct aiocblist *aiocbe = (struct aiocblist *)kn->kn_id; - int s = splhigh(); /* XXX no clue, so overkill */ SLIST_REMOVE(&aiocbe->klist, kn, knote, kn_selnext); - splx(s); } /*ARGSUSED*/ @@ -2309,7 +2307,7 @@ filt_aio(struct knote *kn, long hint) { struct aiocblist *aiocbe = (struct aiocblist *)kn->kn_id; - kn->kn_data = 0; /* XXX data returned? */ + kn->kn_data = aiocbe->uaiocb._aiocb_private.error; if (aiocbe->jobstate != JOBST_JOBFINISHED && aiocbe->jobstate != JOBST_JOBBFINISHED) return (0); |