Merge branch 'eta_display' of https://github.com/sitsofe/fio
[fio.git] / trim.h
CommitLineData
0d29de83
JA
1#ifndef FIO_TRIM_H
2#define FIO_TRIM_H
3
4#include "fio.h"
5
6#ifdef FIO_HAVE_TRIM
917c64b3
JA
7extern bool __must_check get_next_trim(struct thread_data *td, struct io_u *io_u);
8extern bool io_u_should_trim(struct thread_data *td, struct io_u *io_u);
0d29de83
JA
9
10/*
11 * Determine whether a given io_u should be logged for verify or
12 * for discard
13 */
14static inline void remove_trim_entry(struct thread_data *td, struct io_piece *ipo)
15{
16 if (!flist_empty(&ipo->trim_list)) {
17 flist_del_init(&ipo->trim_list);
18 td->trim_entries--;
19 }
20}
21
22#else
917c64b3 23static inline bool get_next_trim(struct thread_data *td, struct io_u *io_u)
0d29de83 24{
917c64b3 25 return false;
0d29de83 26}
917c64b3 27static inline bool io_u_should_trim(struct thread_data *td, struct io_u *io_u)
0d29de83 28{
917c64b3 29 return false;
0d29de83
JA
30}
31static inline void remove_trim_entry(struct thread_data *td, struct io_piece *ipo)
32{
33}
0d29de83
JA
34#endif
35
36#endif