From 7c4b7ecc4c3e45099205f75eb99ca536633ae4e0 Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Sun, 6 Aug 2006 01:00:09 +0000 Subject: [PATCH] Reduce the scope of the page queues lock in kern_sendfile() now that vm_page_sleep_if_busy() no longer requires the caller to hold the page queues lock. --- sys/kern/uipc_syscalls.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/kern/uipc_syscalls.c b/sys/kern/uipc_syscalls.c index 08cdd1b8a59..4ec0cf95ff8 100644 --- a/sys/kern/uipc_syscalls.c +++ b/sys/kern/uipc_syscalls.c @@ -2038,14 +2038,14 @@ retry_lookup: VM_OBJECT_LOCK(obj); goto retry_lookup; } - } else { - vm_page_lock_queues(); - if (vm_page_sleep_if_busy(pg, TRUE, "sfpbsy")) - goto retry_lookup; + } else if (vm_page_sleep_if_busy(pg, TRUE, "sfpbsy")) + goto retry_lookup; + else { /* * Wire the page so it does not get ripped out from * under us. */ + vm_page_lock_queues(); vm_page_wire(pg); vm_page_unlock_queues(); }