aboutsummaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
authorJens Axboe <axboe@fb.com>2014-04-29 20:49:48 -0600
committerJens Axboe <axboe@fb.com>2014-04-29 20:49:48 -0600
commit5810d903fa3459e703ce82a1d45136813c6afad8 (patch)
treeef916e48f6bced5a29de12ce29da9fa7e7b13ac4 /block
parentbdcfa3e57c9d92b082d2378bc9a64a3a8750fa8d (diff)
blk-mq: fix waiting for reserved tags
blk_mq_wait_for_tags() is only able to wait for "normal" tags, not reserved tags. Pass in which one we should attempt to get a tag for, so that waiting for reserved tags will work. Reserved tags are used for internal commands, which are usually serialized. Hence no waiting generally takes place, but we should ensure that it actually works if users need that functionality. Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'block')
-rw-r--r--block/blk-mq-tag.c4
-rw-r--r--block/blk-mq-tag.h2
-rw-r--r--block/blk-mq.c2
3 files changed, 4 insertions, 4 deletions
diff --git a/block/blk-mq-tag.c b/block/blk-mq-tag.c
index 7a799c46c32..1f43d6ee956 100644
--- a/block/blk-mq-tag.c
+++ b/block/blk-mq-tag.c
@@ -6,9 +6,9 @@
#include "blk-mq.h"
#include "blk-mq-tag.h"
-void blk_mq_wait_for_tags(struct blk_mq_tags *tags)
+void blk_mq_wait_for_tags(struct blk_mq_tags *tags, bool reserved)
{
- int tag = blk_mq_get_tag(tags, __GFP_WAIT, false);
+ int tag = blk_mq_get_tag(tags, __GFP_WAIT, reserved);
blk_mq_put_tag(tags, tag);
}
diff --git a/block/blk-mq-tag.h b/block/blk-mq-tag.h
index b602e3fa66e..c8e0645ea33 100644
--- a/block/blk-mq-tag.h
+++ b/block/blk-mq-tag.h
@@ -24,7 +24,7 @@ extern struct blk_mq_tags *blk_mq_init_tags(unsigned int nr_tags, unsigned int r
extern void blk_mq_free_tags(struct blk_mq_tags *tags);
extern unsigned int blk_mq_get_tag(struct blk_mq_tags *tags, gfp_t gfp, bool reserved);
-extern void blk_mq_wait_for_tags(struct blk_mq_tags *tags);
+extern void blk_mq_wait_for_tags(struct blk_mq_tags *tags, bool reserved);
extern void blk_mq_put_tag(struct blk_mq_tags *tags, unsigned int tag);
extern void blk_mq_tag_busy_iter(struct blk_mq_tags *tags, void (*fn)(void *data, unsigned long *), void *data);
extern bool blk_mq_has_free_tags(struct blk_mq_tags *tags);
diff --git a/block/blk-mq.c b/block/blk-mq.c
index f2e92eb9280..0aee3256821 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -218,7 +218,7 @@ static struct request *blk_mq_alloc_request_pinned(struct request_queue *q,
break;
}
- blk_mq_wait_for_tags(hctx->tags);
+ blk_mq_wait_for_tags(hctx->tags, reserved);
} while (1);
return rq;