X-Git-Url: https://git.kernel.dk/?a=blobdiff_plain;f=backend.c;h=1c1f2f9a1e603c084160165eb6596945de344d7a;hb=a0cb220bbb28c68fab0b175d01dcfce38a6f835c;hp=fc647098d5792e5e4aaf5e366ffcb363e01921ca;hpb=248c94366c4e5806d7356b50e39438b4ac32f8b8;p=fio.git diff --git a/backend.c b/backend.c index fc647098..1c1f2f9a 100644 --- a/backend.c +++ b/backend.c @@ -1261,6 +1261,10 @@ static int init_io_u(struct thread_data *td) return 0; } +/* + * This function is Linux specific. + * FIO_HAVE_IOSCHED_SWITCH enabled currently means it's Linux. + */ static int switch_ioscheduler(struct thread_data *td) { #ifdef FIO_HAVE_IOSCHED_SWITCH @@ -1271,7 +1275,8 @@ static int switch_ioscheduler(struct thread_data *td) if (td_ioengine_flagged(td, FIO_DISKLESSIO)) return 0; - sprintf(tmp, "%s/queue/scheduler", td->sysfs_root); + assert(td->files && td->files[0]); + sprintf(tmp, "%s/queue/scheduler", td->files[0]->du->sysfs_root); f = fopen(tmp, "r+"); if (!f) { @@ -1359,7 +1364,7 @@ static bool keep_running(struct thread_data *td) uint64_t diff; /* - * If the difference is less than the minimum IO size, we + * If the difference is less than the maximum IO size, we * are done. */ diff = limit - ddir_rw_sum(td->io_bytes);