diff options
author | Omar Sandoval <osandov@fb.com> | 2016-09-17 10:38:44 -0400 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2016-09-17 10:38:44 -0400 |
commit | 88459642cba452630326b9cab1c651e09577d4e4 (patch) | |
tree | cd7ecd917b294a92ff827b0e7dab526f0069547f /include/linux/blk-mq.h | |
parent | 703fd1c0f177219e3a84e6c095c31dc566514d81 (diff) |
blk-mq: abstract tag allocation out into sbitmap library
This is a generally useful data structure, so make it available to
anyone else who might want to use it. It's also a nice cleanup
separating the allocation logic from the rest of the tag handling logic.
The code is behind a new Kconfig option, CONFIG_SBITMAP, which is only
selected by CONFIG_BLOCK for now.
This should be a complete noop functionality-wise.
Signed-off-by: Omar Sandoval <osandov@fb.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'include/linux/blk-mq.h')
-rw-r--r-- | include/linux/blk-mq.h | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/include/linux/blk-mq.h b/include/linux/blk-mq.h index 60ef14cbcd2d..2575779cf13f 100644 --- a/include/linux/blk-mq.h +++ b/include/linux/blk-mq.h | |||
@@ -2,6 +2,7 @@ | |||
2 | #define BLK_MQ_H | 2 | #define BLK_MQ_H |
3 | 3 | ||
4 | #include <linux/blkdev.h> | 4 | #include <linux/blkdev.h> |
5 | #include <linux/sbitmap.h> | ||
5 | 6 | ||
6 | struct blk_mq_tags; | 7 | struct blk_mq_tags; |
7 | struct blk_flush_queue; | 8 | struct blk_flush_queue; |
@@ -12,12 +13,6 @@ struct blk_mq_cpu_notifier { | |||
12 | int (*notify)(void *data, unsigned long action, unsigned int cpu); | 13 | int (*notify)(void *data, unsigned long action, unsigned int cpu); |
13 | }; | 14 | }; |
14 | 15 | ||
15 | struct blk_mq_ctxmap { | ||
16 | unsigned int size; | ||
17 | unsigned int bits_per_word; | ||
18 | struct blk_align_bitmap *map; | ||
19 | }; | ||
20 | |||
21 | struct blk_mq_hw_ctx { | 16 | struct blk_mq_hw_ctx { |
22 | struct { | 17 | struct { |
23 | spinlock_t lock; | 18 | spinlock_t lock; |
@@ -37,7 +32,7 @@ struct blk_mq_hw_ctx { | |||
37 | 32 | ||
38 | void *driver_data; | 33 | void *driver_data; |
39 | 34 | ||
40 | struct blk_mq_ctxmap ctx_map; | 35 | struct sbitmap ctx_map; |
41 | 36 | ||
42 | struct blk_mq_ctx **ctxs; | 37 | struct blk_mq_ctx **ctxs; |
43 | unsigned int nr_ctx; | 38 | unsigned int nr_ctx; |