-
Notifications
You must be signed in to change notification settings - Fork 0
/
io_ddir.h
34 lines (29 loc) · 847 Bytes
/
io_ddir.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#ifndef FIO_DDIR_H
#define FIO_DDIR_H
enum fio_ddir {
DDIR_READ = 0,
DDIR_WRITE,
DDIR_SYNC,
DDIR_DATASYNC,
DDIR_WAIT,
DDIR_INVAL = -1,
};
enum td_ddir {
TD_DDIR_READ = 1 << 0,
TD_DDIR_WRITE = 1 << 1,
TD_DDIR_RAND = 1 << 2,
TD_DDIR_RW = TD_DDIR_READ | TD_DDIR_WRITE,
TD_DDIR_RANDREAD = TD_DDIR_READ | TD_DDIR_RAND,
TD_DDIR_RANDWRITE = TD_DDIR_WRITE | TD_DDIR_RAND,
TD_DDIR_RANDRW = TD_DDIR_RW | TD_DDIR_RAND,
};
#define td_read(td) ((td)->o.td_ddir & TD_DDIR_READ)
#define td_write(td) ((td)->o.td_ddir & TD_DDIR_WRITE)
#define td_rw(td) (((td)->o.td_ddir & TD_DDIR_RW) == TD_DDIR_RW)
#define td_random(td) ((td)->o.td_ddir & TD_DDIR_RAND)
#define file_randommap(td, f) (!(td)->o.norandommap && (f)->file_map)
static inline int ddir_sync(enum fio_ddir ddir)
{
return ddir == DDIR_SYNC || ddir == DDIR_DATASYNC;
}
#endif