From 04fb5db6092ac6a9625c7abc4e39fd8a6bb1c66f Mon Sep 17 00:00:00 2001 From: kib Date: Sun, 5 Aug 2007 05:40:52 +0000 Subject: Do not acquire Giant unconditionally around the calls to the cdevsw d_mmap methods. prep_cdevsw() already installs the shims that acquire/drop Giant for the methods of a driver that specified the D_NEEDGIANT flag. Reviewed by: alc Approved by: re (kensmith) --- sys/vm/device_pager.c | 5 ----- 1 file changed, 5 deletions(-) (limited to 'sys/vm/device_pager.c') diff --git a/sys/vm/device_pager.c b/sys/vm/device_pager.c index 740abd6..e9b9e73 100644 --- a/sys/vm/device_pager.c +++ b/sys/vm/device_pager.c @@ -126,7 +126,6 @@ dev_pager_alloc(void *handle, vm_ooffset_t size, vm_prot_t prot, vm_ooffset_t fo csw = dev_refthread(dev); if (csw == NULL) return (NULL); - mtx_lock(&Giant); /* * Check that the specified range of the device allows the desired @@ -137,7 +136,6 @@ dev_pager_alloc(void *handle, vm_ooffset_t size, vm_prot_t prot, vm_ooffset_t fo npages = OFF_TO_IDX(size); for (off = foff; npages--; off += PAGE_SIZE) if ((*csw->d_mmap)(dev, off, &paddr, (int)prot) != 0) { - mtx_unlock(&Giant); dev_relthread(dev); return (NULL); } @@ -171,7 +169,6 @@ dev_pager_alloc(void *handle, vm_ooffset_t size, vm_prot_t prot, vm_ooffset_t fo } sx_xunlock(&dev_pager_sx); - mtx_unlock(&Giant); dev_relthread(dev); return (object); } @@ -216,12 +213,10 @@ dev_pager_getpages(object, m, count, reqpage) csw = dev_refthread(dev); if (csw == NULL) panic("dev_pager_getpage: no cdevsw"); - mtx_lock(&Giant); prot = PROT_READ; /* XXX should pass in? */ ret = (*csw->d_mmap)(dev, (vm_offset_t)offset << PAGE_SHIFT, &paddr, prot); KASSERT(ret == 0, ("dev_pager_getpage: map function returns error")); - mtx_unlock(&Giant); dev_relthread(dev); if ((m[reqpage]->flags & PG_FICTITIOUS) != 0) { -- cgit v1.1