X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=file.h;h=f7a1eae14408240c6f92222b97b98fa5cd58a35e;hp=c929d1dae482fe01c43b51980e0b5c72914ac57c;hb=3c6c5a29a74cf5727c0572b82907c330c38cea61;hpb=5903e7b7907854014478b6febfc5645a203ff59e diff --git a/file.h b/file.h index c929d1da..f7a1eae1 100644 --- a/file.h +++ b/file.h @@ -27,6 +27,8 @@ enum fio_file_flags { FIO_FILE_size_known = 1 << 4, /* size has been set */ FIO_FILE_hashed = 1 << 5, /* file is on hash */ FIO_FILE_partial_mmap = 1 << 6, /* can't do full mmap */ + FIO_FILE_axmap = 1 << 7, /* uses axmap */ + FIO_FILE_lfsr = 1 << 8, /* lfsr is used */ }; enum file_lock_mode { @@ -77,10 +79,6 @@ struct fio_file { unsigned int major, minor; int fileno; - void *mmap_ptr; - size_t mmap_sz; - off_t mmap_off; - /* * size of the file, offset into file, and io size from that offset */ @@ -88,8 +86,11 @@ struct fio_file { uint64_t file_offset; uint64_t io_size; - uint64_t last_pos; - uint64_t last_start; + /* + * Track last end and last start of IO for a given data direction + */ + uint64_t last_pos[DDIR_RWDIR_CNT]; + uint64_t last_start[DDIR_RWDIR_CNT]; uint64_t first_write; uint64_t last_write; @@ -108,11 +109,12 @@ struct fio_file { }; /* - * block map for random io + * block map or LFSR for random io */ - struct axmap *io_axmap; - - struct fio_lfsr lfsr; + union { + struct axmap *io_axmap; + struct fio_lfsr lfsr; + }; /* * Used for zipf random distribution @@ -125,6 +127,10 @@ struct fio_file { struct disk_util *du; }; +#define FILE_ENG_DATA(f) ((void *) (uintptr_t) (f)->engine_data) +#define FILE_SET_ENG_DATA(f, data) \ + ((f)->engine_data = (uintptr_t) (data)) + struct file_name { struct flist_head list; char *filename; @@ -151,6 +157,8 @@ FILE_FLAG_FNS(done); FILE_FLAG_FNS(size_known); FILE_FLAG_FNS(hashed); FILE_FLAG_FNS(partial_mmap); +FILE_FLAG_FNS(axmap); +FILE_FLAG_FNS(lfsr); #undef FILE_FLAG_FNS /* @@ -159,7 +167,7 @@ FILE_FLAG_FNS(partial_mmap); 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 *); +extern uint64_t get_start_offset(struct thread_data *, struct fio_file *); extern int __must_check setup_files(struct thread_data *); extern int __must_check file_invalidate_cache(struct thread_data *, struct fio_file *); extern int __must_check generic_open_file(struct thread_data *, struct fio_file *);