A ->close_file() operation isn't strictly needed
authorJens Axboe <jens.axboe@oracle.com>
Thu, 12 Apr 2007 10:57:27 +0000 (12:57 +0200)
committerJens Axboe <jens.axboe@oracle.com>
Thu, 12 Apr 2007 10:57:27 +0000 (12:57 +0200)
So be sure to check the pointer before calling it.

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
ioengines.c

index 998c13ee7ce96c1123ec913e550ef0d6519d63d7..b9c6d71400ec672b0288e0abe17f6cff345f9941 100644 (file)
@@ -305,7 +305,8 @@ done:
        get_file(f);
        return 0;
 err:
-       td->io_ops->close_file(td, f);
+       if (td->io_ops->close_file)
+               td->io_ops->close_file(td, f);
        return 1;
 }
 
@@ -318,4 +319,3 @@ void td_io_close_file(struct thread_data *td, struct fio_file *f)
 
        put_file(td, f);
 }
-