Add support for fdatasync()
[fio.git] / verify.h
CommitLineData
4f5af7b2
JA
1#ifndef FIO_VERIFY_H
2#define FIO_VERIFY_H
3
4#define FIO_HDR_MAGIC 0xf00baaef
5
6enum {
7 VERIFY_NONE = 0, /* no verification */
8 VERIFY_MD5, /* md5 sum data blocks */
9 VERIFY_CRC64, /* crc64 sum data blocks */
10 VERIFY_CRC32, /* crc32 sum data blocks */
11 VERIFY_CRC32C, /* crc32c sum data blocks */
12 VERIFY_CRC32C_INTEL, /* crc32c sum data blocks with hw */
13 VERIFY_CRC16, /* crc16 sum data blocks */
14 VERIFY_CRC7, /* crc7 sum data blocks */
15 VERIFY_SHA256, /* sha256 sum data blocks */
16 VERIFY_SHA512, /* sha512 sum data blocks */
17 VERIFY_META, /* block_num, timestamp etc. */
18 VERIFY_NULL, /* pretend to verify */
19};
20
21/*
22 * A header structure associated with each checksummed data block. It is
23 * followed by a checksum specific header that contains the verification
24 * data.
25 */
26struct verify_header {
27 unsigned int fio_magic;
28 unsigned int len;
29 unsigned int verify_type;
30};
31
32struct vhdr_md5 {
33 uint32_t md5_digest[16];
34};
35struct vhdr_sha512 {
36 uint8_t sha512[128];
37};
38struct vhdr_sha256 {
39 uint8_t sha256[128];
40};
41struct vhdr_crc64 {
42 uint64_t crc64;
43};
44struct vhdr_crc32 {
45 uint32_t crc32;
46};
47struct vhdr_crc16 {
48 uint16_t crc16;
49};
50struct vhdr_crc7 {
51 uint8_t crc7;
52};
53struct vhdr_meta {
54 uint64_t offset;
55 unsigned char thread;
56 unsigned short numberio;
57 unsigned long time_sec;
58 unsigned long time_usec;
59};
60
61/*
62 * Verify helpers
63 */
64extern void populate_verify_io_u(struct thread_data *, struct io_u *);
65extern int __must_check get_next_verify(struct thread_data *td, struct io_u *);
66extern int __must_check verify_io_u(struct thread_data *, struct io_u *);
67
68#endif