1b2441318SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 */ 2cafe5635SKent Overstreet #ifndef _BCACHE_REQUEST_H_ 3cafe5635SKent Overstreet #define _BCACHE_REQUEST_H_ 4cafe5635SKent Overstreet 5220bb38cSKent Overstreet struct data_insert_op { 6cafe5635SKent Overstreet struct closure cl; 7c18536a7SKent Overstreet struct cache_set *c; 8220bb38cSKent Overstreet struct bio *bio; 9da415a09SNicholas Swenson struct workqueue_struct *wq; 10cafe5635SKent Overstreet 116f10f7d1SColy Li unsigned int inode; 122599b53bSKent Overstreet uint16_t write_point; 13220bb38cSKent Overstreet uint16_t write_prio; 144e4cbee9SChristoph Hellwig blk_status_t status; 15c18536a7SKent Overstreet 16a5ae4300SKent Overstreet union { 17a5ae4300SKent Overstreet uint16_t flags; 18a5ae4300SKent Overstreet 19a5ae4300SKent Overstreet struct { 206f10f7d1SColy Li unsigned int bypass:1; 216f10f7d1SColy Li unsigned int writeback:1; 226f10f7d1SColy Li unsigned int flush_journal:1; 236f10f7d1SColy Li unsigned int csum:1; 24220bb38cSKent Overstreet 256f10f7d1SColy Li unsigned int replace:1; 266f10f7d1SColy Li unsigned int replace_collision:1; 27c18536a7SKent Overstreet 286f10f7d1SColy Li unsigned int insert_data_done:1; 29a5ae4300SKent Overstreet }; 30a5ae4300SKent Overstreet }; 310b93207aSKent Overstreet 320b93207aSKent Overstreet struct keylist insert_keys; 331b207d80SKent Overstreet BKEY_PADDED(replace_key); 34cafe5635SKent Overstreet }; 35cafe5635SKent Overstreet 363a394727SGeorge Spelvin unsigned int bch_get_congested(const struct cache_set *c); 37a34a8bfdSKent Overstreet void bch_data_insert(struct closure *cl); 38cafe5635SKent Overstreet 39cafe5635SKent Overstreet void bch_cached_dev_request_init(struct cached_dev *dc); 40*3e08773cSChristoph Hellwig void cached_dev_submit_bio(struct bio *bio); 41ff27668cSChristoph Hellwig 42cafe5635SKent Overstreet void bch_flash_dev_request_init(struct bcache_device *d); 43*3e08773cSChristoph Hellwig void flash_dev_submit_bio(struct bio *bio); 44cafe5635SKent Overstreet 453fd3c5c0SShenghui Wang extern struct kmem_cache *bch_search_cache; 46cafe5635SKent Overstreet 47cafe5635SKent Overstreet #endif /* _BCACHE_REQUEST_H_ */ 48