diff options
-rw-r--r-- | block/cfq-iosched.c | 37 |
1 files changed, 21 insertions, 16 deletions
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c index 833ec18eaa63..c760ae7019dd 100644 --- a/block/cfq-iosched.c +++ b/block/cfq-iosched.c | |||
@@ -1641,6 +1641,26 @@ static void cfq_ioc_set_ioprio(struct io_context *ioc) | |||
1641 | ioc->ioprio_changed = 0; | 1641 | ioc->ioprio_changed = 0; |
1642 | } | 1642 | } |
1643 | 1643 | ||
1644 | static void cfq_init_cfqq(struct cfq_data *cfqd, struct cfq_queue *cfqq, | ||
1645 | pid_t pid, int is_sync) | ||
1646 | { | ||
1647 | RB_CLEAR_NODE(&cfqq->rb_node); | ||
1648 | RB_CLEAR_NODE(&cfqq->p_node); | ||
1649 | INIT_LIST_HEAD(&cfqq->fifo); | ||
1650 | |||
1651 | atomic_set(&cfqq->ref, 0); | ||
1652 | cfqq->cfqd = cfqd; | ||
1653 | |||
1654 | cfq_mark_cfqq_prio_changed(cfqq); | ||
1655 | |||
1656 | if (is_sync) { | ||
1657 | if (!cfq_class_idle(cfqq)) | ||
1658 | cfq_mark_cfqq_idle_window(cfqq); | ||
1659 | cfq_mark_cfqq_sync(cfqq); | ||
1660 | } | ||
1661 | cfqq->pid = pid; | ||
1662 | } | ||
1663 | |||
1644 | static struct cfq_queue * | 1664 | static struct cfq_queue * |
1645 | cfq_find_alloc_queue(struct cfq_data *cfqd, int is_sync, | 1665 | cfq_find_alloc_queue(struct cfq_data *cfqd, int is_sync, |
1646 | struct io_context *ioc, gfp_t gfp_mask) | 1666 | struct io_context *ioc, gfp_t gfp_mask) |
@@ -1678,23 +1698,8 @@ retry: | |||
1678 | goto out; | 1698 | goto out; |
1679 | } | 1699 | } |
1680 | 1700 | ||
1681 | RB_CLEAR_NODE(&cfqq->rb_node); | 1701 | cfq_init_cfqq(cfqd, cfqq, current->pid, is_sync); |
1682 | RB_CLEAR_NODE(&cfqq->p_node); | ||
1683 | INIT_LIST_HEAD(&cfqq->fifo); | ||
1684 | |||
1685 | atomic_set(&cfqq->ref, 0); | ||
1686 | cfqq->cfqd = cfqd; | ||
1687 | |||
1688 | cfq_mark_cfqq_prio_changed(cfqq); | ||
1689 | |||
1690 | cfq_init_prio_data(cfqq, ioc); | 1702 | cfq_init_prio_data(cfqq, ioc); |
1691 | |||
1692 | if (is_sync) { | ||
1693 | if (!cfq_class_idle(cfqq)) | ||
1694 | cfq_mark_cfqq_idle_window(cfqq); | ||
1695 | cfq_mark_cfqq_sync(cfqq); | ||
1696 | } | ||
1697 | cfqq->pid = current->pid; | ||
1698 | cfq_log_cfqq(cfqd, cfqq, "alloced"); | 1703 | cfq_log_cfqq(cfqd, cfqq, "alloced"); |
1699 | } | 1704 | } |
1700 | 1705 | ||