X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=file.h;h=f7a1eae14408240c6f92222b97b98fa5cd58a35e;hp=add77730fdb43931ba2fff38881b9196b3175395;hb=67a176fc7fa918cc91880530fac07cc3aa864c71;hpb=bedc9dc24223bb33be4120f4a57718bc54888ca5 diff --git a/file.h b/file.h index add77730..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 /*