Kent Overstreet | cafe563 | 2013-03-23 16:11:31 -0700 | [diff] [blame] | 1 | #ifndef _BCACHE_REQUEST_H_ |
2 | #define _BCACHE_REQUEST_H_ | ||||
3 | |||||
Kent Overstreet | 220bb38 | 2013-09-10 19:02:45 -0700 | [diff] [blame] | 4 | struct data_insert_op { |
Kent Overstreet | cafe563 | 2013-03-23 16:11:31 -0700 | [diff] [blame] | 5 | struct closure cl; |
Kent Overstreet | c18536a | 2013-07-24 17:44:17 -0700 | [diff] [blame] | 6 | struct cache_set *c; |
Kent Overstreet | 220bb38 | 2013-09-10 19:02:45 -0700 | [diff] [blame] | 7 | struct bio *bio; |
Nicholas Swenson | da415a0 | 2014-01-09 16:03:04 -0800 | [diff] [blame] | 8 | struct workqueue_struct *wq; |
Kent Overstreet | cafe563 | 2013-03-23 16:11:31 -0700 | [diff] [blame] | 9 | |
Kent Overstreet | c18536a | 2013-07-24 17:44:17 -0700 | [diff] [blame] | 10 | unsigned inode; |
Kent Overstreet | 2599b53 | 2013-07-24 18:11:11 -0700 | [diff] [blame] | 11 | uint16_t write_point; |
Kent Overstreet | 220bb38 | 2013-09-10 19:02:45 -0700 | [diff] [blame] | 12 | uint16_t write_prio; |
13 | short error; | ||||
Kent Overstreet | c18536a | 2013-07-24 17:44:17 -0700 | [diff] [blame] | 14 | |
Kent Overstreet | a5ae430 | 2013-09-10 19:16:31 -0700 | [diff] [blame] | 15 | union { |
16 | uint16_t flags; | ||||
Kent Overstreet | 220bb38 | 2013-09-10 19:02:45 -0700 | [diff] [blame] | 17 | |
Kent Overstreet | a5ae430 | 2013-09-10 19:16:31 -0700 | [diff] [blame] | 18 | struct { |
19 | unsigned bypass:1; | ||||
20 | unsigned writeback:1; | ||||
21 | unsigned flush_journal:1; | ||||
22 | unsigned csum:1; | ||||
Kent Overstreet | c18536a | 2013-07-24 17:44:17 -0700 | [diff] [blame] | 23 | |
Kent Overstreet | a5ae430 | 2013-09-10 19:16:31 -0700 | [diff] [blame] | 24 | unsigned replace:1; |
25 | unsigned replace_collision:1; | ||||
Kent Overstreet | 0b93207 | 2013-07-24 17:26:51 -0700 | [diff] [blame] | 26 | |
Kent Overstreet | a5ae430 | 2013-09-10 19:16:31 -0700 | [diff] [blame] | 27 | unsigned insert_data_done:1; |
28 | }; | ||||
29 | }; | ||||
30 | |||||
Kent Overstreet | 0b93207 | 2013-07-24 17:26:51 -0700 | [diff] [blame] | 31 | struct keylist insert_keys; |
Kent Overstreet | 1b207d8 | 2013-09-10 18:52:54 -0700 | [diff] [blame] | 32 | BKEY_PADDED(replace_key); |
Kent Overstreet | cafe563 | 2013-03-23 16:11:31 -0700 | [diff] [blame] | 33 | }; |
34 | |||||
Kent Overstreet | c37511b | 2013-04-26 15:39:55 -0700 | [diff] [blame] | 35 | unsigned bch_get_congested(struct cache_set *); |
Kent Overstreet | a34a8bf | 2013-10-24 17:07:04 -0700 | [diff] [blame] | 36 | void bch_data_insert(struct closure *cl); |
Kent Overstreet | cafe563 | 2013-03-23 16:11:31 -0700 | [diff] [blame] | 37 | |
Kent Overstreet | cafe563 | 2013-03-23 16:11:31 -0700 | [diff] [blame] | 38 | void bch_cached_dev_request_init(struct cached_dev *dc); |
39 | void bch_flash_dev_request_init(struct bcache_device *d); | ||||
40 | |||||
41 | extern struct kmem_cache *bch_search_cache, *bch_passthrough_cache; | ||||
42 | |||||
Kent Overstreet | cafe563 | 2013-03-23 16:11:31 -0700 | [diff] [blame] | 43 | #endif /* _BCACHE_REQUEST_H_ */ |