block: Abstract out bvec iterator
[deliverable/linux.git] / drivers / md / bcache / request.h
CommitLineData
cafe5635
KO
1#ifndef _BCACHE_REQUEST_H_
2#define _BCACHE_REQUEST_H_
3
4#include <linux/cgroup.h>
5
220bb38c 6struct data_insert_op {
cafe5635 7 struct closure cl;
c18536a7 8 struct cache_set *c;
220bb38c 9 struct bio *bio;
cafe5635 10
c18536a7 11 unsigned inode;
2599b53b 12 uint16_t write_point;
220bb38c
KO
13 uint16_t write_prio;
14 short error;
c18536a7 15
c18536a7 16 unsigned bypass:1;
220bb38c 17 unsigned writeback:1;
c18536a7 18 unsigned flush_journal:1;
220bb38c 19 unsigned csum:1;
c18536a7 20
1b207d80 21 unsigned replace:1;
220bb38c 22 unsigned replace_collision:1;
cafe5635 23
220bb38c 24 unsigned insert_data_done:1;
0b93207a
KO
25
26 /* Anything past this point won't get zeroed in search_alloc() */
27 struct keylist insert_keys;
1b207d80 28 BKEY_PADDED(replace_key);
cafe5635
KO
29};
30
c37511b8 31unsigned bch_get_congested(struct cache_set *);
a34a8bfd 32void bch_data_insert(struct closure *cl);
cafe5635 33
cafe5635
KO
34void bch_cached_dev_request_init(struct cached_dev *dc);
35void bch_flash_dev_request_init(struct bcache_device *d);
36
37extern struct kmem_cache *bch_search_cache, *bch_passthrough_cache;
38
39struct bch_cgroup {
40#ifdef CONFIG_CGROUP_BCACHE
41 struct cgroup_subsys_state css;
42#endif
43 /*
44 * We subtract one from the index into bch_cache_modes[], so that
45 * default == -1; this makes it so the rest match up with d->cache_mode,
46 * and we use d->cache_mode if cgrp->cache_mode < 0
47 */
48 short cache_mode;
49 bool verify;
50 struct cache_stat_collector stats;
51};
52
53struct bch_cgroup *bch_bio_to_cgroup(struct bio *bio);
54
55#endif /* _BCACHE_REQUEST_H_ */
This page took 0.062806 seconds and 5 git commands to generate.