Cleanup verify headers
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
diff --git a/engines/mmap.c b/engines/mmap.c
index 2a341d0..fde68f1 100644
--- a/engines/mmap.c
+++ b/engines/mmap.c
@@ -12,6 +12,7 @@
#include <sys/mman.h>
#include "../fio.h"
+#include "../verify.h"
/*
* Limits us to 2GB of mapped files in total
diff --git a/fio.c b/fio.c
index 5bd1bae..8c1502e 100644
--- a/fio.c
+++ b/fio.c
@@ -37,6 +37,7 @@
#include "fio.h"
#include "hash.h"
#include "smalloc.h"
+#include "verify.h"
unsigned long page_mask;
unsigned long page_size;
diff --git a/fio.h b/fio.h
index 1819c32..d3a0379 100644
--- a/fio.h
+++ b/fio.h
@@ -168,63 +168,6 @@
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_CRC32C, /* crc32c sum data blocks */
- VERIFY_CRC32C_INTEL, /* crc32c sum data blocks with hw */
- 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;
-};
-
struct group_run_stats {
unsigned long long max_run[2], min_run[2];
unsigned long long max_bw[2], min_bw[2];
@@ -859,13 +802,6 @@
extern void td_set_runstate(struct thread_data *, int);
/*
- * Verify helpers
- */
-extern void populate_verify_io_u(struct thread_data *, struct io_u *);
-extern int __must_check get_next_verify(struct thread_data *td, struct io_u *);
-extern int __must_check verify_io_u(struct thread_data *, struct io_u *);
-
-/*
* Memory helpers
*/
extern int __must_check fio_pin_memory(void);
diff --git a/init.c b/init.c
index 7681102..b3ce07c 100644
--- a/init.c
+++ b/init.c
@@ -18,6 +18,7 @@
#include "parse.h"
#include "smalloc.h"
#include "filehash.h"
+#include "verify.h"
static char fio_version_string[] = "fio 1.26.4";
diff --git a/io_u.c b/io_u.c
index d12f370..5cf2526 100644
--- a/io_u.c
+++ b/io_u.c
@@ -7,6 +7,7 @@
#include "fio.h"
#include "hash.h"
+#include "verify.h"
struct io_completion_data {
int nr; /* input */
diff --git a/log.c b/log.c
index 6d5e68d..5014b48 100644
--- a/log.c
+++ b/log.c
@@ -8,6 +8,7 @@
#include <assert.h>
#include "flist.h"
#include "fio.h"
+#include "verify.h"
static const char iolog_ver2[] = "fio version 2 iolog";
diff --git a/options.c b/options.c
index a45d1af..9dcef0c 100644
--- a/options.c
+++ b/options.c
@@ -11,6 +11,7 @@
#include <sys/stat.h>
#include "fio.h"
+#include "verify.h"
#include "parse.h"
#include "lib/fls.h"
diff --git a/verify.c b/verify.c
index 6de0b88..2ae74b9 100644
--- a/verify.c
+++ b/verify.c
@@ -7,6 +7,7 @@
#include <assert.h>
#include "fio.h"
+#include "verify.h"
#include "crc/md5.h"
#include "crc/crc64.h"
diff --git a/verify.h b/verify.h
new file mode 100644
index 0000000..76d256d
--- /dev/null
+++ b/verify.h
@@ -0,0 +1,68 @@
+#ifndef FIO_VERIFY_H
+#define FIO_VERIFY_H
+
+#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_CRC32C, /* crc32c sum data blocks */
+ VERIFY_CRC32C_INTEL, /* crc32c sum data blocks with hw */
+ 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;
+};
+
+/*
+ * Verify helpers
+ */
+extern void populate_verify_io_u(struct thread_data *, struct io_u *);
+extern int __must_check get_next_verify(struct thread_data *td, struct io_u *);
+extern int __must_check verify_io_u(struct thread_data *, struct io_u *);
+
+#endif