diff options
author | attilio <attilio@FreeBSD.org> | 2013-02-20 10:38:34 +0000 |
---|---|---|
committer | attilio <attilio@FreeBSD.org> | 2013-02-20 10:38:34 +0000 |
commit | 658534ed5a02db4fef5b0630008502474d6c26d6 (patch) | |
tree | 567755b13eb4e24198cc8098e62ff4a975f8486c /sys/vm/sg_pager.c | |
parent | 5dce0c1384f698b3a27a82e72e3cbcf49b325404 (diff) | |
download | FreeBSD-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/vm/sg_pager.c')
-rw-r--r-- | sys/vm/sg_pager.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/vm/sg_pager.c b/sys/vm/sg_pager.c index 097039e..b78b032 100644 --- a/sys/vm/sg_pager.c +++ b/sys/vm/sg_pager.c @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include <sys/param.h> #include <sys/lock.h> #include <sys/mutex.h> +#include <sys/rwlock.h> #include <sys/sglist.h> #include <vm/vm.h> #include <vm/vm_param.h> @@ -142,7 +143,7 @@ sg_pager_getpages(vm_object_t object, vm_page_t *m, int count, int reqpage) size_t space; int i; - VM_OBJECT_LOCK_ASSERT(object, MA_OWNED); + VM_OBJECT_LOCK_ASSERT(object, RA_WLOCKED); sg = object->handle; memattr = object->memattr; VM_OBJECT_UNLOCK(object); |