Signed-off-by: Jens Axboe <axboe@kernel.dk>
if (td_io_init(td))
goto err;
if (td_io_init(td))
goto err;
- if (init_random_map(td))
+ if (!init_random_map(td))
goto err;
if (o->exec_prerun && exec_string(o, o->exec_prerun, (const char *)"prerun"))
goto err;
if (o->exec_prerun && exec_string(o, o->exec_prerun, (const char *)"prerun"))
extern void unlock_file(struct thread_data *, struct fio_file *);
extern void unlock_file_all(struct thread_data *, struct fio_file *);
extern int add_dir_files(struct thread_data *, const char *);
extern void unlock_file(struct thread_data *, struct fio_file *);
extern void unlock_file_all(struct thread_data *, struct fio_file *);
extern int add_dir_files(struct thread_data *, const char *);
-extern int init_random_map(struct thread_data *);
+extern bool init_random_map(struct thread_data *);
extern void dup_files(struct thread_data *, struct thread_data *);
extern int get_fileno(struct thread_data *, const char *);
extern void free_release_files(struct thread_data *);
extern void dup_files(struct thread_data *, struct thread_data *);
extern int get_fileno(struct thread_data *, const char *);
extern void free_release_files(struct thread_data *);
gauss_init(&f->gauss, nranges, td->o.gauss_dev.u.f, seed);
}
gauss_init(&f->gauss, nranges, td->o.gauss_dev.u.f, seed);
}
-static int init_rand_distribution(struct thread_data *td)
+static bool init_rand_distribution(struct thread_data *td)
{
struct fio_file *f;
unsigned int i;
int state;
if (td->o.random_distribution == FIO_RAND_DIST_RANDOM)
{
struct fio_file *f;
unsigned int i;
int state;
if (td->o.random_distribution == FIO_RAND_DIST_RANDOM)
state = td_bump_runstate(td, TD_SETTING_UP);
state = td_bump_runstate(td, TD_SETTING_UP);
__init_rand_distribution(td, f);
td_restore_runstate(td, state);
__init_rand_distribution(td, f);
td_restore_runstate(td, state);
-int init_random_map(struct thread_data *td)
+bool init_random_map(struct thread_data *td)
{
unsigned long long blocks;
struct fio_file *f;
unsigned int i;
if (init_rand_distribution(td))
{
unsigned long long blocks;
struct fio_file *f;
unsigned int i;
if (init_rand_distribution(td))
for_each_file(td, f, i) {
uint64_t fsize = min(f->real_file_size, f->io_size);
for_each_file(td, f, i) {
uint64_t fsize = min(f->real_file_size, f->io_size);
blocks = fsize / (unsigned long long) td->o.rw_min_bs;
if (check_rand_gen_limits(td, f, blocks))
blocks = fsize / (unsigned long long) td->o.rw_min_bs;
if (check_rand_gen_limits(td, f, blocks))
if (td->o.random_generator == FIO_RAND_GEN_LFSR) {
unsigned long seed;
if (td->o.random_generator == FIO_RAND_GEN_LFSR) {
unsigned long seed;
" a large number of jobs, try the 'norandommap'"
" option or set 'softrandommap'. Or give"
" a larger --alloc-size to fio.\n");
" a large number of jobs, try the 'norandommap'"
" option or set 'softrandommap'. Or give"
" a larger --alloc-size to fio.\n");
}
log_info("fio: file %s failed allocating random map. Running "
"job without.\n", f->file_name);
}
}
log_info("fio: file %s failed allocating random map. Running "
"job without.\n", f->file_name);
}
}
void close_files(struct thread_data *td)
}
void close_files(struct thread_data *td)