kernel/vm: Change cache commitment at end of Resize().
If we change it at the top, then we shrink the commitment before we actually have released the relevant pages.
This commit is contained in:
@@ -1157,13 +1157,9 @@ VMCache::Resize(off_t newSize, int priority)
|
|||||||
{
|
{
|
||||||
TRACE(("VMCache::Resize(cache %p, newSize %" B_PRIdOFF ") old size %"
|
TRACE(("VMCache::Resize(cache %p, newSize %" B_PRIdOFF ") old size %"
|
||||||
B_PRIdOFF "\n", this, newSize, this->virtual_end));
|
B_PRIdOFF "\n", this, newSize, this->virtual_end));
|
||||||
this->AssertLocked();
|
|
||||||
|
|
||||||
T(Resize(this, newSize));
|
T(Resize(this, newSize));
|
||||||
|
|
||||||
status_t status = Commit(newSize - virtual_base, priority);
|
AssertLocked();
|
||||||
if (status != B_OK)
|
|
||||||
return status;
|
|
||||||
|
|
||||||
page_num_t oldPageCount = (page_num_t)((virtual_end + B_PAGE_SIZE - 1)
|
page_num_t oldPageCount = (page_num_t)((virtual_end + B_PAGE_SIZE - 1)
|
||||||
>> PAGE_SHIFT);
|
>> PAGE_SHIFT);
|
||||||
@@ -1177,6 +1173,10 @@ VMCache::Resize(off_t newSize, int priority)
|
|||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
status_t status = Commit(newSize - virtual_base, priority);
|
||||||
|
if (status != B_OK)
|
||||||
|
return status;
|
||||||
|
|
||||||
virtual_end = newSize;
|
virtual_end = newSize;
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user