From 061c86982ea02651cab2239b12983dd382019f26 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Tue, 4 Sep 2007 15:17:09 +0200 Subject: [PATCH] Add unmap hook that belongs to the IO engines Signed-off-by: Jens Axboe --- fio.h | 5 +++++ io_u.c | 2 ++ 2 files changed, 7 insertions(+) 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); -- 2.25.1