diff options
author | kib <kib@FreeBSD.org> | 2007-08-05 05:40:52 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2007-08-05 05:40:52 +0000 |
commit | 04fb5db6092ac6a9625c7abc4e39fd8a6bb1c66f (patch) | |
tree | 49f9d04508eec6cf79554568a145162b6719dfa2 /sys/vm/device_pager.c | |
parent | e37a2c24c62b18a1823ed73ed03f26d47c97b7d0 (diff) | |
download | FreeBSD-src-04fb5db6092ac6a9625c7abc4e39fd8a6bb1c66f.zip FreeBSD-src-04fb5db6092ac6a9625c7abc4e39fd8a6bb1c66f.tar.gz |
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)
Diffstat (limited to 'sys/vm/device_pager.c')
-rw-r--r-- | sys/vm/device_pager.c | 5 |
1 files changed, 0 insertions, 5 deletions
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) { |