0001
0002 #ifndef _BCACHE_REQUEST_H_
0003 #define _BCACHE_REQUEST_H_
0004
0005 struct data_insert_op {
0006 struct closure cl;
0007 struct cache_set *c;
0008 struct bio *bio;
0009 struct workqueue_struct *wq;
0010
0011 unsigned int inode;
0012 uint16_t write_point;
0013 uint16_t write_prio;
0014 blk_status_t status;
0015
0016 union {
0017 uint16_t flags;
0018
0019 struct {
0020 unsigned int bypass:1;
0021 unsigned int writeback:1;
0022 unsigned int flush_journal:1;
0023 unsigned int csum:1;
0024
0025 unsigned int replace:1;
0026 unsigned int replace_collision:1;
0027
0028 unsigned int insert_data_done:1;
0029 };
0030 };
0031
0032 struct keylist insert_keys;
0033 BKEY_PADDED(replace_key);
0034 };
0035
0036 unsigned int bch_get_congested(const struct cache_set *c);
0037 void bch_data_insert(struct closure *cl);
0038
0039 void bch_cached_dev_request_init(struct cached_dev *dc);
0040 void cached_dev_submit_bio(struct bio *bio);
0041
0042 void bch_flash_dev_request_init(struct bcache_device *d);
0043 void flash_dev_submit_bio(struct bio *bio);
0044
0045 extern struct kmem_cache *bch_search_cache;
0046
0047 #endif