num_maps = (blocks + BLOCKS_PER_MAP - 1) /
(unsigned long long) BLOCKS_PER_MAP;
f->file_map = smalloc(num_maps * sizeof(long));
- if (!f->file_map) {
- log_err("fio: failed allocating random map. If running"
- " a large number of jobs, try the 'norandommap'"
- " option\n");
- return 1;
+ if (f->file_map) {
+ f->num_maps = num_maps;
+ continue;
}
- f->num_maps = num_maps;
+
+ log_info("fio: file %s failed allocating random map. Running "
+ "job without.\n", f->file_name);
+ f->num_maps = 0;
}
return 0;
#define td_write(td) ((td)->o.td_ddir & TD_DDIR_WRITE)
#define td_rw(td) (((td)->o.td_ddir & TD_DDIR_RW) == TD_DDIR_RW)
#define td_random(td) ((td)->o.td_ddir & TD_DDIR_RAND)
+#define file_randommap(td, f) (!(td)->o.norandommap && (f)->file_map)
static inline void fio_ro_check(struct thread_data *td, struct io_u *io_u)
{
/*
* if we are not maintaining a random map, we are done.
*/
- if (td->o.norandommap)
+ if (!file_randommap(td, f))
return 0;
/*
/*
* mark entry before potentially trimming io_u
*/
- if (td_random(td) && !td->o.norandommap)
+ if (td_random(td) && file_randommap(td, io_u->file))
mark_random_map(td, io_u);
/*