2 * null engine - doesn't do any transfers. Used to test fio.
15 struct io_u *last_io_u;
18 static int fio_null_getevents(struct thread_data *td, int fio_unused min,
19 int max, struct timespec fio_unused *t)
23 if (list_empty(&td->io_u_busylist))
29 static struct io_u *fio_null_event(struct thread_data *td, int event)
31 struct null_data *nd = td->io_ops->data;
38 static int fio_null_queue(struct thread_data *td, struct io_u *io_u)
40 struct null_data *nd = td->io_ops->data;
48 static void fio_null_cleanup(struct thread_data *td)
50 if (td->io_ops->data) {
51 free(td->io_ops->data);
52 td->io_ops->data = NULL;
56 static int fio_null_init(struct thread_data *td)
58 struct null_data *nd = malloc(sizeof(*nd));
61 td->io_ops->data = nd;
65 static struct ioengine_ops ioengine = {
67 .version = FIO_IOOPS_VERSION,
68 .init = fio_null_init,
69 .queue = fio_null_queue,
70 .getevents = fio_null_getevents,
71 .event = fio_null_event,
72 .cleanup = fio_null_cleanup,
73 .flags = FIO_SYNCIO | FIO_NULLIO,
76 static void fio_init fio_null_register(void)
78 register_ioengine(&ioengine);
81 static void fio_exit fio_null_unregister(void)
83 unregister_ioengine(&ioengine);