Fix multithread issues when operating on a single shared file
[fio.git] / file.h
diff --git a/file.h b/file.h
index faf65a2a013846fb716f0b80403d6549b90120d2..e646cf22f6b7ec184fe4fb6ab94f8fb5918cb76e 100644 (file)
--- a/file.h
+++ b/file.h
@@ -126,12 +126,14 @@ struct fio_file {
        unsigned int last_write_idx;
 
        /*
-        * For use by the io engine for offset or private data storage
+        * For use by the io engine to store offset
         */
-       union {
-               uint64_t engine_pos;
-               void *engine_data;
-       };
+       uint64_t engine_pos;
+
+       /*
+        * For use by the io engine for private data storage
+        */
+       void *engine_data;
 
        /*
         * if io is protected by a semaphore, this is set
@@ -199,6 +201,7 @@ struct thread_data;
 extern void close_files(struct thread_data *);
 extern void close_and_free_files(struct thread_data *);
 extern uint64_t get_start_offset(struct thread_data *, struct fio_file *);
+extern int __must_check setup_shared_file(struct thread_data *);
 extern int __must_check setup_files(struct thread_data *);
 extern int __must_check file_invalidate_cache(struct thread_data *, struct fio_file *);
 #ifdef __cplusplus