Add unmap hook that belongs to the IO engines
authorJens Axboe <jens.axboe@oracle.com>
Tue, 4 Sep 2007 13:17:09 +0000 (15:17 +0200)
committerJens Axboe <jens.axboe@oracle.com>
Tue, 4 Sep 2007 13:17:09 +0000 (15:17 +0200)
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
fio.h
io_u.c

diff --git a/fio.h b/fio.h
index c202b0d..fe314bf 100644 (file)
--- 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 4750ac6..1a68ad1 100644 (file)
--- 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);