client: use temp buffer for single output flush for json/disk util
[fio.git] / lib / lfsr.h
CommitLineData
8055e41d
JA
1#ifndef FIO_LFSR_H
2#define FIO_LFSR_H
3
4#include <inttypes.h>
5
d474cbc9 6#define FIO_MAX_TAPS 6
8055e41d
JA
7
8struct lfsr_taps {
9 unsigned int length;
10 unsigned int taps[FIO_MAX_TAPS];
11};
12
13
14struct fio_lfsr {
d474cbc9 15 uint64_t xormask;
8055e41d 16 uint64_t last_val;
d474cbc9 17 uint64_t cached_bit;
8055e41d
JA
18 uint64_t max_val;
19 uint64_t num_vals;
d474cbc9 20 uint64_t cycle_length;
d0f85362 21 uint64_t cached_cycle_length;
d474cbc9 22 unsigned int spin;
8055e41d
JA
23};
24
6f49f8bc 25int lfsr_next(struct fio_lfsr *fl, uint64_t *off);
d474cbc9
AP
26int lfsr_init(struct fio_lfsr *fl, uint64_t size,
27 unsigned long seed, unsigned int spin);
28int lfsr_reset(struct fio_lfsr *fl, unsigned long seed);
8055e41d
JA
29
30#endif