Commit 9580b5f2 authored by marko's avatar marko

branches/zip: buf_read_ahead_random(): Stop searching upon exceeding the

threshold.
parent 8332c45c
......@@ -236,21 +236,24 @@ buf_read_ahead_random(
block = buf_page_hash_get(space, i);
if ((block)
&& (block->LRU_position > LRU_recent_limit)
&& block->accessed) {
&& block->accessed
&& (block->LRU_position > LRU_recent_limit)) {
recent_blocks++;
if (recent_blocks >= BUF_READ_AHEAD_RANDOM_THRESHOLD) {
mutex_exit(&buf_pool->mutex);
goto read_ahead;
}
}
}
mutex_exit(&(buf_pool->mutex));
if (recent_blocks < BUF_READ_AHEAD_RANDOM_THRESHOLD) {
/* Do nothing */
return(0);
}
read_ahead:
/* Read all the suitable blocks within the area */
if (ibuf_inside()) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment