Exemplo n.º 1
0
/*===========================================================================*
 *				bufs_heuristic				     *
 *===========================================================================*/
static int bufs_heuristic(struct super_block *sp)
{
  u32_t btotal, bfree;

  btotal = sp->s_blocks_count;
  bfree = sp->s_free_blocks_count;
  return fs_bufs_heuristic(MINBUFS, btotal, bfree,
  	sp->s_block_size, major(sp->s_dev));
}
static void cache_heuristic_check(void)
{
  int bufs, d;

  bufs = fs_bufs_heuristic(MINBUFS, fs_btotal, fs_bused, fs_block_size);

  /* set the cache to the new heuristic size if the new one
   * is more than 10% off from the current one.
   */
  d = bufs-nr_bufs;
  if(d < 0) d = -d;
  if(d*100/nr_bufs > 10) {
	cache_resize(fs_block_size, bufs);
  }
}
Exemplo n.º 3
0
static void cache_heuristic_check(int major)
{
  int bufs, d;
  u64_t btotal, bfree, bused;

  fs_blockstats(&btotal, &bfree, &bused);

  bufs = fs_bufs_heuristic(10, btotal, bfree,
        fs_block_size, major);

  /* set the cache to the new heuristic size if the new one
   * is more than 10% off from the current one.
   */
  d = bufs-nr_bufs;
  if(d < 0) d = -d;
  if(d*100/nr_bufs > 10) {
	cache_resize(fs_block_size, bufs);
  }
}