X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=fio.h;h=1b392a0372b0ddbe60984eefc1cc09b60180ffc4;hp=20d14082d3281b03e44f04823de5f714a81f65da;hb=7101d9c24abec4be58a086d85d6d92ec6e6492e9;hpb=4241ea8fb0606f9bd5b7ed1278d3b7825883acf6 diff --git a/fio.h b/fio.h index 20d14082..1b392a03 100644 --- a/fio.h +++ b/fio.h @@ -13,6 +13,7 @@ #include #include #include +#include #include "compiler/compiler.h" #include "list.h" @@ -670,6 +671,11 @@ extern struct thread_data *threads; #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) +static inline void fio_ro_check(struct thread_data *td, struct io_u *io_u) +{ + assert(!(io_u->ddir == DDIR_WRITE && !td_write(td))); +} + #define BLOCKS_PER_MAP (8 * sizeof(long)) #define TO_MAP_BLOCK(td, f, b) ((b) - ((f)->file_offset / (td)->o.rw_min_bs)) #define RAND_MAP_IDX(td, f, b) (TO_MAP_BLOCK(td, f, b) / BLOCKS_PER_MAP)