Jens Axboe | 0d29de8 | 2010-09-01 13:54:15 +0200 | [diff] [blame] | 1 | #ifndef FIO_TRIM_H |
| 2 | #define FIO_TRIM_H |
| 3 | |
| 4 | #include "fio.h" |
| 5 | |
| 6 | #ifdef FIO_HAVE_TRIM |
Elliott Hughes | eda3a60 | 2017-05-19 18:53:02 -0700 | [diff] [blame] | 7 | extern bool __must_check get_next_trim(struct thread_data *td, struct io_u *io_u); |
| 8 | extern bool io_u_should_trim(struct thread_data *td, struct io_u *io_u); |
Jens Axboe | 0d29de8 | 2010-09-01 13:54:15 +0200 | [diff] [blame] | 9 | |
| 10 | /* |
| 11 | * Determine whether a given io_u should be logged for verify or |
| 12 | * for discard |
| 13 | */ |
| 14 | static 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 |
Elliott Hughes | eda3a60 | 2017-05-19 18:53:02 -0700 | [diff] [blame] | 23 | static inline bool get_next_trim(struct thread_data *td, struct io_u *io_u) |
Jens Axboe | 0d29de8 | 2010-09-01 13:54:15 +0200 | [diff] [blame] | 24 | { |
Elliott Hughes | eda3a60 | 2017-05-19 18:53:02 -0700 | [diff] [blame] | 25 | return false; |
Jens Axboe | 0d29de8 | 2010-09-01 13:54:15 +0200 | [diff] [blame] | 26 | } |
Elliott Hughes | eda3a60 | 2017-05-19 18:53:02 -0700 | [diff] [blame] | 27 | static inline bool io_u_should_trim(struct thread_data *td, struct io_u *io_u) |
Jens Axboe | 0d29de8 | 2010-09-01 13:54:15 +0200 | [diff] [blame] | 28 | { |
Elliott Hughes | eda3a60 | 2017-05-19 18:53:02 -0700 | [diff] [blame] | 29 | return false; |
Jens Axboe | 0d29de8 | 2010-09-01 13:54:15 +0200 | [diff] [blame] | 30 | } |
| 31 | static inline void remove_trim_entry(struct thread_data *td, struct io_piece *ipo) |
| 32 | { |
| 33 | } |
Jens Axboe | 0d29de8 | 2010-09-01 13:54:15 +0200 | [diff] [blame] | 34 | #endif |
| 35 | |
| 36 | #endif |