blob: 03eefdb87c0db8931a82b8e7cd628fec4f957742 [file] [log] [blame]
Jens Axboed6aed792009-06-03 08:41:15 +02001#ifndef FIO_DDIR_H
2#define FIO_DDIR_H
3
4enum fio_ddir {
5 DDIR_READ = 0,
6 DDIR_WRITE,
7 DDIR_SYNC,
Jens Axboe5f9099e2009-06-16 22:40:26 +02008 DDIR_DATASYNC,
Glen Ogilvie457bf392009-11-03 21:52:36 +01009 DDIR_WAIT,
Jens Axboed6aed792009-06-03 08:41:15 +020010 DDIR_INVAL = -1,
11};
12
13enum td_ddir {
14 TD_DDIR_READ = 1 << 0,
15 TD_DDIR_WRITE = 1 << 1,
16 TD_DDIR_RAND = 1 << 2,
17 TD_DDIR_RW = TD_DDIR_READ | TD_DDIR_WRITE,
18 TD_DDIR_RANDREAD = TD_DDIR_READ | TD_DDIR_RAND,
19 TD_DDIR_RANDWRITE = TD_DDIR_WRITE | TD_DDIR_RAND,
20 TD_DDIR_RANDRW = TD_DDIR_RW | TD_DDIR_RAND,
21};
22
Jens Axboe29c8e862009-06-05 22:10:51 +020023#define td_read(td) ((td)->o.td_ddir & TD_DDIR_READ)
24#define td_write(td) ((td)->o.td_ddir & TD_DDIR_WRITE)
25#define td_rw(td) (((td)->o.td_ddir & TD_DDIR_RW) == TD_DDIR_RW)
26#define td_random(td) ((td)->o.td_ddir & TD_DDIR_RAND)
27#define file_randommap(td, f) (!(td)->o.norandommap && (f)->file_map)
28
Jens Axboe5f9099e2009-06-16 22:40:26 +020029static inline int ddir_sync(enum fio_ddir ddir)
30{
31 return ddir == DDIR_SYNC || ddir == DDIR_DATASYNC;
32}
33
Jens Axboed6aed792009-06-03 08:41:15 +020034#endif