6db1ad6df82efe5e202592fe4fbbe5b6eb68295d
[fio.git] / engines / null.c
1 /*
2  * null engine - doesn't do any transfers. Used to test fio.
3  *
4  */
5 #include <stdio.h>
6 #include <stdlib.h>
7 #include <unistd.h>
8 #include <errno.h>
9 #include <assert.h>
10
11 #include "../fio.h"
12 #include "../os.h"
13
14 static int fio_null_queue(struct thread_data fio_unused *td, struct io_u *io_u)
15 {
16         io_u->resid = 0;
17         io_u->error = 0;
18         return FIO_Q_COMPLETED;
19 }
20
21 static struct ioengine_ops ioengine = {
22         .name           = "null",
23         .version        = FIO_IOOPS_VERSION,
24         .queue          = fio_null_queue,
25         .flags          = FIO_SYNCIO | FIO_NULLIO | FIO_DISKLESSIO,
26 };
27
28 static void fio_init fio_null_register(void)
29 {
30         register_ioengine(&ioengine);
31 }
32
33 static void fio_exit fio_null_unregister(void)
34 {
35         unregister_ioengine(&ioengine);
36 }