4 #include "compiler/compiler.h"
20 IO_U_F_FLIGHT = 1 << 1,
21 IO_U_F_NO_FILE_PUT = 1 << 2,
22 IO_U_F_IN_CUR_DEPTH = 1 << 3,
23 IO_U_F_BUSY_OK = 1 << 4,
24 IO_U_F_TRIMMED = 1 << 5,
25 IO_U_F_BARRIER = 1 << 6,
26 IO_U_F_VER_LIST = 1 << 7,
33 struct timespec start_time;
34 struct timespec issue_time;
36 struct fio_file *file;
41 * For replay workloads, we may want to account as a different
42 * IO type than what is being submitted.
44 enum fio_ddir acct_ddir;
49 unsigned short numberio;
52 * Allocated/set buffer and length
54 unsigned long long buflen;
55 unsigned long long offset;
59 * Initial seed for generating the buffer contents
64 * IO engine state, may be different from above when we get
65 * partial transfers / residual data counts
68 unsigned long long xfer_buflen;
71 * Parameter related to pre-filled buffers and
72 * their size to handle variable block sizes.
74 unsigned long long buf_filled_len;
78 unsigned long long resid;
82 * io engine private data
91 struct flist_head verify_list;
92 struct workqueue_work work;
96 * Callback for io completion
98 int (*end_io)(struct thread_data *, struct io_u **);
104 #ifdef CONFIG_POSIXAIO
108 struct sg_io_hdr hdr;
113 #ifdef CONFIG_SOLARISAIO
114 aio_result_t resultp;
126 extern struct io_u *__get_io_u(struct thread_data *);
127 extern struct io_u *get_io_u(struct thread_data *);
128 extern void put_io_u(struct thread_data *, struct io_u *);
129 extern void clear_io_u(struct thread_data *, struct io_u *);
130 extern void requeue_io_u(struct thread_data *, struct io_u **);
131 extern int __must_check io_u_sync_complete(struct thread_data *, struct io_u *);
132 extern int __must_check io_u_queued_complete(struct thread_data *, int);
133 extern void io_u_queued(struct thread_data *, struct io_u *);
134 extern int io_u_quiesce(struct thread_data *);
135 extern void io_u_log_error(struct thread_data *, struct io_u *);
136 extern void io_u_mark_depth(struct thread_data *, unsigned int);
137 extern void fill_io_buffer(struct thread_data *, void *, unsigned long long, unsigned long long);
138 extern void io_u_fill_buffer(struct thread_data *td, struct io_u *, unsigned long long, unsigned long long);
139 void io_u_mark_complete(struct thread_data *, unsigned int);
140 void io_u_mark_submit(struct thread_data *, unsigned int);
141 bool queue_full(const struct thread_data *);
143 int do_io_u_sync(const struct thread_data *, struct io_u *);
144 int do_io_u_trim(const struct thread_data *, struct io_u *);
147 static inline void dprint_io_u(struct io_u *io_u, const char *p)
149 struct fio_file *f = io_u->file;
152 dprint(FD_IO, "%s: io_u %p: off=0x%llx,len=0x%llx,ddir=%d,file=%s\n",
154 (unsigned long long) io_u->offset,
155 io_u->buflen, io_u->ddir,
158 dprint(FD_IO, "%s: io_u %p: off=0x%llx,len=0x%llx,ddir=%d\n",
160 (unsigned long long) io_u->offset,
161 io_u->buflen, io_u->ddir);
164 #define dprint_io_u(io_u, p)
167 static inline enum fio_ddir acct_ddir(struct io_u *io_u)
169 if (io_u->acct_ddir != -1)
170 return io_u->acct_ddir;
175 #define io_u_clear(td, io_u, val) \
176 td_flags_clear((td), &(io_u->flags), (val))
177 #define io_u_set(td, io_u, val) \
178 td_flags_set((td), &(io_u)->flags, (val))