Browse Source

ext4_bcache: add max cache depth watermark

pull/11/head
gkostka 9 years ago
parent
commit
dcbc722c72
  1. 6
      fs_test/common/test_lwext4.c
  2. 5
      lwext4/ext4_bcache.c

6
fs_test/common/test_lwext4.c

@ -130,9 +130,9 @@ void test_lwext4_block_stats(void)
printf("bdev->bread_ctr = %" PRIu32 "\n", bd->bdif->bread_ctr);
printf("bdev->bwrite_ctr = %" PRIu32 "\n", bd->bdif->bwrite_ctr);
printf("bcache->ref_blocks = %" PRIu32 "\n", bc->ref_blocks);
printf("bcache->max_ref_blocks = %" PRIu32 "\n", bc->max_ref_blocks);
printf("bcache->lru_ctr = %" PRIu32 "\n", bc->lru_ctr);
printf("bcache->ref_blocks = %" PRIu32 "\n", bd->bc->ref_blocks);
printf("bcache->max_ref_blocks = %" PRIu32 "\n", bd->bc->max_ref_blocks);
printf("bcache->lru_ctr = %" PRIu32 "\n", bd->bc->lru_ctr);
printf("\n");

5
lwext4/ext4_bcache.c

@ -239,6 +239,11 @@ int ext4_bcache_alloc(struct ext4_bcache *bc, struct ext4_block *b,
/* 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*/

Loading…
Cancel
Save