aboutsummaryrefslogtreecommitdiffstats
path: root/block/blk-mq-tag.h
diff options
context:
space:
mode:
authorJohn Garry <john.garry@huawei.com>2021-05-13 20:00:57 +0800
committerJens Axboe <axboe@kernel.dk>2021-05-24 06:47:22 -0600
commit56b68085e536eff2676108f2f8356889a7dbbf55 (patch)
tree25c19953b9d01908ba2a15253d34efdae66e5b57 /block/blk-mq-tag.h
parentblk-mq: clearing flush request reference in tags->rqs[] (diff)
downloadlinux-dev-56b68085e536eff2676108f2f8356889a7dbbf55.tar.xz
linux-dev-56b68085e536eff2676108f2f8356889a7dbbf55.zip
blk-mq: Some tag allocation code refactoring
The tag allocation code to alloc the sbitmap pairs is common for regular bitmaps tags and shared sbitmap, so refactor into a common function. Also remove superfluous "flags" argument from blk_mq_init_shared_sbitmap(). Signed-off-by: John Garry <john.garry@huawei.com> Reviewed-by: Ming Lei <ming.lei@redhat.com> Link: https://lore.kernel.org/r/1620907258-30910-2-git-send-email-john.garry@huawei.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/blk-mq-tag.h')
-rw-r--r--block/blk-mq-tag.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/block/blk-mq-tag.h b/block/blk-mq-tag.h
index f887988e5ef6..8ed55af08427 100644
--- a/block/blk-mq-tag.h
+++ b/block/blk-mq-tag.h
@@ -32,11 +32,14 @@ extern struct blk_mq_tags *blk_mq_init_tags(unsigned int nr_tags,
unsigned int reserved_tags,
int node, unsigned int flags);
extern void blk_mq_free_tags(struct blk_mq_tags *tags, unsigned int flags);
+extern int blk_mq_init_bitmaps(struct sbitmap_queue *bitmap_tags,
+ struct sbitmap_queue *breserved_tags,
+ unsigned int queue_depth,
+ unsigned int reserved,
+ int node, int alloc_policy);
-extern int blk_mq_init_shared_sbitmap(struct blk_mq_tag_set *set,
- unsigned int flags);
+extern int blk_mq_init_shared_sbitmap(struct blk_mq_tag_set *set);
extern void blk_mq_exit_shared_sbitmap(struct blk_mq_tag_set *set);
-
extern unsigned int blk_mq_get_tag(struct blk_mq_alloc_data *data);
extern void blk_mq_put_tag(struct blk_mq_tags *tags, struct blk_mq_ctx *ctx,
unsigned int tag);