blob: 6584606253f8edcab29e65d70f6bf23a6d49bc8d [file] [log] [blame]
Jens Axboe0d29de82010-09-01 13:54:15 +02001#ifndef FIO_TRIM_H
2#define FIO_TRIM_H
3
4#include "fio.h"
5
6#ifdef FIO_HAVE_TRIM
7extern int __must_check get_next_trim(struct thread_data *td, struct io_u *io_u);
8extern int io_u_should_trim(struct thread_data *td, struct io_u *io_u);
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
23static inline int get_next_trim(struct thread_data *td, struct io_u *io_u)
24{
25 return 1;
26}
27static inline int io_u_should_trim(struct thread_data *td, struct io_u *io_u)
28{
29 return 0;
30}
31static inline void remove_trim_entry(struct thread_data *td, struct io_piece *ipo)
32{
33}
Jens Axboe0d29de82010-09-01 13:54:15 +020034#endif
35
36#endif