From fad44deea3b6e4a0ceb8a25ba411a220337d3f15 Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Tue, 10 Aug 2004 21:47:11 +0000 Subject: [PATCH] Eliminate the acquisition and release of Giant within physio(). Remove the spl calls. Reviewed by: phk@ Discussed with: scottl@ --- sys/kern/kern_physio.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/sys/kern/kern_physio.c b/sys/kern/kern_physio.c index c2c9b3f198b9..803995c0380b 100644 --- a/sys/kern/kern_physio.c +++ b/sys/kern/kern_physio.c @@ -36,13 +36,10 @@ physio(struct cdev *dev, struct uio *uio, int ioflag) { int i; int error; - int spl; caddr_t sa; u_int iolen; struct buf *bp; - /* We cannot trust the device driver to hold Giant for us */ - mtx_lock(&Giant); /* Keep the process UPAGES from being swapped. XXX: why ? */ PHOLD(curproc); @@ -99,12 +96,10 @@ physio(struct cdev *dev, struct uio *uio, int ioflag) } DEV_STRATEGY(bp); - spl = splbio(); if (uio->uio_rw == UIO_READ) bwait(bp, PRIBIO, "physrd"); else bwait(bp, PRIBIO, "physwr"); - splx(spl); if (uio->uio_segflg == UIO_USERSPACE) vunmapbuf(bp); @@ -125,6 +120,5 @@ physio(struct cdev *dev, struct uio *uio, int ioflag) doerror: relpbuf(bp, NULL); PRELE(curproc); - mtx_unlock(&Giant); return (error); }