Cleanup verify headers
authorJens Axboe <jens.axboe@oracle.com>
Wed, 3 Jun 2009 06:45:40 +0000 (08:45 +0200)
committerJens Axboe <jens.axboe@oracle.com>
Wed, 3 Jun 2009 06:45:40 +0000 (08:45 +0200)
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
engines/mmap.c
fio.c
fio.h
init.c
io_u.c
log.c
options.c
verify.c
verify.h [new file with mode: 0644]

index 2a341d076ec79a885a3668b174a3d264339ae027..fde68f1d9b0b5b6a7e3e6f404a003a02f1b4bf45 100644 (file)
@@ -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 5bd1baefc29849ec58c225e4443f8a829b95df5d..8c1502ec80319775240d3300b2b565eba718a562 100644 (file)
--- 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 1819c3214a9419e3155f5dfb4359440fe45e3b4a..d3a03795c9ecec7e1764f9b33408ac4f88e8fa42 100644 (file)
--- a/fio.h
+++ b/fio.h
@@ -168,63 +168,6 @@ enum {
        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];
@@ -858,13 +801,6 @@ enum {
 
 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
  */
diff --git a/init.c b/init.c
index 7681102bd506353e05257442e5279c64b43f9bcc..b3ce07c9fce15dbdc67746b5455343ed15723365 100644 (file)
--- 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 d12f370b2ff30c001c1978da232a60edd2a7d4d6..5cf2526b35ea4536ac978e1a727ab6bf8e8a6043 100644 (file)
--- 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 6d5e68da580b5ac72d3dfde8c47c3df85ae722f4..5014b484e252c6d7f1055f3a7cad462db735c9c4 100644 (file)
--- 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";
 
index a45d1af6b7d9f17c316def4b0bfa6d48b515763e..9dcef0ca3e6169eae74544940e3ccb289b8e23dc 100644 (file)
--- 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"
 
index 6de0b884112c0b78aa6fbc7d7c25d7867826e59c..2ae74b93c28e7e6a2c7c71165a5dc98a76b876ea 100644 (file)
--- 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 (file)
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