]> git.sesse.net Git - bcachefs-tools-debian/blob - libbcachefs/clock.h
Update bcachefs sources to b91a514413 bcachefs: Don't try to delete stripes when RO
[bcachefs-tools-debian] / libbcachefs / clock.h
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _BCACHEFS_CLOCK_H
3 #define _BCACHEFS_CLOCK_H
4
5 void bch2_io_timer_add(struct io_clock *, struct io_timer *);
6 void bch2_io_timer_del(struct io_clock *, struct io_timer *);
7 void bch2_kthread_io_clock_wait(struct io_clock *, unsigned long,
8                                 unsigned long);
9 void bch2_increment_clock(struct bch_fs *, unsigned, int);
10
11 void bch2_io_clock_schedule_timeout(struct io_clock *, unsigned long);
12
13 #define bch2_kthread_wait_event_ioclock_timeout(condition, clock, timeout)\
14 ({                                                                      \
15         long __ret = timeout;                                           \
16         might_sleep();                                                  \
17         if (!___wait_cond_timeout(condition))                           \
18                 __ret = __wait_event_timeout(wq, condition, timeout);   \
19         __ret;                                                          \
20 })
21
22 void bch2_io_clock_exit(struct io_clock *);
23 int bch2_io_clock_init(struct io_clock *);
24
25 #endif /* _BCACHEFS_CLOCK_H */