* FlushAndRemoveAllPages() cannot call WriteModified(), as it must be called
with the VMCache lock held, and WriteModified() locks itself. * Added an assertion that the lock is held when calling that method. * This fixes a KDL as soon as you would have used O_NOCACHE with a file that had already some pages read in. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26864 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -796,14 +796,17 @@ VMCache::Resize(off_t newSize)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*! You have to call this function with the VMCache lock held. */
|
||||||
status_t
|
status_t
|
||||||
VMCache::FlushAndRemoveAllPages()
|
VMCache::FlushAndRemoveAllPages()
|
||||||
{
|
{
|
||||||
|
ASSERT_LOCKED_MUTEX(&fLock);
|
||||||
|
|
||||||
while (page_count > 0) {
|
while (page_count > 0) {
|
||||||
// write back modified pages
|
// write back modified pages
|
||||||
status_t error = WriteModified();
|
status_t status = vm_page_write_modified_pages(this);
|
||||||
if (error != B_OK)
|
if (status != B_OK)
|
||||||
return error;
|
return status;
|
||||||
|
|
||||||
// remove pages
|
// remove pages
|
||||||
for (VMCachePagesTree::Iterator it = pages.GetIterator();
|
for (VMCachePagesTree::Iterator it = pages.GetIterator();
|
||||||
|
|||||||
Reference in New Issue
Block a user