diff options
author | alc <alc@FreeBSD.org> | 2004-12-26 21:46:44 +0000 |
---|---|---|
committer | alc <alc@FreeBSD.org> | 2004-12-26 21:46:44 +0000 |
commit | 5c1258faf6ef5b7306425ab62169de09e3d15f6f (patch) | |
tree | e521b506a08eb182b1f0ba5ffe9cf553febb32d2 | |
parent | 9df64a1b0d507fcf1b4559c171c586be25f29a43 (diff) | |
download | FreeBSD-src-5c1258faf6ef5b7306425ab62169de09e3d15f6f.zip FreeBSD-src-5c1258faf6ef5b7306425ab62169de09e3d15f6f.tar.gz |
Assert that the vm object is locked on entry to vm_page_sleep_if_busy();
remove some unneeded code.
-rw-r--r-- | sys/vm/vm_page.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c index 3b880c9..68688ad 100644 --- a/sys/vm/vm_page.c +++ b/sys/vm/vm_page.c @@ -424,9 +424,9 @@ int vm_page_sleep_if_busy(vm_page_t m, int also_m_busy, const char *msg) { vm_object_t object; - int is_object_locked; mtx_assert(&vm_page_queue_mtx, MA_OWNED); + VM_OBJECT_LOCK_ASSERT(m->object, MA_OWNED); if ((m->flags & PG_BUSY) || (also_m_busy && m->busy)) { vm_page_flag_set(m, PG_WANTED | PG_REFERENCED); /* @@ -435,16 +435,11 @@ vm_page_sleep_if_busy(vm_page_t m, int also_m_busy, const char *msg) * lock, we will assume we hold a reference to the object * such that even if m->object changes, we can re-lock * it. - * - * Remove mtx_owned() after vm_object locking is finished. */ object = m->object; - if ((is_object_locked = object != NULL && - mtx_owned(&object->mtx))) - mtx_unlock(&object->mtx); + VM_OBJECT_UNLOCK(object); msleep(m, &vm_page_queue_mtx, PDROP | PVM, msg, 0); - if (is_object_locked) - mtx_lock(&object->mtx); + VM_OBJECT_LOCK(object); return (TRUE); } return (FALSE); |