X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=io_u.c;h=92b707647cc17bf40805f6b7055a675374bf8b0b;hp=74c3295b8f1157ee6e9d9cb6d45076bad8082259;hb=2577594dd6e2857d9efbf6bd81cd7ef507dbcd64;hpb=6162f5249479e4be69bcd0c0bf09d1c09ea99523 diff --git a/io_u.c b/io_u.c index 74c3295b..92b70764 100644 --- a/io_u.c +++ b/io_u.c @@ -146,7 +146,7 @@ static int get_next_rand_offset(struct thread_data *td, struct fio_file *f, r = os_random_long(&td->random_state); dprint(FD_RANDOM, "off rand %llu\n", r); *b = (last_block(td, f, ddir) - 1) - * (r / ((unsigned long long) RAND_MAX + 1.0)); + * (r / ((unsigned long long) OS_RAND_MAX + 1.0)); /* * if we are not maintaining a random map, we are done. @@ -171,7 +171,8 @@ static int get_next_rand_offset(struct thread_data *td, struct fio_file *f, */ loops = 10; do { - f->last_free_lookup = (f->num_maps - 1) * (r / (RAND_MAX+1.0)); + f->last_free_lookup = (f->num_maps - 1) * + (r / (OS_RAND_MAX + 1.0)); if (!get_next_free_block(td, f, ddir, b)) return 0; @@ -240,7 +241,7 @@ static unsigned int get_next_buflen(struct thread_data *td, struct io_u *io_u) if (!td->o.bssplit_nr) { buflen = (unsigned int) (1 + (double) (td->o.max_bs[ddir] - 1) - * r / (RAND_MAX + 1.0)); + * r / (OS_RAND_MAX + 1.0)); } else { long perc = 0; unsigned int i; @@ -288,7 +289,7 @@ static inline enum fio_ddir get_rand_ddir(struct thread_data *td) long r; r = os_random_long(&td->rwmix_state); - v = 1 + (int) (100.0 * (r / (RAND_MAX + 1.0))); + v = 1 + (int) (100.0 * (r / (OS_RAND_MAX + 1.0))); if (v <= td->o.rwmix[DDIR_READ]) return DDIR_READ; @@ -620,7 +621,7 @@ static struct fio_file *get_next_file_rand(struct thread_data *td, int goodf, long r = os_random_long(&td->next_file_state); fno = (unsigned int) ((double) td->o.nr_files - * (r / (RAND_MAX + 1.0))); + * (r / (OS_RAND_MAX + 1.0))); f = td->files[fno]; if (f->flags & FIO_FILE_DONE) continue; @@ -970,19 +971,19 @@ long io_u_sync_complete(struct thread_data *td, struct io_u *io_u) /* * Called to complete min_events number of io for the async engines. */ -long io_u_queued_complete(struct thread_data *td, int min_events) +long io_u_queued_complete(struct thread_data *td, int min_evts) { struct io_completion_data icd; struct timespec *tvp = NULL; int ret; struct timespec ts = { .tv_sec = 0, .tv_nsec = 0, }; - dprint(FD_IO, "io_u_queued_completed: min=%d\n", min_events); + dprint(FD_IO, "io_u_queued_completed: min=%d\n", min_evts); - if (!min_events) + if (!min_evts) tvp = &ts; - ret = td_io_getevents(td, min_events, td->cur_depth, tvp); + ret = td_io_getevents(td, min_evts, td->o.iodepth_batch_complete, tvp); if (ret < 0) { td_verror(td, -ret, "td_io_getevents"); return ret;