[PATCH] Let thread exit cleanup the small allocs
authorJens Axboe <axboe@suse.de>
Thu, 8 Jun 2006 09:03:18 +0000 (11:03 +0200)
committerJens Axboe <axboe@suse.de>
Thu, 8 Jun 2006 09:03:18 +0000 (11:03 +0200)
Makes it easier to just inherit the allocations.

fio.c
init.c

diff --git a/fio.c b/fio.c
index aa5071c..7aef822 100644 (file)
--- a/fio.c
+++ b/fio.c
@@ -933,24 +933,6 @@ static int init_io_u(struct thread_data *td)
        return 0;
 }
 
-static void cleanup_allocs(struct thread_data *td)
-{
-       if (td->directory)
-               free(td->directory);
-       if (td->iolog_file)
-               free(td->iolog_file);
-       if (td->exec_prerun)
-               free(td->exec_prerun);
-       if (td->exec_postrun)
-               free(td->exec_postrun);
-       if (td->ioscheduler)
-               free(td->ioscheduler);
-       if (td->sysfs_root)
-               free(td->sysfs_root);
-       if (td->file_name)
-               free(td->file_name);
-}
-
 static int create_file(struct thread_data *td, unsigned long long size,
                       int extend)
 {
@@ -1406,7 +1388,6 @@ err:
        }
        if (td->mmap)
                munmap(td->mmap, td->file_size);
-       cleanup_allocs(td);
        cleanup_io(td);
        cleanup_io_u(td);
        td_set_runstate(td, TD_EXITED);
diff --git a/init.c b/init.c
index 44d3734..0ec8e9d 100644 (file)
--- a/init.c
+++ b/init.c
@@ -71,14 +71,6 @@ static struct thread_data *get_new_job(int global, struct thread_data *parent)
        td->fd = -1;
        td->thread_number = thread_number;
 
-       td->directory = NULL;
-       td->iolog_file = NULL;
-       td->exec_prerun = NULL;
-       td->exec_postrun = NULL;
-       td->ioscheduler = NULL;
-       td->sysfs_root = NULL;
-       td->file_name = NULL;
-
        return td;
 }