]> git.sesse.net Git - bcachefs-tools-debian/blob - libbcachefs/clock.h
Update bcachefs sources to 0906b1fb49 bcachefs: fixes for 32 bit/big endian machines
[bcachefs-tools-debian] / libbcachefs / clock.h
1 #ifndef _BCACHEFS_CLOCK_H
2 #define _BCACHEFS_CLOCK_H
3
4 void bch2_io_timer_add(struct io_clock *, struct io_timer *);
5 void bch2_io_timer_del(struct io_clock *, struct io_timer *);
6 void bch2_kthread_io_clock_wait(struct io_clock *, unsigned long,
7                                 unsigned long);
8 void bch2_increment_clock(struct bch_fs *, unsigned, int);
9
10 void bch2_io_clock_schedule_timeout(struct io_clock *, unsigned long);
11
12 #define bch2_kthread_wait_event_ioclock_timeout(condition, clock, timeout)\
13 ({                                                                      \
14         long __ret = timeout;                                           \
15         might_sleep();                                                  \
16         if (!___wait_cond_timeout(condition))                           \
17                 __ret = __wait_event_timeout(wq, condition, timeout);   \
18         __ret;                                                          \
19 })
20
21 void bch2_io_clock_exit(struct io_clock *);
22 int bch2_io_clock_init(struct io_clock *);
23
24 #endif /* _BCACHEFS_CLOCK_H */