-enum fio_ddir {
- DDIR_READ = 0,
- DDIR_WRITE,
- DDIR_SYNC,
- DDIR_INVAL = -1,
-};
-
-enum td_ddir {
- TD_DDIR_READ = 1 << 0,
- TD_DDIR_WRITE = 1 << 1,
- TD_DDIR_RAND = 1 << 2,
- TD_DDIR_RW = TD_DDIR_READ | TD_DDIR_WRITE,
- TD_DDIR_RANDREAD = TD_DDIR_READ | TD_DDIR_RAND,
- TD_DDIR_RANDWRITE = TD_DDIR_WRITE | TD_DDIR_RAND,
- TD_DDIR_RANDRW = TD_DDIR_RW | TD_DDIR_RAND,
-};
-
-enum file_lock_mode {
- FILE_LOCK_NONE,
- FILE_LOCK_EXCLUSIVE,
- FILE_LOCK_READWRITE,
-};
-
-/*
- * Use for maintaining statistics
- */
-struct io_stat {
- unsigned long max_val;
- unsigned long min_val;
- unsigned long samples;
-
- double mean;
- double S;
-};
-
-/*
- * A single data sample
- */
-struct io_sample {
- unsigned long time;
- unsigned long val;
- enum fio_ddir ddir;
-};
-
-/*
- * Dynamically growing data sample log
- */
-struct io_log {
- unsigned long nr_samples;
- unsigned long max_samples;
- struct io_sample *log;
-};
-
-/*
- * When logging io actions, this matches a single sent io_u
- */
-struct io_piece {
- union {
- struct rb_node rb_node;
- struct flist_head list;
- };
- union {
- int fileno;
- struct fio_file *file;
- };
- unsigned long long offset;
- unsigned long len;
- enum fio_ddir ddir;
- union {
- unsigned long delay;
- unsigned int file_action;
- };
-};
-
-enum {
- IO_U_F_FREE = 1 << 0,
- IO_U_F_FLIGHT = 1 << 1,
-};
-
-struct thread_data;
-
-/*
- * The io unit
- */
-struct io_u {
- union {
-#ifdef FIO_HAVE_LIBAIO
- struct iocb iocb;
-#endif
-#ifdef FIO_HAVE_POSIXAIO
- struct aiocb aiocb;
-#endif
-#ifdef FIO_HAVE_SGIO
- struct sg_io_hdr hdr;
-#endif
-#ifdef FIO_HAVE_GUASI
- guasi_req_t greq;
-#endif
-#ifdef FIO_HAVE_SOLARISAIO
- aio_result_t resultp;
-#endif
- };
- struct timeval start_time;
- struct timeval issue_time;
-
- /*
- * Allocated/set buffer and length
- */
- void *buf;
- unsigned long buflen;
- unsigned long long offset;
- unsigned long long endpos;
-
- /*
- * IO engine state, may be different from above when we get
- * partial transfers / residual data counts
- */
- void *xfer_buf;
- unsigned long xfer_buflen;
-
- unsigned int resid;
- unsigned int error;
-
- enum fio_ddir ddir;
-
- /*
- * io engine private data
- */
- union {
- unsigned int index;
- unsigned int seen;
- void *engine_data;
- };
-
- unsigned int flags;
-
- struct fio_file *file;
-
- struct flist_head list;
-
- /*
- * Callback for io completion
- */
- int (*end_io)(struct thread_data *, struct io_u *);
-};
-
-/*
- * io_ops->queue() return values
- */
-enum {
- FIO_Q_COMPLETED = 0, /* completed sync */
- FIO_Q_QUEUED = 1, /* queued, will complete async */
- FIO_Q_BUSY = 2, /* no more room, call ->commit() */
-};
-
-#define FIO_HDR_MAGIC 0xf00baaef
-
-enum {
- VERIFY_NONE = 0, /* no verification */
- VERIFY_MD5, /* md5 sum data blocks */
- VERIFY_CRC64, /* crc64 sum data blocks */
- VERIFY_CRC32, /* crc32 sum data blocks */
- VERIFY_CRC16, /* crc16 sum data blocks */
- VERIFY_CRC7, /* crc7 sum data blocks */
- VERIFY_SHA256, /* sha256 sum data blocks */
- VERIFY_SHA512, /* sha512 sum data blocks */
- VERIFY_META, /* block_num, timestamp etc. */
- VERIFY_NULL, /* pretend to verify */
-};
-
-/*
- * A header structure associated with each checksummed data block. It is
- * followed by a checksum specific header that contains the verification
- * data.
- */
-struct verify_header {
- unsigned int fio_magic;
- unsigned int len;
- unsigned int verify_type;
-};
-
-struct vhdr_md5 {
- uint32_t md5_digest[16];
-};
-struct vhdr_sha512 {
- uint8_t sha512[128];
-};
-struct vhdr_sha256 {
- uint8_t sha256[128];
-};
-struct vhdr_crc64 {
- uint64_t crc64;
-};
-struct vhdr_crc32 {
- uint32_t crc32;
-};
-struct vhdr_crc16 {
- uint16_t crc16;
-};
-struct vhdr_crc7 {
- uint8_t crc7;
-};
-struct vhdr_meta {
- uint64_t offset;
- unsigned char thread;
- unsigned short numberio;
- unsigned long time_sec;
- unsigned long time_usec;
-};
-