t/dedupe: fix init of all thread variables
authorJens Axboe <axboe@fb.com>
Tue, 21 Oct 2014 19:02:29 +0000 (13:02 -0600)
committerJens Axboe <axboe@fb.com>
Tue, 21 Oct 2014 19:02:29 +0000 (13:02 -0600)
->dupes wasn't initialized, for instance. Just memset the
whole thing, so we don't run into this again.

Signed-off-by: Jens Axboe <axboe@fb.com>
t/dedupe.c

index b43b6773ea7a455eedcd096ad3e610659401992e..5b88fcb8961ad6904b096c29082534ec59228cc3 100644 (file)
@@ -387,10 +387,8 @@ static int run_dedupe_threads(struct fio_file *f, uint64_t dev_size,
 
        threads = malloc(num_threads * sizeof(struct worker_thread));
        for (i = 0; i < num_threads; i++) {
+               memset(&threads[i], 0, sizeof(struct worker_thread));
                threads[i].fd = f->fd;
-               threads[i].items = 0;
-               threads[i].err = 0;
-               threads[i].done = 0;
 
                err = pthread_create(&threads[i].thread, NULL, thread_fn, &threads[i]);
                if (err) {