X-Git-Url: https://git.kernel.dk/?a=blobdiff_plain;f=fio.h;h=2a9eef45c7acf2a3532fd1c776df4a2c2e2772be;hb=409a4f291e7f4011f6ccfe748c6ed9786431ddb3;hp=e943ad165ba01c2d4d8132009f33af5efe72da8f;hpb=8d853d0bbf4487af9445f7253c1951970ce75200;p=fio.git diff --git a/fio.h b/fio.h index e943ad16..2a9eef45 100644 --- a/fio.h +++ b/fio.h @@ -36,6 +36,8 @@ #include "lib/rand.h" #include "lib/rbtree.h" #include "lib/num2str.h" +#include "lib/memalign.h" +#include "smalloc.h" #include "client.h" #include "server.h" #include "stat.h" @@ -137,6 +139,7 @@ enum { FIO_RAND_ZONE_OFF, FIO_RAND_POISSON2_OFF, FIO_RAND_POISSON3_OFF, + FIO_RAND_PRIO_CMDS, FIO_RAND_NR_OFFS, }; @@ -256,6 +259,7 @@ struct thread_data { struct frand_state buf_state_prev; struct frand_state dedupe_state; struct frand_state zone_state; + struct frand_state prio_state; struct zone_split_index **zone_state_index; @@ -458,7 +462,7 @@ struct thread_data { CUdevice cu_dev; CUcontext cu_ctx; CUdeviceptr dev_mem_ptr; -#endif +#endif }; @@ -856,4 +860,14 @@ extern void check_trigger_file(void); extern bool in_flight_overlap(struct io_u_queue *q, struct io_u *io_u); extern pthread_mutex_t overlap_check; +static inline void *fio_memalign(size_t alignment, size_t size, bool shared) +{ + return __fio_memalign(alignment, size, shared ? smalloc : malloc); +} + +static inline void fio_memfree(void *ptr, size_t size, bool shared) +{ + return __fio_memfree(ptr, size, shared ? sfree : free); +} + #endif