Exemplo n.º 1
0
static void update_bufsize(ffsb_tg_t *tg)
{
	int i;
	uint32_t newmax = max(tg->read_blocksize, tg->write_blocksize);

	if (newmax == max(newmax, tg->thread_bufsize))
		for (i = 0; i < tg->num_threads ; i++)
			ft_alter_bufsize(tg->threads + i, newmax);
}
Exemplo n.º 2
0
void init_ffsb_thread(ffsb_thread_t *ft, struct ffsb_tg *tg, unsigned bufsize,
		      unsigned tg_num, unsigned thread_num)
{
	memset(ft, 0, sizeof(ffsb_thread_t));

	ft->tg = tg;
	ft->tg_num = tg_num;
	ft->thread_num = thread_num;

	if (bufsize)
		ft_alter_bufsize(ft, bufsize);

	init_random(&ft->rd, MAX_RANDBUF_SIZE);
}