request.h 895 字节
Newer Older
1
/* SPDX-License-Identifier: GPL-2.0 */
K
Kent Overstreet 已提交
2 3 4
#ifndef _BCACHE_REQUEST_H_
#define _BCACHE_REQUEST_H_

K
Kent Overstreet 已提交
5
struct data_insert_op {
K
Kent Overstreet 已提交
6
	struct closure		cl;
K
Kent Overstreet 已提交
7
	struct cache_set	*c;
K
Kent Overstreet 已提交
8
	struct bio		*bio;
9
	struct workqueue_struct *wq;
K
Kent Overstreet 已提交
10

K
Kent Overstreet 已提交
11
	unsigned		inode;
12
	uint16_t		write_point;
K
Kent Overstreet 已提交
13
	uint16_t		write_prio;
14
	blk_status_t		status;
K
Kent Overstreet 已提交
15

K
Kent Overstreet 已提交
16 17
	union {
		uint16_t	flags;
K
Kent Overstreet 已提交
18

K
Kent Overstreet 已提交
19 20 21 22 23
	struct {
		unsigned	bypass:1;
		unsigned	writeback:1;
		unsigned	flush_journal:1;
		unsigned	csum:1;
K
Kent Overstreet 已提交
24

K
Kent Overstreet 已提交
25 26 27 28 29 30
		unsigned	replace:1;
		unsigned	replace_collision:1;

		unsigned	insert_data_done:1;
	};
	};
31 32

	struct keylist		insert_keys;
K
Kent Overstreet 已提交
33
	BKEY_PADDED(replace_key);
K
Kent Overstreet 已提交
34 35
};

K
Kent Overstreet 已提交
36
unsigned bch_get_congested(struct cache_set *);
37
void bch_data_insert(struct closure *cl);
K
Kent Overstreet 已提交
38 39 40 41 42 43 44

void bch_cached_dev_request_init(struct cached_dev *dc);
void bch_flash_dev_request_init(struct bcache_device *d);

extern struct kmem_cache *bch_search_cache, *bch_passthrough_cache;

#endif /* _BCACHE_REQUEST_H_ */