Jens Axboe | a94ea28 | 2006-11-24 12:37:34 +0100 | [diff] [blame] | 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 | |
Jens Axboe | 36167d8 | 2007-02-18 05:41:31 +0100 | [diff] [blame] | 14 | static int fio_null_queue(struct thread_data fio_unused *td, struct io_u *io_u) |
Jens Axboe | a94ea28 | 2006-11-24 12:37:34 +0100 | [diff] [blame] | 15 | { |
Jens Axboe | a94ea28 | 2006-11-24 12:37:34 +0100 | [diff] [blame] | 16 | io_u->resid = 0; |
| 17 | io_u->error = 0; |
Jens Axboe | 36167d8 | 2007-02-18 05:41:31 +0100 | [diff] [blame] | 18 | return FIO_Q_COMPLETED; |
Jens Axboe | a94ea28 | 2006-11-24 12:37:34 +0100 | [diff] [blame] | 19 | } |
| 20 | |
| 21 | static struct ioengine_ops ioengine = { |
| 22 | .name = "null", |
| 23 | .version = FIO_IOOPS_VERSION, |
Jens Axboe | a94ea28 | 2006-11-24 12:37:34 +0100 | [diff] [blame] | 24 | .queue = fio_null_queue, |
Jens Axboe | 138502a | 2007-03-01 08:27:42 +0100 | [diff] [blame] | 25 | .flags = FIO_SYNCIO | FIO_NULLIO | FIO_DISKLESSIO, |
Jens Axboe | a94ea28 | 2006-11-24 12:37:34 +0100 | [diff] [blame] | 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 | } |