X-Git-Url: https://git.kernel.dk/?a=blobdiff_plain;f=ioengines.h;h=01a9b5860085f13885885edb326bcf8c14d5ccc3;hb=01bf5128d0581e267383f280c6a1dcd26517240f;hp=a0674aeabebfd5cccc49fb2a578b736dbac58054;hpb=3d2d14bcb844e72809192311369a642c5d415472;p=fio.git diff --git a/ioengines.h b/ioengines.h index a0674aea..01a9b586 100644 --- a/ioengines.h +++ b/ioengines.h @@ -7,12 +7,12 @@ #include "flist.h" #include "io_u.h" -#define FIO_IOOPS_VERSION 23 +#define FIO_IOOPS_VERSION 25 /* * io_ops->queue() return values */ -enum { +enum fio_q_status { FIO_Q_COMPLETED = 0, /* completed sync */ FIO_Q_QUEUED = 1, /* queued, will complete async */ FIO_Q_BUSY = 2, /* no more room, call ->commit() */ @@ -25,8 +25,9 @@ struct ioengine_ops { int flags; int (*setup)(struct thread_data *); int (*init)(struct thread_data *); + int (*post_init)(struct thread_data *); int (*prep)(struct thread_data *, struct io_u *); - int (*queue)(struct thread_data *, struct io_u *); + enum fio_q_status (*queue)(struct thread_data *, struct io_u *); int (*commit)(struct thread_data *); int (*getevents)(struct thread_data *, unsigned int, unsigned int, const struct timespec *); struct io_u *(*event)(struct thread_data *, int); @@ -62,6 +63,8 @@ enum fio_ioengine_flags { FIO_FAKEIO = 1 << 11, /* engine pretends to do IO */ FIO_NOSTATS = 1 << 12, /* don't do IO stats */ FIO_NOFILEHASH = 1 << 13, /* doesn't hash the files for lookup later. */ + FIO_ASYNCIO_SYNC_TRIM + = 1 << 14 /* io engine has async ->queue except for trim */ }; /* @@ -74,9 +77,9 @@ typedef void (*get_ioengine_t)(struct ioengine_ops **); */ extern int __must_check td_io_init(struct thread_data *); extern int __must_check td_io_prep(struct thread_data *, struct io_u *); -extern int __must_check td_io_queue(struct thread_data *, struct io_u *); +extern enum fio_q_status __must_check td_io_queue(struct thread_data *, struct io_u *); extern int __must_check td_io_getevents(struct thread_data *, unsigned int, unsigned int, const struct timespec *); -extern int __must_check td_io_commit(struct thread_data *); +extern void td_io_commit(struct thread_data *); extern int __must_check td_io_open_file(struct thread_data *, struct fio_file *); extern int td_io_close_file(struct thread_data *, struct fio_file *); extern int td_io_unlink_file(struct thread_data *, struct fio_file *);