Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
422 | giacomo | 1 | /* |
2 | * include/linux/backing-dev.h |
||
3 | * |
||
4 | * low-level device information and state which is propagated up through |
||
5 | * to high-level code. |
||
6 | */ |
||
7 | |||
8 | #ifndef _LINUX_BACKING_DEV_H |
||
9 | #define _LINUX_BACKING_DEV_H |
||
10 | |||
11 | #include <asm/atomic.h> |
||
12 | |||
13 | /* |
||
14 | * Bits in backing_dev_info.state |
||
15 | */ |
||
16 | enum bdi_state { |
||
17 | BDI_pdflush, /* A pdflush thread is working this device */ |
||
18 | BDI_write_congested, /* The write queue is getting full */ |
||
19 | BDI_read_congested, /* The read queue is getting full */ |
||
20 | BDI_unused, /* Available bits start here */ |
||
21 | }; |
||
22 | |||
23 | struct backing_dev_info { |
||
24 | unsigned long ra_pages; /* max readahead in PAGE_CACHE_SIZE units */ |
||
25 | unsigned long state; /* Always use atomic bitops on this */ |
||
26 | int memory_backed; /* Cannot clean pages with writepage */ |
||
27 | }; |
||
28 | |||
29 | extern struct backing_dev_info default_backing_dev_info; |
||
30 | |||
31 | int writeback_acquire(struct backing_dev_info *bdi); |
||
32 | int writeback_in_progress(struct backing_dev_info *bdi); |
||
33 | void writeback_release(struct backing_dev_info *bdi); |
||
34 | |||
35 | static inline int bdi_read_congested(struct backing_dev_info *bdi) |
||
36 | { |
||
37 | return test_bit(BDI_read_congested, &bdi->state); |
||
38 | } |
||
39 | |||
40 | static inline int bdi_write_congested(struct backing_dev_info *bdi) |
||
41 | { |
||
42 | return test_bit(BDI_write_congested, &bdi->state); |
||
43 | } |
||
44 | |||
45 | #endif /* _LINUX_BACKING_DEV_H */ |