4 #define FIO_IOOPS_VERSION 10
8 IO_U_F_FLIGHT = 1 << 1,
16 #ifdef FIO_HAVE_LIBAIO
19 #ifdef FIO_HAVE_POSIXAIO
28 #ifdef FIO_HAVE_SOLARISAIO
33 struct timeval start_time;
34 struct timeval issue_time;
37 * Allocated/set buffer and length
41 unsigned long long offset;
44 * IO engine state, may be different from above when we get
45 * partial transfers / residual data counts
48 unsigned long xfer_buflen;
56 * io engine private data
66 struct fio_file *file;
68 struct flist_head list;
71 * Callback for io completion
73 int (*end_io)(struct thread_data *, struct io_u *);
77 * io_ops->queue() return values
80 FIO_Q_COMPLETED = 0, /* completed sync */
81 FIO_Q_QUEUED = 1, /* queued, will complete async */
82 FIO_Q_BUSY = 2, /* no more room, call ->commit() */
86 struct flist_head list;
90 int (*setup)(struct thread_data *);
91 int (*init)(struct thread_data *);
92 int (*prep)(struct thread_data *, struct io_u *);
93 int (*queue)(struct thread_data *, struct io_u *);
94 int (*commit)(struct thread_data *);
95 int (*getevents)(struct thread_data *, unsigned int, unsigned int, struct timespec *);
96 struct io_u *(*event)(struct thread_data *, int);
97 int (*cancel)(struct thread_data *, struct io_u *);
98 void (*cleanup)(struct thread_data *);
99 int (*open_file)(struct thread_data *, struct fio_file *);
100 int (*close_file)(struct thread_data *, struct fio_file *);
101 int (*get_file_size)(struct thread_data *, struct fio_file *);
108 * io engine entry points
110 extern int __must_check td_io_init(struct thread_data *);
111 extern int __must_check td_io_prep(struct thread_data *, struct io_u *);
112 extern int __must_check td_io_queue(struct thread_data *, struct io_u *);
113 extern int __must_check td_io_sync(struct thread_data *, struct fio_file *);
114 extern int __must_check td_io_getevents(struct thread_data *, unsigned int, unsigned int, struct timespec *);
115 extern int __must_check td_io_commit(struct thread_data *);
116 extern int __must_check td_io_open_file(struct thread_data *, struct fio_file *);
117 extern int td_io_close_file(struct thread_data *, struct fio_file *);
118 extern int __must_check td_io_get_file_size(struct thread_data *, struct fio_file *);
120 extern struct ioengine_ops *load_ioengine(struct thread_data *, const char *);
121 extern void register_ioengine(struct ioengine_ops *);
122 extern void unregister_ioengine(struct ioengine_ops *);
123 extern void close_ioengine(struct thread_data *);
128 #define queue_full(td) flist_empty(&(td)->io_u_freelist)
129 extern struct io_u *__get_io_u(struct thread_data *);
130 extern struct io_u *get_io_u(struct thread_data *);
131 extern void put_io_u(struct thread_data *, struct io_u *);
132 extern void requeue_io_u(struct thread_data *, struct io_u **);
133 extern long __must_check io_u_sync_complete(struct thread_data *, struct io_u *);
134 extern long __must_check io_u_queued_complete(struct thread_data *, int);
135 extern void io_u_queued(struct thread_data *, struct io_u *);
136 extern void io_u_log_error(struct thread_data *, struct io_u *);
137 extern void io_u_mark_depth(struct thread_data *, unsigned int);
138 extern void io_u_fill_buffer(struct thread_data *td, struct io_u *, unsigned int);
139 void io_u_mark_complete(struct thread_data *, unsigned int);
140 void io_u_mark_submit(struct thread_data *, unsigned int);