summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
authorattilio <attilio@FreeBSD.org>2013-02-20 10:38:34 +0000
committerattilio <attilio@FreeBSD.org>2013-02-20 10:38:34 +0000
commit658534ed5a02db4fef5b0630008502474d6c26d6 (patch)
tree567755b13eb4e24198cc8098e62ff4a975f8486c /sys/dev
parent5dce0c1384f698b3a27a82e72e3cbcf49b325404 (diff)
downloadFreeBSD-src-658534ed5a02db4fef5b0630008502474d6c26d6.zip
FreeBSD-src-658534ed5a02db4fef5b0630008502474d6c26d6.tar.gz
Switch vm_object lock to be a rwlock.
* VM_OBJECT_LOCK and VM_OBJECT_UNLOCK are mapped to write operations * VM_OBJECT_SLEEP() is introduced as a general purpose primitve to get a sleep operation using a VM_OBJECT_LOCK() as protection * The approach must bear with vm_pager.h namespace pollution so many files require including directly rwlock.h
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/agp/agp.c3
-rw-r--r--sys/dev/agp/agp_i810.c1
-rw-r--r--sys/dev/drm/drmP.h1
-rw-r--r--sys/dev/drm2/drmP.h1
-rw-r--r--sys/dev/drm2/i915/i915_gem.c2
-rw-r--r--sys/dev/hwpmc/hwpmc_mod.c1
-rw-r--r--sys/dev/md/md.c1
-rw-r--r--sys/dev/netmap/netmap.c1
-rw-r--r--sys/dev/sound/pcm/dsp.c2
9 files changed, 11 insertions, 2 deletions
diff --git a/sys/dev/agp/agp.c b/sys/dev/agp/agp.c
index 79b2d54..5284248 100644
--- a/sys/dev/agp/agp.c
+++ b/sys/dev/agp/agp.c
@@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$");
#include <sys/lock.h>
#include <sys/mutex.h>
#include <sys/proc.h>
+#include <sys/rwlock.h>
#include <dev/agp/agppriv.h>
#include <dev/agp/agpvar.h>
@@ -622,7 +623,7 @@ agp_generic_bind_memory(device_t dev, struct agp_memory *mem,
return 0;
bad:
mtx_unlock(&sc->as_lock);
- VM_OBJECT_LOCK_ASSERT(mem->am_obj, MA_OWNED);
+ VM_OBJECT_LOCK_ASSERT(mem->am_obj, RA_WLOCKED);
for (k = 0; k < mem->am_size; k += PAGE_SIZE) {
m = vm_page_lookup(mem->am_obj, OFF_TO_IDX(k));
if (k >= i)
diff --git a/sys/dev/agp/agp_i810.c b/sys/dev/agp/agp_i810.c
index 9ec3992..30c0dca 100644
--- a/sys/dev/agp/agp_i810.c
+++ b/sys/dev/agp/agp_i810.c
@@ -56,6 +56,7 @@ __FBSDID("$FreeBSD$");
#include <sys/lock.h>
#include <sys/mutex.h>
#include <sys/proc.h>
+#include <sys/rwlock.h>
#include <dev/agp/agppriv.h>
#include <dev/agp/agpreg.h>
diff --git a/sys/dev/drm/drmP.h b/sys/dev/drm/drmP.h
index ffb69b4..bf5feed 100644
--- a/sys/dev/drm/drmP.h
+++ b/sys/dev/drm/drmP.h
@@ -59,6 +59,7 @@ struct drm_file;
#include <sys/fcntl.h>
#include <sys/uio.h>
#include <sys/filio.h>
+#include <sys/rwlock.h>
#include <sys/sysctl.h>
#include <sys/bus.h>
#include <sys/queue.h>
diff --git a/sys/dev/drm2/drmP.h b/sys/dev/drm2/drmP.h
index 9b721a8..542844e 100644
--- a/sys/dev/drm2/drmP.h
+++ b/sys/dev/drm2/drmP.h
@@ -58,6 +58,7 @@ struct drm_file;
#include <sys/fcntl.h>
#include <sys/uio.h>
#include <sys/filio.h>
+#include <sys/rwlock.h>
#include <sys/selinfo.h>
#include <sys/sysctl.h>
#include <sys/bus.h>
diff --git a/sys/dev/drm2/i915/i915_gem.c b/sys/dev/drm2/i915/i915_gem.c
index 73c0b53..5ab6f63 100644
--- a/sys/dev/drm2/i915/i915_gem.c
+++ b/sys/dev/drm2/i915/i915_gem.c
@@ -2488,7 +2488,7 @@ i915_gem_wire_page(vm_object_t object, vm_pindex_t pindex)
vm_page_t m;
int rv;
- VM_OBJECT_LOCK_ASSERT(object, MA_OWNED);
+ VM_OBJECT_LOCK_ASSERT(object, RA_WLOCKED);
m = vm_page_grab(object, pindex, VM_ALLOC_NORMAL | VM_ALLOC_RETRY);
if (m->valid != VM_PAGE_BITS_ALL) {
if (vm_pager_has_page(object, pindex, NULL, NULL)) {
diff --git a/sys/dev/hwpmc/hwpmc_mod.c b/sys/dev/hwpmc/hwpmc_mod.c
index 2f2f05a..c2429a9 100644
--- a/sys/dev/hwpmc/hwpmc_mod.c
+++ b/sys/dev/hwpmc/hwpmc_mod.c
@@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$");
#include <sys/proc.h>
#include <sys/queue.h>
#include <sys/resourcevar.h>
+#include <sys/rwlock.h>
#include <sys/sched.h>
#include <sys/signalvar.h>
#include <sys/smp.h>
diff --git a/sys/dev/md/md.c b/sys/dev/md/md.c
index b72f294..294fdf6 100644
--- a/sys/dev/md/md.c
+++ b/sys/dev/md/md.c
@@ -75,6 +75,7 @@
#include <sys/namei.h>
#include <sys/proc.h>
#include <sys/queue.h>
+#include <sys/rwlock.h>
#include <sys/sbuf.h>
#include <sys/sched.h>
#include <sys/sf_buf.h>
diff --git a/sys/dev/netmap/netmap.c b/sys/dev/netmap/netmap.c
index 35d5303..4fec312 100644
--- a/sys/dev/netmap/netmap.c
+++ b/sys/dev/netmap/netmap.c
@@ -81,6 +81,7 @@ __FBSDID("$FreeBSD$");
#include <sys/mman.h> /* PROT_EXEC */
#include <sys/poll.h>
#include <sys/proc.h>
+#include <sys/rwlock.h>
#include <vm/vm.h> /* vtophys */
#include <vm/pmap.h> /* vtophys */
#include <sys/socket.h> /* sockaddrs */
diff --git a/sys/dev/sound/pcm/dsp.c b/sys/dev/sound/pcm/dsp.c
index 2cfc170..e52e46e 100644
--- a/sys/dev/sound/pcm/dsp.c
+++ b/sys/dev/sound/pcm/dsp.c
@@ -32,6 +32,8 @@
#include <dev/sound/pcm/sound.h>
#include <sys/ctype.h>
+#include <sys/lock.h>
+#include <sys/rwlock.h>
#include <sys/sysent.h>
#include <vm/vm.h>
OpenPOWER on IntegriCloud