Create the right cache type ([non-]swappable) on copy on write.
When forking a team, copy on write areas (and therefore caches) are created for all the areas in the parent team, but they were always created as swappable. If the parent team had some B_FULL_LOCK areas, which aren't swappable, the wrong type of cache would be created which lead to them not being mergeable later on (causing a panic). Comments about a possibly cleaner way to figure out the cache type would be welcome.
This commit is contained in:
@@ -55,6 +55,7 @@
|
||||
|
||||
#include "VMAddressSpaceLocking.h"
|
||||
#include "VMAnonymousCache.h"
|
||||
#include "VMAnonymousNoSwapCache.h"
|
||||
#include "IORequest.h"
|
||||
|
||||
|
||||
@@ -2300,7 +2301,8 @@ vm_copy_on_write_area(VMCache* lowerCache,
|
||||
|
||||
// create an anonymous cache
|
||||
status_t status = VMCacheFactory::CreateAnonymousCache(upperCache, false, 0,
|
||||
0, true, VM_PRIORITY_USER);
|
||||
0, dynamic_cast<VMAnonymousNoSwapCache*>(lowerCache) == NULL,
|
||||
VM_PRIORITY_USER);
|
||||
if (status != B_OK)
|
||||
return status;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user