X-Git-Url: https://git.kernel.dk/?a=blobdiff_plain;f=fio.h;h=ffd3d7d00a1252cc60ca1280269977a7f1f2b36e;hb=06fecb4e2679b9783940721f78ea7201451ca55c;hp=92819349dabedde6c95d69d8f843edb1a1078d11;hpb=6977bcd0e4ee3faa7ffd8f208e4031bdf906ed88;p=fio.git diff --git a/fio.h b/fio.h index 92819349..ffd3d7d0 100644 --- a/fio.h +++ b/fio.h @@ -22,6 +22,7 @@ #include "arch/arch.h" #include "os/os.h" #include "mutex.h" +#include "sem.h" #include "log.h" #include "debug.h" @@ -274,6 +275,7 @@ enum fio_file_flags { FIO_FILE_EXTEND = 1 << 2, /* needs extend */ FIO_FILE_DONE = 1 << 3, /* io completed to this file */ FIO_SIZE_KNOWN = 1 << 4, /* size has been set */ + FIO_FILE_HASHED = 1 << 5, /* file is on hash */ }; /* @@ -281,6 +283,7 @@ enum fio_file_flags { * this structure holds state information for a single file. */ struct fio_file { + struct list_head hash_list; enum fio_filetype filetype; /* @@ -306,7 +309,13 @@ struct fio_file { unsigned long long io_size; unsigned long long last_pos; - unsigned long long last_completed_pos; + + /* + * if io is protected by a semaphore, this is set + */ + struct fio_sem *sem; + void *sem_owner; + unsigned int sem_batch; /* * block map for random io @@ -406,6 +415,8 @@ struct thread_options { unsigned int nr_files; unsigned int open_files; + unsigned int lockfile; + unsigned int lockfile_batch; unsigned int odirect; unsigned int invalidate_cache; @@ -498,7 +509,7 @@ struct thread_data { int thread_number; int groupid; struct thread_stat ts; - struct fio_file *files; + struct fio_file **files; unsigned int files_index; unsigned int nr_open_files; unsigned int nr_done_files; @@ -809,6 +820,8 @@ extern int __must_check generic_close_file(struct thread_data *, struct fio_file extern int add_file(struct thread_data *, const char *); extern void get_file(struct fio_file *); extern int __must_check put_file(struct thread_data *, struct fio_file *); +extern void lock_file(struct thread_data *, struct fio_file *); +extern void unlock_file(struct fio_file *); extern int add_dir_files(struct thread_data *, const char *); extern int init_random_map(struct thread_data *); extern void dup_files(struct thread_data *, struct thread_data *); @@ -941,7 +954,7 @@ extern void close_ioengine(struct thread_data *); #define for_each_td(td, i) \ for ((i) = 0, (td) = &threads[0]; (i) < (int) thread_number; (i)++, (td)++) #define for_each_file(td, f, i) \ - for ((i) = 0, (f) = &(td)->files[0]; (i) < (td)->o.nr_files; (i)++, (f)++) + for ((i) = 0, (f) = (td)->files[0]; (i) < (td)->o.nr_files; (i)++, (f)++) #define fio_assert(td, cond) do { \ if (!(cond)) { \