[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 aa5071ca527e7d77817b6ffefb2270171f9254e8..7aef8225ee6e8b07cab164eb505f0d8e94f590ee 100644 (file)
--- a/fio.c
+++ b/fio.c
@@ -933,24 +933,6 @@ static int init_io_u(struct thread_data *td)
        return 0;
 }
 
        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)
 {
 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);
        }
        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);
        cleanup_io(td);
        cleanup_io_u(td);
        td_set_runstate(td, TD_EXITED);
diff --git a/init.c b/init.c
index 44d3734194ebcaffee452582b732cbb042974d1c..0ec8e9d5ddd41f88a5e775d1a19d04ca1d001cea 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->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;
 }
 
        return td;
 }