blk-mq: return if queue is frozen via current blk_freeze_queue_start
We need this return value in the following patch to decide if a explicit synchronize_rcu() is needed. Change-Id: I75559b7ec1dee4df607fd3e67abc6954b656edf4 Cc: Bart Van Assche <Bart.VanAssche@wdc.com> Signed-off-by: Ming Lei <ming.lei@redhat.com> Patch-mainline: linux-block@vger.kernel.org @ 03/10/2017, 22:04 Signed-off-by: Pradeep P V K <ppvk@codeaurora.org>
This commit is contained in:
committed by
Gerrit - the friendly Code Review server
parent
fc3784cba4
commit
0bb3f8652d
@@ -137,7 +137,7 @@ void blk_mq_in_flight_rw(struct request_queue *q, struct hd_struct *part,
|
||||
blk_mq_queue_tag_busy_iter(q, blk_mq_check_inflight_rw, &mi);
|
||||
}
|
||||
|
||||
void blk_freeze_queue_start(struct request_queue *q)
|
||||
bool blk_freeze_queue_start(struct request_queue *q)
|
||||
{
|
||||
int freeze_depth;
|
||||
|
||||
@@ -146,7 +146,9 @@ void blk_freeze_queue_start(struct request_queue *q)
|
||||
percpu_ref_kill(&q->q_usage_counter);
|
||||
if (q->mq_ops)
|
||||
blk_mq_run_hw_queues(q, false);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(blk_freeze_queue_start);
|
||||
|
||||
@@ -169,7 +171,7 @@ EXPORT_SYMBOL_GPL(blk_mq_freeze_queue_wait_timeout);
|
||||
* Guarantee no request is in use, so we can change any data structure of
|
||||
* the queue afterward.
|
||||
*/
|
||||
void blk_freeze_queue(struct request_queue *q)
|
||||
bool blk_freeze_queue(struct request_queue *q)
|
||||
{
|
||||
/*
|
||||
* In the !blk_mq case we are only calling this to kill the
|
||||
@@ -178,19 +180,20 @@ void blk_freeze_queue(struct request_queue *q)
|
||||
* no blk_unfreeze_queue(), and blk_freeze_queue() is not
|
||||
* exported to drivers as the only user for unfreeze is blk_mq.
|
||||
*/
|
||||
blk_freeze_queue_start(q);
|
||||
bool ret = blk_freeze_queue_start(q);
|
||||
if (!q->mq_ops)
|
||||
blk_drain_queue(q);
|
||||
blk_mq_freeze_queue_wait(q);
|
||||
return ret;
|
||||
}
|
||||
|
||||
void blk_mq_freeze_queue(struct request_queue *q)
|
||||
bool blk_mq_freeze_queue(struct request_queue *q)
|
||||
{
|
||||
/*
|
||||
* ...just an alias to keep freeze and unfreeze actions balanced
|
||||
* in the blk_mq_* namespace
|
||||
*/
|
||||
blk_freeze_queue(q);
|
||||
return blk_freeze_queue(q);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(blk_mq_freeze_queue);
|
||||
|
||||
|
||||
@@ -27,7 +27,6 @@ struct blk_mq_ctx {
|
||||
} ____cacheline_aligned_in_smp;
|
||||
|
||||
void blk_mq_run_hw_queue(struct blk_mq_hw_ctx *hctx, bool async);
|
||||
void blk_mq_freeze_queue(struct request_queue *q);
|
||||
void blk_mq_free_queue(struct request_queue *q);
|
||||
int blk_mq_update_nr_requests(struct request_queue *q, unsigned int nr);
|
||||
void blk_mq_wake_waiters(struct request_queue *q);
|
||||
|
||||
@@ -66,7 +66,7 @@ void blk_rq_bio_prep(struct request_queue *q, struct request *rq,
|
||||
void blk_queue_bypass_start(struct request_queue *q);
|
||||
void blk_queue_bypass_end(struct request_queue *q);
|
||||
void __blk_queue_free_tags(struct request_queue *q);
|
||||
void blk_freeze_queue(struct request_queue *q);
|
||||
bool blk_freeze_queue(struct request_queue *q);
|
||||
|
||||
static inline void blk_queue_enter_live(struct request_queue *q)
|
||||
{
|
||||
|
||||
@@ -254,9 +254,9 @@ void blk_mq_run_hw_queues(struct request_queue *q, bool async);
|
||||
void blk_mq_delay_queue(struct blk_mq_hw_ctx *hctx, unsigned long msecs);
|
||||
void blk_mq_tagset_busy_iter(struct blk_mq_tag_set *tagset,
|
||||
busy_tag_iter_fn *fn, void *priv);
|
||||
void blk_mq_freeze_queue(struct request_queue *q);
|
||||
bool blk_mq_freeze_queue(struct request_queue *q);
|
||||
void blk_mq_unfreeze_queue(struct request_queue *q);
|
||||
void blk_freeze_queue_start(struct request_queue *q);
|
||||
bool blk_freeze_queue_start(struct request_queue *q);
|
||||
void blk_mq_freeze_queue_wait(struct request_queue *q);
|
||||
int blk_mq_freeze_queue_wait_timeout(struct request_queue *q,
|
||||
unsigned long timeout);
|
||||
|
||||
Reference in New Issue
Block a user