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:
parent
41e866f3ae
commit
37bd67edb8
7
src/system/kernel/cache/block_cache.cpp
vendored
7
src/system/kernel/cache/block_cache.cpp
vendored
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user