summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_aio.c
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2000-09-26 06:35:22 +0000
committeralc <alc@FreeBSD.org>2000-09-26 06:35:22 +0000
commite062da3a801c9c3a9a0c917fe134dab7b62e6fc3 (patch)
tree32ae909ee4c3e6fd6b5d4d9ec3c09ecaa3cad008 /sys/kern/vfs_aio.c
parent2794635205d5ec974654b98f0e3bc7b3788cb9de (diff)
downloadFreeBSD-src-e062da3a801c9c3a9a0c917fe134dab7b62e6fc3.zip
FreeBSD-src-e062da3a801c9c3a9a0c917fe134dab7b62e6fc3.tar.gz
aio_qphysio: Eliminate one instance of an out-of-range check that is
performed twice. Eliminate initialization that is already performed by _aio_aqueue. aio_physwakeup: Eliminate redundant synchronization that is already performed by bufdone.
Diffstat (limited to 'sys/kern/vfs_aio.c')
-rw-r--r--sys/kern/vfs_aio.c21
1 files changed, 3 insertions, 18 deletions
diff --git a/sys/kern/vfs_aio.c b/sys/kern/vfs_aio.c
index 0299e1c..faf7c77 100644
--- a/sys/kern/vfs_aio.c
+++ b/sys/kern/vfs_aio.c
@@ -952,7 +952,7 @@ aio_qphysio(struct proc *p, struct aiocblist *aiocbe)
struct aio_liojob *lj;
int fd;
int s;
- int cnt, notify;
+ int notify;
cb = &aiocbe->uaiocb;
fdp = p->p_fd;
@@ -979,24 +979,13 @@ aio_qphysio(struct proc *p, struct aiocblist *aiocbe)
if (cb->aio_nbytes % vp->v_rdev->si_bsize_phys)
return (-1);
- if ((cb->aio_nbytes > MAXPHYS) && (num_buf_aio >= max_buf_aio))
+ if (cb->aio_nbytes > MAXPHYS)
return (-1);
ki = p->p_aioinfo;
if (ki->kaio_buffer_count >= ki->kaio_ballowed_count)
return (-1);
- cnt = cb->aio_nbytes;
- if (cnt > MAXPHYS)
- return (-1);
-
- /*
- * Physical I/O is charged directly to the process, so we don't have to
- * fake it.
- */
- aiocbe->inputcharge = 0;
- aiocbe->outputcharge = 0;
-
ki->kaio_buffer_count++;
lj = aiocbe->lio;
@@ -1203,7 +1192,7 @@ _aio_aqueue(struct proc *p, struct aiocb *job, struct aio_liojob *lj, int type)
unsigned int fd;
struct socket *so;
int s;
- int error = 0;
+ int error;
int opcode;
struct aiocblist *aiocbe;
struct aioproclist *aiop;
@@ -2201,11 +2190,8 @@ aio_physwakeup(struct buf *bp)
struct proc *p;
struct kaioinfo *ki;
struct aio_liojob *lj;
- int s;
- s = splbio();
wakeup((caddr_t)bp);
- bp->b_flags |= B_DONE;
aiocbe = (struct aiocblist *)bp->b_spc;
if (aiocbe) {
@@ -2258,7 +2244,6 @@ aio_physwakeup(struct buf *bp)
if (aiocbe->uaiocb.aio_sigevent.sigev_notify == SIGEV_SIGNAL)
timeout(process_signal, aiocbe, 0);
}
- splx(s);
}
#endif /* VFS_AIO */
OpenPOWER on IntegriCloud