diff options
Diffstat (limited to 'block/ll_rw_blk.c')
-rw-r--r-- | block/ll_rw_blk.c | 41 |
1 files changed, 17 insertions, 24 deletions
diff --git a/block/ll_rw_blk.c b/block/ll_rw_blk.c index 75c98d58f4dd..3b927be03850 100644 --- a/block/ll_rw_blk.c +++ b/block/ll_rw_blk.c @@ -1143,22 +1143,9 @@ EXPORT_SYMBOL(blk_queue_start_tag); void blk_queue_invalidate_tags(struct request_queue *q) { struct list_head *tmp, *n; - struct request *rq; - - list_for_each_safe(tmp, n, &q->tag_busy_list) { - rq = list_entry_rq(tmp); - if (rq->tag == -1) { - printk(KERN_ERR - "%s: bad tag found on list\n", __FUNCTION__); - list_del_init(&rq->queuelist); - rq->cmd_flags &= ~REQ_QUEUED; - } else - blk_queue_end_tag(q, rq); - - rq->cmd_flags &= ~REQ_STARTED; - __elv_add_request(q, rq, ELEVATOR_INSERT_BACK, 0); - } + list_for_each_safe(tmp, n, &q->tag_busy_list) + blk_requeue_request(q, list_entry_rq(tmp)); } EXPORT_SYMBOL(blk_queue_invalidate_tags); @@ -1634,15 +1621,7 @@ static void blk_backing_dev_unplug(struct backing_dev_info *bdi, { struct request_queue *q = bdi->unplug_io_data; - /* - * devices don't necessarily have an ->unplug_fn defined - */ - if (q->unplug_fn) { - blk_add_trace_pdu_int(q, BLK_TA_UNPLUG_IO, NULL, - q->rq.count[READ] + q->rq.count[WRITE]); - - q->unplug_fn(q); - } + blk_unplug(q); } static void blk_unplug_work(struct work_struct *work) @@ -1666,6 +1645,20 @@ static void blk_unplug_timeout(unsigned long data) kblockd_schedule_work(&q->unplug_work); } +void blk_unplug(struct request_queue *q) +{ + /* + * devices don't necessarily have an ->unplug_fn defined + */ + if (q->unplug_fn) { + blk_add_trace_pdu_int(q, BLK_TA_UNPLUG_IO, NULL, + q->rq.count[READ] + q->rq.count[WRITE]); + + q->unplug_fn(q); + } +} +EXPORT_SYMBOL(blk_unplug); + /** * blk_start_queue - restart a previously stopped queue * @q: The &struct request_queue in question |