From: Jens Axboe Date: Tue, 4 Sep 2007 13:17:09 +0000 (+0200) Subject: Add unmap hook that belongs to the IO engines X-Git-Tag: fio-1.17.2~29 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=061c86982ea02651cab2239b12983dd382019f26 Add unmap hook that belongs to the IO engines Signed-off-by: Jens Axboe --- diff --git a/fio.h b/fio.h index c202b0dc..fe314bfd 100644 --- a/fio.h +++ b/fio.h @@ -175,6 +175,11 @@ struct io_u { * Callback for io completion */ int (*end_io)(struct thread_data *, struct io_u *); + + /* + * Called when io_u is about to be freed + */ + void (*unmap)(struct thread_data *, struct io_u *); }; /* diff --git a/io_u.c b/io_u.c index 4750ac60..1a68ad11 100644 --- a/io_u.c +++ b/io_u.c @@ -770,6 +770,8 @@ static void io_completed(struct thread_data *td, struct io_u *io_u, if (ret && !icd->error) icd->error = ret; } + if (io_u->unmap) + io_u->unmap(td, io_u); } else { icd->error = io_u->error; io_u_log_error(td, io_u);