Now also flushes dirty blocks correctly (cannot happen if transactions are used,

ie. never happens with BFS).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15562 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2005-12-16 13:53:34 +00:00
parent 41e866f3ae
commit 37bd67edb8

View File

@ -54,7 +54,8 @@ struct cache_transaction {
bool has_sub_transaction;
};
static status_t write_cached_block(block_cache *cache, cached_block *block, bool deleteTransaction = true);
static status_t write_cached_block(block_cache *cache, cached_block *block,
bool deleteTransaction = true);
// #pragma mark - private transaction
@ -329,6 +330,10 @@ block_cache::RemoveUnusedBlocks(int32 maxAccessed, int32 count)
dprintf(" remove block %Ld, accessed %ld times\n",
block->block_number, block->accessed);
// this can only happen if no transactions are used
if (block->is_dirty)
write_cached_block(this, block, false);
// remove block from lists
unused_blocks.Remove(block);
hash_remove(hash, block);