X-Git-Url: https://git.kernel.dk/?a=blobdiff_plain;f=t%2Fdedupe.c;h=e1cea50ce720a795a37a948ee0baf097a5060cd4;hb=f6496ba7d984b42602d2066837547eeb05b480f0;hp=7edb3d8886857e000949f066271ef358ab98ce12;hpb=5bcc4e471b70d04c9dec36b3cd20eb3a07d92246;p=fio.git diff --git a/t/dedupe.c b/t/dedupe.c index 7edb3d88..e1cea50c 100644 --- a/t/dedupe.c +++ b/t/dedupe.c @@ -21,7 +21,7 @@ #include "../smalloc.h" #include "../minmax.h" #include "../crc/md5.h" -#include "../memalign.h" +#include "../lib/memalign.h" #include "../os/os.h" #include "../gettime.h" #include "../fio_time.h" @@ -294,8 +294,7 @@ static int do_work(struct worker_thread *thread, void *buf) for (i = 0; i < nblocks; i++) { void *thisptr = buf + (i * blocksize); - if (items) - items[i].offset = offset; + items[i].offset = offset; crc_buf(thisptr, items[i].hash); offset += blocksize; nitems++; @@ -388,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) { @@ -431,7 +428,7 @@ static int dedupe_check(const char *filename, uint64_t *nextents, flags = O_RDONLY; if (odirect) - flags |= O_DIRECT; + flags |= OS_O_DIRECT; memset(&file, 0, sizeof(file)); file.file_name = strdup(filename);