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