diff options
Diffstat (limited to 'block/cfq-iosched.c')
-rw-r--r-- | block/cfq-iosched.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c index c62bb2e650b8..e91093d0c0eb 100644 --- a/block/cfq-iosched.c +++ b/block/cfq-iosched.c | |||
@@ -3731,8 +3731,8 @@ cfq_get_queue(struct cfq_data *cfqd, bool is_sync, struct cfq_io_cq *cic, | |||
3731 | { | 3731 | { |
3732 | int ioprio_class = IOPRIO_PRIO_CLASS(cic->ioprio); | 3732 | int ioprio_class = IOPRIO_PRIO_CLASS(cic->ioprio); |
3733 | int ioprio = IOPRIO_PRIO_DATA(cic->ioprio); | 3733 | int ioprio = IOPRIO_PRIO_DATA(cic->ioprio); |
3734 | struct cfq_queue **async_cfqq = NULL; | 3734 | struct cfq_queue **async_cfqq; |
3735 | struct cfq_queue *cfqq = NULL; | 3735 | struct cfq_queue *cfqq; |
3736 | 3736 | ||
3737 | if (!is_sync) { | 3737 | if (!is_sync) { |
3738 | if (!ioprio_valid(cic->ioprio)) { | 3738 | if (!ioprio_valid(cic->ioprio)) { |
@@ -3742,19 +3742,20 @@ cfq_get_queue(struct cfq_data *cfqd, bool is_sync, struct cfq_io_cq *cic, | |||
3742 | } | 3742 | } |
3743 | async_cfqq = cfq_async_queue_prio(cfqd, ioprio_class, ioprio); | 3743 | async_cfqq = cfq_async_queue_prio(cfqd, ioprio_class, ioprio); |
3744 | cfqq = *async_cfqq; | 3744 | cfqq = *async_cfqq; |
3745 | if (cfqq) | ||
3746 | goto out; | ||
3745 | } | 3747 | } |
3746 | 3748 | ||
3747 | if (!cfqq) | 3749 | cfqq = cfq_find_alloc_queue(cfqd, is_sync, cic, bio, gfp_mask); |
3748 | cfqq = cfq_find_alloc_queue(cfqd, is_sync, cic, bio, gfp_mask); | ||
3749 | 3750 | ||
3750 | /* | 3751 | /* |
3751 | * pin the queue now that it's allocated, scheduler exit will prune it | 3752 | * pin the queue now that it's allocated, scheduler exit will prune it |
3752 | */ | 3753 | */ |
3753 | if (!is_sync && !(*async_cfqq)) { | 3754 | if (!is_sync) { |
3754 | cfqq->ref++; | 3755 | cfqq->ref++; |
3755 | *async_cfqq = cfqq; | 3756 | *async_cfqq = cfqq; |
3756 | } | 3757 | } |
3757 | 3758 | out: | |
3758 | cfqq->ref++; | 3759 | cfqq->ref++; |
3759 | return cfqq; | 3760 | return cfqq; |
3760 | } | 3761 | } |