X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=libfio.c;h=3fde492c91af727f6d96abf39c308d3ca4b657c7;hp=8eddab80b345651f11533038963bb03e5bc0ff93;hb=046395d7ab181288d14737c1d0041e98328f473f;hpb=a2879fea33ee8c701da766e2def867f7fb2d052e diff --git a/libfio.c b/libfio.c index 8eddab80..3fde492c 100644 --- a/libfio.c +++ b/libfio.c @@ -31,6 +31,7 @@ #include "fio.h" #include "smalloc.h" #include "os/os.h" +#include "filelock.h" /* * Just expose an empty list, if the OS does not support disk util stats @@ -217,6 +218,21 @@ void fio_terminate_threads(int group_id) } } +int fio_running_or_pending_io_threads(void) +{ + struct thread_data *td; + int i; + + for_each_td(td, i) { + if (td->flags & TD_F_NOIO) + continue; + if (td->runstate < TD_EXITED) + return 1; + } + + return 0; +} + static int endian_check(void) { union { @@ -265,6 +281,11 @@ int initialize_fio(char *envp[]) sinit(); + if (fio_filelock_init()) { + log_err("fio: failed initializing filelock subsys\n"); + return 1; + } + /* * We need locale for number printing, if it isn't set then just * go with the US format.