buf->lba = lba;
buf->data = data;
+ buf->bc = bc;
return buf;
}
/* One more buffer in bcache now. :-) */
bc->ref_blocks++;
+ /*Calc ref blocks max depth*/
+ if (bc->max_ref_blocks < bc->ref_blocks)
+ bc->max_ref_blocks = bc->ref_blocks;
+
+
ext4_bcache_inc_ref(buf);
/* Assign new value to LRU id and increment LRU counter
* by 1*/
}
/* The buffer is invalidated...drop it. */
- if (!ext4_bcache_test_flag(buf, BC_UPTODATE))
+ if (!ext4_bcache_test_flag(buf, BC_UPTODATE) ||
+ ext4_bcache_test_flag(buf, BC_TMP))
ext4_bcache_drop_buf(bc, buf);
}