X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=ioengines.h;h=b3f755b477de01f2ece25e93e9ad4d0edfa7bcda;hp=32b18edadf1f2dbbdcdf2ae66df3ea264a4a16c8;hb=9ce6f6f2bd636e9678982b86d6992ed419634c31;hpb=358ffaa6c37acb26e0f507934ba8a6f98f34ffee diff --git a/ioengines.h b/ioengines.h index 32b18eda..b3f755b4 100644 --- a/ioengines.h +++ b/ioengines.h @@ -1,17 +1,25 @@ #ifndef FIO_IOENGINE_H #define FIO_IOENGINE_H +#include + #include "compiler/compiler.h" -#include "os/os.h" -#include "file.h" +#include "flist.h" #include "io_u.h" +#include "zbd_types.h" + +#define FIO_IOOPS_VERSION 30 -#define FIO_IOOPS_VERSION 23 +#ifndef CONFIG_DYNAMIC_ENGINES +#define FIO_STATIC static +#else +#define FIO_STATIC +#endif /* * 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() */ @@ -22,10 +30,12 @@ struct ioengine_ops { const char *name; int version; int flags; + void *dlhandle; 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); @@ -37,11 +47,20 @@ struct ioengine_ops { int (*invalidate)(struct thread_data *, struct fio_file *); int (*unlink_file)(struct thread_data *, struct fio_file *); int (*get_file_size)(struct thread_data *, struct fio_file *); + int (*prepopulate_file)(struct thread_data *, struct fio_file *); void (*terminate)(struct thread_data *); int (*iomem_alloc)(struct thread_data *, size_t); void (*iomem_free)(struct thread_data *); int (*io_u_init)(struct thread_data *, struct io_u *); void (*io_u_free)(struct thread_data *, struct io_u *); + int (*get_zoned_model)(struct thread_data *td, + struct fio_file *f, enum zbd_zoned_model *); + int (*report_zones)(struct thread_data *, struct fio_file *, + uint64_t, struct zbd_zone *, unsigned int); + int (*reset_wp)(struct thread_data *, struct fio_file *, + uint64_t, uint64_t); + int (*get_max_open_zones)(struct thread_data *, struct fio_file *, + unsigned int *); int option_struct_size; struct fio_option *options; }; @@ -61,6 +80,9 @@ 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 */ + FIO_NO_OFFLOAD = 1 << 15, /* no async offload */ }; /* @@ -73,9 +95,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 *);