]> git.sesse.net Git - bcachefs-tools-debian/blob - c_src/include/linux/backing-dev.h
d8a86b45dd6685ef9618cf9cd3aa90dc24d769ea
[bcachefs-tools-debian] / c_src / include / linux / backing-dev.h
1 #ifndef _LINUX_BACKING_DEV_H
2 #define _LINUX_BACKING_DEV_H
3
4 #include <linux/list.h>
5
6 typedef int (congested_fn)(void *, int);
7
8 enum wb_congested_state {
9         WB_async_congested,     /* The async (write) queue is getting full */
10         WB_sync_congested,      /* The sync queue is getting full */
11 };
12
13 struct backing_dev_info {
14         struct list_head bdi_list;
15         unsigned        ra_pages;
16         unsigned        capabilities;
17
18         congested_fn    *congested_fn;
19         void            *congested_data;
20 };
21
22 #define BDI_CAP_NO_ACCT_DIRTY   0x00000001
23 #define BDI_CAP_NO_WRITEBACK    0x00000002
24 #define BDI_CAP_NO_ACCT_WB      0x00000004
25 #define BDI_CAP_STABLE_WRITES   0x00000008
26 #define BDI_CAP_STRICTLIMIT     0x00000010
27 #define BDI_CAP_CGROUP_WRITEBACK 0x00000020
28
29 static inline int bdi_congested(struct backing_dev_info *bdi, int cong_bits)
30 {
31         return 0;
32 }
33
34 static inline int __must_check bdi_setup_and_register(struct backing_dev_info *bdi,
35                                                       char *name)
36 {
37         bdi->capabilities = 0;
38         return 0;
39 }
40
41 static inline void bdi_destroy(struct backing_dev_info *bdi) {}
42
43 #define VM_MAX_READAHEAD        128     /* kbytes */
44
45 #endif  /* _LINUX_BACKING_DEV_H */