Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
[linux/fpc-iii.git] / block / blk-mq.h
blob5c3917984b005f13ea35254074744ec91f2e5bd3
1 #ifndef INT_BLK_MQ_H
2 #define INT_BLK_MQ_H
4 struct blk_mq_ctx {
5 struct {
6 spinlock_t lock;
7 struct list_head rq_list;
8 } ____cacheline_aligned_in_smp;
10 unsigned int cpu;
11 unsigned int index_hw;
12 unsigned int ipi_redirect;
14 /* incremented at dispatch time */
15 unsigned long rq_dispatched[2];
16 unsigned long rq_merged;
18 /* incremented at completion time */
19 unsigned long ____cacheline_aligned_in_smp rq_completed[2];
21 struct request_queue *queue;
22 struct kobject kobj;
25 void __blk_mq_end_io(struct request *rq, int error);
26 void blk_mq_complete_request(struct request *rq, int error);
27 void blk_mq_run_request(struct request *rq, bool run_queue, bool async);
28 void blk_mq_run_hw_queue(struct blk_mq_hw_ctx *hctx, bool async);
29 void blk_mq_init_flush(struct request_queue *q);
30 void blk_mq_drain_queue(struct request_queue *q);
31 void blk_mq_free_queue(struct request_queue *q);
34 * CPU hotplug helpers
36 struct blk_mq_cpu_notifier;
37 void blk_mq_init_cpu_notifier(struct blk_mq_cpu_notifier *notifier,
38 void (*fn)(void *, unsigned long, unsigned int),
39 void *data);
40 void blk_mq_register_cpu_notifier(struct blk_mq_cpu_notifier *notifier);
41 void blk_mq_unregister_cpu_notifier(struct blk_mq_cpu_notifier *notifier);
42 void blk_mq_cpu_init(void);
45 * CPU -> queue mappings
47 struct blk_mq_reg;
48 extern unsigned int *blk_mq_make_queue_map(struct blk_mq_reg *reg);
49 extern int blk_mq_update_queue_map(unsigned int *map, unsigned int nr_queues);
51 void blk_mq_add_timer(struct request *rq);
53 #endif