X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=fio.h;h=51b8fdc7cff7e51f12ed083b0338a3625c36380c;hp=b9a21782c7611c0756448c5fbf0a9e6c5382fa01;hb=dc54a01f9a2966133f6d1a52f3718d267117b4f3;hpb=983a0680c14922cfcd66715cf8fc15b8f54f77ae diff --git a/fio.h b/fio.h index b9a21782..51b8fdc7 100644 --- a/fio.h +++ b/fio.h @@ -44,7 +44,7 @@ #include "io_u_queue.h" #include "workqueue.h" #include "steadystate.h" -#include "nowarn_snprintf.h" +#include "lib/nowarn_snprintf.h" #ifdef CONFIG_SOLARISAIO #include @@ -533,7 +533,8 @@ extern bool eta_time_within_slack(unsigned int time); static inline void fio_ro_check(const struct thread_data *td, struct io_u *io_u) { - assert(!(io_u->ddir == DDIR_WRITE && !td_write(td))); + assert(!(io_u->ddir == DDIR_WRITE && !td_write(td)) && + !(io_u->ddir == DDIR_TRIM && !td_trim(td))); } #define REAL_MAX_JOBS 4096 @@ -567,6 +568,7 @@ extern void fio_fill_default_options(struct thread_data *); extern int fio_show_option_help(const char *); extern void fio_options_set_ioengine_opts(struct option *long_options, struct thread_data *td); extern void fio_options_dup_and_init(struct option *); +extern char *fio_option_dup_subs(const char *); extern void fio_options_mem_dupe(struct thread_data *); extern void td_fill_rand_seeds(struct thread_data *); extern void td_fill_verify_state_seed(struct thread_data *); @@ -721,22 +723,17 @@ static inline bool option_check_rate(struct thread_data *td, enum fio_ddir ddir) return false; } -static inline bool __should_check_rate(struct thread_data *td, - enum fio_ddir ddir) +static inline bool __should_check_rate(struct thread_data *td) { return (td->flags & TD_F_CHECK_RATE) != 0; } static inline bool should_check_rate(struct thread_data *td) { - if (__should_check_rate(td, DDIR_READ) && td->bytes_done[DDIR_READ]) - return true; - if (__should_check_rate(td, DDIR_WRITE) && td->bytes_done[DDIR_WRITE]) - return true; - if (__should_check_rate(td, DDIR_TRIM) && td->bytes_done[DDIR_TRIM]) - return true; + if (!__should_check_rate(td)) + return false; - return false; + return ddir_rw_sum(td->bytes_done) != 0; } static inline unsigned int td_max_bs(struct thread_data *td)