1 #ifndef _BCACHE_REQUEST_H_
2 #define _BCACHE_REQUEST_H_
4 #include <linux/cgroup.h>
7 /* Stack frame for bio_complete */
10 struct bcache_device
*d
;
11 struct task_struct
*task
;
15 struct bio
*cache_miss
;
16 unsigned cache_bio_sectors
;
18 unsigned recoverable
:1;
19 unsigned unaligned_bvec
:1;
24 /* IO error returned to s->bio */
26 unsigned long start_time
;
28 /* Anything past op->keys won't get zeroed in do_bio_hook */
32 void bch_cache_read_endio(struct bio
*, int);
33 unsigned bch_get_congested(struct cache_set
*);
34 void bch_insert_data(struct closure
*cl
);
35 void bch_btree_insert_async(struct closure
*);
36 void bch_cache_read_endio(struct bio
*, int);
38 void bch_open_buckets_free(struct cache_set
*);
39 int bch_open_buckets_alloc(struct cache_set
*);
41 void bch_cached_dev_request_init(struct cached_dev
*dc
);
42 void bch_flash_dev_request_init(struct bcache_device
*d
);
44 extern struct kmem_cache
*bch_search_cache
, *bch_passthrough_cache
;
47 #ifdef CONFIG_CGROUP_BCACHE
48 struct cgroup_subsys_state css
;
51 * We subtract one from the index into bch_cache_modes[], so that
52 * default == -1; this makes it so the rest match up with d->cache_mode,
53 * and we use d->cache_mode if cgrp->cache_mode < 0
57 struct cache_stat_collector stats
;
60 struct bch_cgroup
*bch_bio_to_cgroup(struct bio
*bio
);
62 #endif /* _BCACHE_REQUEST_H_ */