Silence put_file() complaint
authorJens Axboe <jens.axboe@oracle.com>
Fri, 16 May 2008 10:31:36 +0000 (12:31 +0200)
committerJens Axboe <jens.axboe@oracle.com>
Fri, 16 May 2008 10:31:36 +0000 (12:31 +0200)
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
io_u.c

diff --git a/io_u.c b/io_u.c
index 55ac82659cc81670640ab04941849fb7d52772f2..92cdd71701a9df3973eb4158b0a8fcb6bab4eed5 100644 (file)
--- a/io_u.c
+++ b/io_u.c
@@ -319,17 +319,21 @@ static enum fio_ddir get_rw_ddir(struct thread_data *td)
                return DDIR_WRITE;
 }
 
                return DDIR_WRITE;
 }
 
+static void put_file_log(struct thread_data *td, struct fio_file *f)
+{
+       int ret = put_file(td, f);
+
+       if (ret)
+               td_verror(td, ret, "file close");
+}
+
 void put_io_u(struct thread_data *td, struct io_u *io_u)
 {
        assert((io_u->flags & IO_U_F_FREE) == 0);
        io_u->flags |= IO_U_F_FREE;
 
 void put_io_u(struct thread_data *td, struct io_u *io_u)
 {
        assert((io_u->flags & IO_U_F_FREE) == 0);
        io_u->flags |= IO_U_F_FREE;
 
-       if (io_u->file) {
-               int ret = put_file(td, io_u->file);
-
-               if (ret)
-                       td_verror(td, ret, "file close");
-       }
+       if (io_u->file)
+               put_file_log(td, io_u->file);
 
        io_u->file = NULL;
        list_del(&io_u->list);
 
        io_u->file = NULL;
        list_del(&io_u->list);
@@ -662,7 +666,7 @@ set_file:
                 * way we preserve queueing etc.
                 */
                if (td->o.nr_files == 1 && td->o.time_based) {
                 * way we preserve queueing etc.
                 */
                if (td->o.nr_files == 1 && td->o.time_based) {
-                       put_file(td, f);
+                       put_file_log(td, f);
                        fio_file_reset(f);
                        goto set_file;
                }
                        fio_file_reset(f);
                        goto set_file;
                }