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