aboutsummaryrefslogtreecommitdiff
path: root/sys/ufs
diff options
context:
space:
mode:
authorAlan Cox <alc@FreeBSD.org>2010-05-05 18:16:06 +0000
committerAlan Cox <alc@FreeBSD.org>2010-05-05 18:16:06 +0000
commit5ac59343be1105caac5ff4bbc4c20f94da925a7c (patch)
treeaed312c92f14a164a2e36963e81da2e8973206a2 /sys/ufs
parentb5f770bd8627d79822809f223a3ad5eab7bcadd6 (diff)
downloadsrc-5ac59343be1105caac5ff4bbc4c20f94da925a7c.tar.gz
src-5ac59343be1105caac5ff4bbc4c20f94da925a7c.zip
Acquire the page lock around all remaining calls to vm_page_free() on
managed pages that didn't already have that lock held. (Freeing an unmanaged page, such as the various pmaps use, doesn't require the page lock.) This allows a change in vm_page_remove()'s locking requirements. It now expects the page lock to be held instead of the page queues lock. Consequently, the page queues lock is no longer required at all by callers to vm_page_rename(). Discussed with: kib
Notes
Notes: svn path=/head/; revision=207669
Diffstat (limited to 'sys/ufs')
-rw-r--r--sys/ufs/ffs/ffs_vnops.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c
index 85f8ffd4d8a2..a2fee4ecb41f 100644
--- a/sys/ufs/ffs/ffs_vnops.c
+++ b/sys/ufs/ffs/ffs_vnops.c
@@ -847,13 +847,15 @@ ffs_getpages(ap)
if (mreq->valid) {
if (mreq->valid != VM_PAGE_BITS_ALL)
vm_page_zero_invalid(mreq, TRUE);
- vm_page_lock_queues();
for (i = 0; i < pcount; i++) {
if (i != ap->a_reqpage) {
+ vm_page_lock(ap->a_m[i]);
+ vm_page_lock_queues();
vm_page_free(ap->a_m[i]);
+ vm_page_unlock_queues();
+ vm_page_unlock(ap->a_m[i]);
}
}
- vm_page_unlock_queues();
VM_OBJECT_UNLOCK(mreq->object);
return VM_PAGER_OK;
}