X-Git-Url: https://git.kernel.dk/?a=blobdiff_plain;f=fio.h;h=03a2378d94c9451f13d8b2f9177d5602a91910c3;hb=df415585cd9c54472b7aa77b9eca6206ab0cbb4f;hp=9471666b02b45cf7328637841e249636247f06c1;hpb=263e529f7d90892a610a5b26a519116fe3a675a6;p=fio.git diff --git a/fio.h b/fio.h index 9471666b..03a2378d 100644 --- a/fio.h +++ b/fio.h @@ -181,7 +181,6 @@ struct thread_data { unsigned char sequential; unsigned char odirect; - unsigned char create_file; unsigned char invalidate_cache; unsigned char create_serialize; unsigned char create_fsync; @@ -193,6 +192,8 @@ struct thread_data { unsigned char do_disk_util; unsigned char override_sync; unsigned char rand_repeatable; + unsigned char write_lat_log; + unsigned char write_bw_log; unsigned int bs; unsigned int min_bs; @@ -334,12 +335,7 @@ struct thread_data { #define td_verror(td, err) __td_verror((td), (err), strerror((err))) #define td_vmsg(td, err, msg) __td_verror((td), (err), (msg)) -extern struct io_u *__get_io_u(struct thread_data *); -extern void put_io_u(struct thread_data *, struct io_u *); - extern int rate_quit; -extern int write_lat_log; -extern int write_bw_log; extern int exitall_on_terminate; extern int thread_number; extern int shm_id; @@ -448,6 +444,7 @@ extern int init_random_state(struct thread_data *); */ extern void close_files(struct thread_data *); extern int setup_files(struct thread_data *); +extern int file_invalidate_cache(struct thread_data *, struct fio_file *); /* * ETA/status stuff @@ -472,6 +469,39 @@ enum { TD_REAPED, }; +/* + * Verify helpers + */ +extern void populate_verify_io_u(struct thread_data *, struct io_u *); +extern int get_next_verify(struct thread_data *td, struct io_u *); +extern int do_io_u_verify(struct thread_data *, struct io_u **); + +/* + * Memory helpers + */ +extern int fio_pin_memory(void); +extern void fio_unpin_memory(void); +extern int allocate_io_mem(struct thread_data *); +extern void free_io_mem(struct thread_data *); + +/* + * io unit handling + */ +#define queue_full(td) list_empty(&(td)->io_u_freelist) +extern struct io_u *__get_io_u(struct thread_data *); +extern struct io_u *get_io_u(struct thread_data *, struct fio_file *); +extern void put_io_u(struct thread_data *, struct io_u *); +extern void ios_completed(struct thread_data *, struct io_completion_data *); +extern void io_completed(struct thread_data *, struct io_u *, struct io_completion_data *); + +/* + * io engine entry points + */ +extern int td_io_prep(struct thread_data *, struct io_u *); +extern int td_io_queue(struct thread_data *, struct io_u *); +extern int td_io_sync(struct thread_data *, struct fio_file *); +extern int td_io_getevents(struct thread_data *, int, int, struct timespec *); + /* * This is a pretty crappy semaphore implementation, but with the use that fio * has (just signalling start/go conditions), it doesn't have to be better. @@ -532,7 +562,9 @@ extern void close_ioengine(struct thread_data *); */ #define fio_unused __attribute((__unused__)) +#define for_each_td(td, i) \ + for ((i) = 0, (td) = &threads[0]; (i) < (int) thread_number; (i)++, (td)++) #define for_each_file(td, f, i) \ - for ((i) = 0, (f) = &(td)->files[0]; (i) < (td)->nr_files; (i)++, (f) = &(td)->files[(i)]) + for ((i) = 0, (f) = &(td)->files[0]; (i) < (int) (td)->nr_files; (i)++, (f)++) #endif