blob: 1ff36875c2b30bcb29e650290b194c52cc57bc09 [file] [log] [blame]
Kent Overstreetcafe5632013-03-23 16:11:31 -07001#ifndef _BCACHE_REQUEST_H_
2#define _BCACHE_REQUEST_H_
3
Kent Overstreet220bb382013-09-10 19:02:45 -07004struct data_insert_op {
Kent Overstreetcafe5632013-03-23 16:11:31 -07005 struct closure cl;
Kent Overstreetc18536a2013-07-24 17:44:17 -07006 struct cache_set *c;
Kent Overstreet220bb382013-09-10 19:02:45 -07007 struct bio *bio;
Nicholas Swensonda415a02014-01-09 16:03:04 -08008 struct workqueue_struct *wq;
Kent Overstreetcafe5632013-03-23 16:11:31 -07009
Kent Overstreetc18536a2013-07-24 17:44:17 -070010 unsigned inode;
Kent Overstreet2599b532013-07-24 18:11:11 -070011 uint16_t write_point;
Kent Overstreet220bb382013-09-10 19:02:45 -070012 uint16_t write_prio;
13 short error;
Kent Overstreetc18536a2013-07-24 17:44:17 -070014
Kent Overstreeta5ae4302013-09-10 19:16:31 -070015 union {
16 uint16_t flags;
Kent Overstreet220bb382013-09-10 19:02:45 -070017
Kent Overstreeta5ae4302013-09-10 19:16:31 -070018 struct {
19 unsigned bypass:1;
20 unsigned writeback:1;
21 unsigned flush_journal:1;
22 unsigned csum:1;
Kent Overstreetc18536a2013-07-24 17:44:17 -070023
Kent Overstreeta5ae4302013-09-10 19:16:31 -070024 unsigned replace:1;
25 unsigned replace_collision:1;
Kent Overstreet0b932072013-07-24 17:26:51 -070026
Kent Overstreeta5ae4302013-09-10 19:16:31 -070027 unsigned insert_data_done:1;
28 };
29 };
30
Kent Overstreet0b932072013-07-24 17:26:51 -070031 struct keylist insert_keys;
Kent Overstreet1b207d82013-09-10 18:52:54 -070032 BKEY_PADDED(replace_key);
Kent Overstreetcafe5632013-03-23 16:11:31 -070033};
34
Kent Overstreetc37511b2013-04-26 15:39:55 -070035unsigned bch_get_congested(struct cache_set *);
Kent Overstreeta34a8bf2013-10-24 17:07:04 -070036void bch_data_insert(struct closure *cl);
Kent Overstreetcafe5632013-03-23 16:11:31 -070037
Kent Overstreetcafe5632013-03-23 16:11:31 -070038void bch_cached_dev_request_init(struct cached_dev *dc);
39void bch_flash_dev_request_init(struct bcache_device *d);
40
41extern struct kmem_cache *bch_search_cache, *bch_passthrough_cache;
42
Kent Overstreetcafe5632013-03-23 16:11:31 -070043#endif /* _BCACHE_REQUEST_H_ */