Ejemplo n.º 1
0
/*===========================================================================*
 *		            sef_cb_init_fresh                                *
 *===========================================================================*/
static int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info))
{
/* Initialize the Minix file server. */
  int i;

  /* Defaults */
  opt.use_orlov = TRUE;
  opt.mfsalloc = FALSE;
  opt.use_reserved_blocks = FALSE;
  opt.block_with_super = 0;
  opt.use_prealloc = FALSE;

  /* If we have been given an options string, parse options from there. */
  for (i = 1; i < env_argc - 1; i++)
	if (!strcmp(env_argv[i], "-o"))
		optset_parse(optset_table, env_argv[++i]);

  lmfs_may_use_vmcache(1);

  /* Init inode table */
  for (i = 0; i < NR_INODES; ++i) {
	inode[i].i_count = 0;
	cch[i] = 0;
  }

  init_inode_cache();

  SELF_E = getprocnr();

  /* just a small number before we find out the block size at mount time */
  lmfs_buf_pool(10);

  return(OK);
}
int
main(int argc, char *argv[])
{
	size_t newblocksize;
	int wss, cs, n = 0, p;

#define ITER 3
#define BLOCKS 200

	start(72);

	lmfs_setquiet(1);

	/* Can the cache handle differently sized blocks? */

	for(p = 1; p <= 3; p++) {
		/* Do not update curblocksize until the cache is flushed. */
		newblocksize = PAGE_SIZE*p;
		lmfs_set_blocksize(newblocksize);
		curblocksize = newblocksize;	/* now it's safe to update */
		lmfs_buf_pool(BLOCKS);
		if(dotest(curblocksize, BLOCKS, ITER)) e(n);
		n++;
	}
	
	/* Can the cache handle various combinations of the working set
	 * being larger and smaller than the cache?
	 */
	for(wss = 2; wss <= 3; wss++) {
		int wsblocks = 10*wss*wss*wss*wss*wss;
		for(cs = wsblocks/4; cs <= wsblocks*3; cs *= 1.5) {
			lmfs_set_blocksize(PAGE_SIZE);
			curblocksize = PAGE_SIZE;	/* same as above */
			lmfs_buf_pool(cs);
		        if(dotest(curblocksize, wsblocks, ITER)) e(n);
			n++;
		}
	}

	quit();

	return 0;
}
Ejemplo n.º 3
0
int
main(int argc, char *argv[])
{
	int wss, cs, n = 0, p;

#define ITER 3
#define BLOCKS 200

	start(72);

	lmfs_setquiet(1);

	/* Can the cache handle differently sized blocks? */

	for(p = 1; p <= 3; p++) {
		curblocksize = PAGE_SIZE*p;
		lmfs_set_blocksize(curblocksize, MYMAJOR);
		lmfs_buf_pool(BLOCKS);
		if(dotest(curblocksize, BLOCKS, ITER)) e(n);
		n++;
	}
	
	/* Can the cache handle various combinations of the working set
	 * being larger and smaller than the cache?
	 */
	for(wss = 2; wss <= 3; wss++) {
		int wsblocks = 10*wss*wss*wss*wss*wss;
		for(cs = wsblocks/4; cs <= wsblocks*3; cs *= 1.5) {
			curblocksize = PAGE_SIZE;
			lmfs_set_blocksize(curblocksize, MYMAJOR);
			lmfs_buf_pool(cs);
		        if(dotest(curblocksize, wsblocks, ITER)) e(n);
			n++;
		}
	}

	quit();

	return 0;
}
Ejemplo n.º 4
0
/*===========================================================================*
 *				cache_resize				     *
 *===========================================================================*/
static void cache_resize(unsigned int blocksize, unsigned int bufs)
{
  struct buf *bp;

  assert(blocksize > 0);
  assert(bufs >= MINBUFS);

  for (bp = &buf[0]; bp < &buf[nr_bufs]; bp++)
	if(bp->lmfs_count != 0) panic("change blocksize with buffer in use");

  lmfs_buf_pool(bufs);

  fs_block_size = blocksize;
}
Ejemplo n.º 5
0
Archivo: main.c Proyecto: Hooman3/minix
/*===========================================================================*
 *		            sef_cb_init_fresh                                *
 *===========================================================================*/
static int sef_cb_init_fresh(int UNUSED(type), sef_init_info_t *UNUSED(info))
{
/* Initialize the Minix file server. */
  int i;

  lmfs_may_use_vmcache(1);

  /* Init inode table */
  for (i = 0; i < NR_INODES; ++i) {
	inode[i].i_count = 0;
	cch[i] = 0;
  }
	
  init_inode_cache();

  lmfs_buf_pool(DEFAULT_NR_BUFS);

  return(OK);
}