Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
Kent Overstreet | cafe563 | 2013-03-23 16:11:31 -0700 | [diff] [blame] | 2 | #ifndef _BCACHE_REQUEST_H_ |
3 | #define _BCACHE_REQUEST_H_ | ||||
4 | |||||
Kent Overstreet | 220bb38 | 2013-09-10 19:02:45 -0700 | [diff] [blame] | 5 | struct data_insert_op { |
Kent Overstreet | cafe563 | 2013-03-23 16:11:31 -0700 | [diff] [blame] | 6 | struct closure cl; |
Kent Overstreet | c18536a | 2013-07-24 17:44:17 -0700 | [diff] [blame] | 7 | struct cache_set *c; |
Kent Overstreet | 220bb38 | 2013-09-10 19:02:45 -0700 | [diff] [blame] | 8 | struct bio *bio; |
Nicholas Swenson | da415a0 | 2014-01-09 16:03:04 -0800 | [diff] [blame] | 9 | struct workqueue_struct *wq; |
Kent Overstreet | cafe563 | 2013-03-23 16:11:31 -0700 | [diff] [blame] | 10 | |
Coly Li | 6f10f7d | 2018-08-11 13:19:44 +0800 | [diff] [blame] | 11 | unsigned int inode; |
Kent Overstreet | 2599b53 | 2013-07-24 18:11:11 -0700 | [diff] [blame] | 12 | uint16_t write_point; |
Kent Overstreet | 220bb38 | 2013-09-10 19:02:45 -0700 | [diff] [blame] | 13 | uint16_t write_prio; |
Christoph Hellwig | 4e4cbee | 2017-06-03 09:38:06 +0200 | [diff] [blame] | 14 | blk_status_t status; |
Kent Overstreet | c18536a | 2013-07-24 17:44:17 -0700 | [diff] [blame] | 15 | |
Kent Overstreet | a5ae430 | 2013-09-10 19:16:31 -0700 | [diff] [blame] | 16 | union { |
17 | uint16_t flags; | ||||
Kent Overstreet | 220bb38 | 2013-09-10 19:02:45 -0700 | [diff] [blame] | 18 | |
Kent Overstreet | a5ae430 | 2013-09-10 19:16:31 -0700 | [diff] [blame] | 19 | struct { |
Coly Li | 6f10f7d | 2018-08-11 13:19:44 +0800 | [diff] [blame] | 20 | unsigned int bypass:1; |
21 | unsigned int writeback:1; | ||||
22 | unsigned int flush_journal:1; | ||||
23 | unsigned int csum:1; | ||||
Kent Overstreet | c18536a | 2013-07-24 17:44:17 -0700 | [diff] [blame] | 24 | |
Coly Li | 6f10f7d | 2018-08-11 13:19:44 +0800 | [diff] [blame] | 25 | unsigned int replace:1; |
26 | unsigned int replace_collision:1; | ||||
Kent Overstreet | 0b93207 | 2013-07-24 17:26:51 -0700 | [diff] [blame] | 27 | |
Coly Li | 6f10f7d | 2018-08-11 13:19:44 +0800 | [diff] [blame] | 28 | unsigned int insert_data_done:1; |
Kent Overstreet | a5ae430 | 2013-09-10 19:16:31 -0700 | [diff] [blame] | 29 | }; |
30 | }; | ||||
31 | |||||
Kent Overstreet | 0b93207 | 2013-07-24 17:26:51 -0700 | [diff] [blame] | 32 | struct keylist insert_keys; |
Kent Overstreet | 1b207d8 | 2013-09-10 18:52:54 -0700 | [diff] [blame] | 33 | BKEY_PADDED(replace_key); |
Kent Overstreet | cafe563 | 2013-03-23 16:11:31 -0700 | [diff] [blame] | 34 | }; |
35 | |||||
Coly Li | fc2d598 | 2018-08-11 13:19:46 +0800 | [diff] [blame] | 36 | unsigned int bch_get_congested(struct cache_set *c); |
Kent Overstreet | a34a8bf | 2013-10-24 17:07:04 -0700 | [diff] [blame] | 37 | void bch_data_insert(struct closure *cl); |
Kent Overstreet | cafe563 | 2013-03-23 16:11:31 -0700 | [diff] [blame] | 38 | |
Kent Overstreet | cafe563 | 2013-03-23 16:11:31 -0700 | [diff] [blame] | 39 | void bch_cached_dev_request_init(struct cached_dev *dc); |
40 | void bch_flash_dev_request_init(struct bcache_device *d); | ||||
41 | |||||
Shenghui Wang | 3fd3c5c | 2018-10-08 20:41:16 +0800 | [diff] [blame] | 42 | extern struct kmem_cache *bch_search_cache; |
Kent Overstreet | cafe563 | 2013-03-23 16:11:31 -0700 | [diff] [blame] | 43 | |
Kent Overstreet | cafe563 | 2013-03-23 16:11:31 -0700 | [diff] [blame] | 44 | #endif /* _BCACHE_REQUEST_H_ */ |