6 #define FIO_HDR_MAGIC 0xacca
9 VERIFY_NONE = 0, /* no verification */
10 VERIFY_HDR_ONLY, /* verify header only, kept for sake of
11 * compatibility with old configurations
12 * which use 'verify=meta' */
13 VERIFY_MD5, /* md5 sum data blocks */
14 VERIFY_CRC64, /* crc64 sum data blocks */
15 VERIFY_CRC32, /* crc32 sum data blocks */
16 VERIFY_CRC32C, /* crc32c sum data blocks */
17 VERIFY_CRC32C_INTEL, /* crc32c sum data blocks with hw */
18 VERIFY_CRC16, /* crc16 sum data blocks */
19 VERIFY_CRC7, /* crc7 sum data blocks */
20 VERIFY_SHA256, /* sha256 sum data blocks */
21 VERIFY_SHA512, /* sha512 sum data blocks */
22 VERIFY_XXHASH, /* xxhash sum data blocks */
23 VERIFY_SHA1, /* sha1 sum data blocks */
24 VERIFY_PATTERN, /* verify specific patterns */
25 VERIFY_PATTERN_NO_HDR, /* verify specific patterns, no hdr */
26 VERIFY_NULL, /* pretend to verify */
30 * A header structure associated with each checksummed data block. It is
31 * followed by a checksum specific header that contains the verification
34 struct verify_header {
48 uint32_t md5_digest[4];
78 extern void populate_verify_io_u(struct thread_data *, struct io_u *);
79 extern int __must_check get_next_verify(struct thread_data *td, struct io_u *);
80 extern int __must_check verify_io_u(struct thread_data *, struct io_u **);
81 extern int verify_io_u_async(struct thread_data *, struct io_u **);
82 extern void fill_verify_pattern(struct thread_data *td, void *p, unsigned int len, struct io_u *io_u, unsigned long seed, int use_seed);
83 extern void fill_buffer_pattern(struct thread_data *td, void *p, unsigned int len);
84 extern void fio_verify_init(struct thread_data *td);
87 * Async verify offload
89 extern int verify_async_init(struct thread_data *);
90 extern void verify_async_exit(struct thread_data *);
93 * Callbacks for pasting formats in the pattern buffer
95 extern int paste_blockoff(char *buf, unsigned int len, void *priv);
97 struct thread_rand32_state {
101 struct thread_rand64_state {
105 struct thread_rand_state {
108 struct thread_rand32_state state32;
109 struct thread_rand64_state state64;
114 * For dumping current write state
116 struct thread_io_list {
121 struct thread_rand_state rand;
126 struct thread_io_list_v1 {
131 struct thread_rand32_state rand;
138 struct thread_io_list state[0];
141 #define VSTATE_HDR_VERSION_V1 0x01
142 #define VSTATE_HDR_VERSION 0x02
144 struct verify_state_hdr {
150 #define IO_LIST_ALL 0xffffffff
151 extern struct all_io_list *get_all_io_list(int, size_t *);
152 extern void __verify_save_state(struct all_io_list *, const char *);
153 extern void verify_save_state(int mask);
154 extern int verify_load_state(struct thread_data *, const char *);
155 extern void verify_free_state(struct thread_data *);
156 extern int verify_state_should_stop(struct thread_data *, struct io_u *);
157 extern void verify_convert_assign_state(struct thread_data *, void *, int);
158 extern int verify_state_hdr(struct verify_state_hdr *, struct thread_io_list *,
161 static inline size_t __thread_io_list_sz(uint64_t depth)
163 return sizeof(struct thread_io_list) + depth * sizeof(uint64_t);
166 static inline size_t thread_io_list_sz(struct thread_io_list *s)
168 return __thread_io_list_sz(le64_to_cpu(s->depth));
171 static inline struct thread_io_list *io_list_next(struct thread_io_list *s)
173 return (void *) s + thread_io_list_sz(s);
176 static inline void verify_state_gen_name(char *out, size_t size,
177 const char *name, const char *prefix,
180 snprintf(out, size, "%s-%s-%d-verify.state", prefix, name, num);
181 out[size - 1] = '\0';