[block_cache] Be better about flushing dirty blocks on demand.
Dirty blocks could prevent a clean lock being given. Patch from mingus.
This commit is contained in:
parent
b9009b53b6
commit
2c6278ed4b
@ -319,14 +319,13 @@ block_cache::new_block(block_address index)
|
|||||||
block *b;
|
block *b;
|
||||||
|
|
||||||
b = __alloc_block();
|
b = __alloc_block();
|
||||||
if (!b) {
|
while (!b && nr_locked_ < nr_cache_blocks_) {
|
||||||
if (clean_.empty()) {
|
b = find_unused_clean_block();
|
||||||
|
if (!b) {
|
||||||
if (io_pending_.empty())
|
if (io_pending_.empty())
|
||||||
writeback(16);
|
writeback(16);
|
||||||
wait_io();
|
wait_io();
|
||||||
}
|
}
|
||||||
|
|
||||||
b = find_unused_clean_block();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (b) {
|
if (b) {
|
||||||
|
Loading…
Reference in New Issue
Block a user