From 7faf279d732a293fd16b3b926843fbc171b29ad7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Mon, 8 Oct 2007 08:25:47 +0000 Subject: [PATCH] The block allocator needs to reserve pages, too, when it maps pages. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22482 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/kernel/cache/block_allocator.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/system/kernel/cache/block_allocator.cpp b/src/system/kernel/cache/block_allocator.cpp index c98e1306c1..c25a7f080a 100644 --- a/src/system/kernel/cache/block_allocator.cpp +++ b/src/system/kernel/cache/block_allocator.cpp @@ -363,6 +363,10 @@ block_range::Allocate(block_cache *cache, block_chunk **_chunk) vm_address_space *addressSpace = vm_kernel_address_space(); vm_translation_map *map = &addressSpace->translation_map; + size_t reservePages = map->ops->map_max_pages_need(map, + 0, numPages * B_PAGE_SIZE); + + vm_page_reserve_pages(reservePages); map->ops->lock(map); for (uint32 i = 0; i < numPages; i++) { @@ -372,6 +376,7 @@ block_range::Allocate(block_cache *cache, block_chunk **_chunk) } map->ops->unlock(map); + vm_page_unreserve_pages(reservePages); chunks[chunk].mapped = true; }