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
This commit is contained in:
parent
98b97f9603
commit
7faf279d73
5
src/system/kernel/cache/block_allocator.cpp
vendored
5
src/system/kernel/cache/block_allocator.cpp
vendored
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user