Normal vs special files fixups
[fio.git] / fio.h
diff --git a/fio.h b/fio.h
index e451f95599cdea980d9c102506b393aae2341920..3e8b2d2a84b62d119279a3c3501afcaecd441c8f 100644 (file)
--- a/fio.h
+++ b/fio.h
@@ -219,8 +219,9 @@ enum fio_ioengine_flags {
 };
 
 enum fio_file_flags {
-       FIO_FILE_OPEN           = 1 << 0,
-       FIO_FILE_UNLINK         = 1 << 1,
+       FIO_FILE_OPEN           = 1 << 0,       /* file is open */
+       FIO_FILE_UNLINK         = 1 << 1,       /* unlink on close */
+       FIO_FILE_CLOSING        = 1 << 2,       /* file being closed */
 };
 
 /*
@@ -237,7 +238,7 @@ struct fio_file {
                unsigned long file_data;
                int fd;
        };
-       const char *file_name;
+       char *file_name;
        void *mmap;
        unsigned long long file_size;
        unsigned long long real_file_size;
@@ -252,6 +253,7 @@ struct fio_file {
        unsigned int num_maps;
        unsigned int last_free_lookup;
 
+       int references;
        enum fio_file_flags flags;
 };
 
@@ -323,7 +325,7 @@ struct thread_data {
        struct fio_file *files;
        unsigned int nr_files;
        unsigned int nr_open_files;
-       unsigned int nr_uniq_files;
+       unsigned int nr_normal_files;
        union {
                unsigned int next_file;
                os_random_state_t next_file_state;
@@ -654,6 +656,8 @@ extern int __must_check file_invalidate_cache(struct thread_data *, struct fio_f
 extern int __must_check generic_open_file(struct thread_data *, struct fio_file *);
 extern void generic_close_file(struct thread_data *, struct fio_file *);
 extern void add_file(struct thread_data *, const char *);
+extern void get_file(struct fio_file *);
+extern void put_file(struct thread_data *, struct fio_file *);
 
 /*
  * ETA/status stuff