This patch does not change any functionality. The code introduced by
this patch will be used by the zoned block device code.
Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
void put_io_u(struct thread_data *td, struct io_u *io_u)
{
+ if (io_u->post_submit) {
+ io_u->post_submit(io_u, io_u->error == 0);
+ io_u->post_submit = NULL;
+ }
+
if (td->parent)
td = td->parent;
if (!fill_io_u(td, io_u))
break;
+ if (io_u->post_submit) {
+ io_u->post_submit(io_u, false);
+ io_u->post_submit = NULL;
+ }
+
put_file_log(td, f);
td_io_close_file(td, f);
io_u->file = NULL;
struct workqueue_work work;
};
+ /*
+ * Post-submit callback. Used by the ZBD code. @success == true means
+ * that the I/O operation has been queued or completed successfully.
+ */
+ void (*post_submit)(const struct io_u *, bool success);
+
/*
* Callback for io completion
*/
}
ret = td->io_ops->queue(td, io_u);
+ if (ret != FIO_Q_BUSY && io_u->post_submit) {
+ io_u->post_submit(io_u, io_u->error == 0);
+ io_u->post_submit = NULL;
+ }
unlock_file(td, io_u->file);