xref: /linux/block/blk-wbt.h (revision 7ca26efb09a1543fddb29308ea3b63b66cb5d3ee)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef WB_THROTTLE_H
3 #define WB_THROTTLE_H
4 
5 #ifdef CONFIG_BLK_WBT
6 
7 int wbt_init(struct gendisk *disk);
8 void wbt_disable_default(struct gendisk *disk);
9 void wbt_enable_default(struct gendisk *disk);
10 
11 u64 wbt_get_min_lat(struct request_queue *q);
12 void wbt_set_min_lat(struct request_queue *q, u64 val);
13 bool wbt_disabled(struct request_queue *);
14 
15 void wbt_set_write_cache(struct request_queue *, bool);
16 
17 u64 wbt_default_latency_nsec(struct request_queue *);
18 
19 #else
20 
21 static inline void wbt_disable_default(struct gendisk *disk)
22 {
23 }
24 static inline void wbt_enable_default(struct gendisk *disk)
25 {
26 }
27 static inline void wbt_set_write_cache(struct request_queue *q, bool wc)
28 {
29 }
30 
31 #endif /* CONFIG_BLK_WBT */
32 
33 #endif
34