Merge branch 'master' of https://github.com/celestinechen/fio
[fio.git] / trim.h
... / ...
CommitLineData
1#ifndef FIO_TRIM_H
2#define FIO_TRIM_H
3
4#ifdef FIO_HAVE_TRIM
5#include "flist.h"
6#include "iolog.h"
7#include "compiler/compiler.h"
8#include "lib/types.h"
9#include "os/os.h"
10
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);
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
27static inline bool get_next_trim(struct thread_data *td, struct io_u *io_u)
28{
29 return false;
30}
31static inline bool io_u_should_trim(struct thread_data *td, struct io_u *io_u)
32{
33 return false;
34}
35static inline void remove_trim_entry(struct thread_data *td, struct io_piece *ipo)
36{
37}
38#endif
39
40#endif