^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: GPL-2.0 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) #ifndef _BCACHE_REQUEST_H_
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) #define _BCACHE_REQUEST_H_
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) struct data_insert_op {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) struct closure cl;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) struct cache_set *c;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) struct bio *bio;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) struct workqueue_struct *wq;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) unsigned int inode;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) uint16_t write_point;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) uint16_t write_prio;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) blk_status_t status;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) union {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) uint16_t flags;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) struct {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) unsigned int bypass:1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) unsigned int writeback:1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) unsigned int flush_journal:1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) unsigned int csum:1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) unsigned int replace:1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) unsigned int replace_collision:1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) unsigned int insert_data_done:1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) struct keylist insert_keys;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) BKEY_PADDED(replace_key);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) unsigned int bch_get_congested(const struct cache_set *c);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) void bch_data_insert(struct closure *cl);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) void bch_cached_dev_request_init(struct cached_dev *dc);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) blk_qc_t cached_dev_submit_bio(struct bio *bio);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) void bch_flash_dev_request_init(struct bcache_device *d);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) blk_qc_t flash_dev_submit_bio(struct bio *bio);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) extern struct kmem_cache *bch_search_cache;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) #endif /* _BCACHE_REQUEST_H_ */