From: Alan D. Brunelle Update cached leftmost every time it is found. Signed-off-by: Alan D. Brunelle --- block/cfq-iosched.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c index 8093733..a86a7c3 100644 --- a/block/cfq-iosched.c +++ b/block/cfq-iosched.c @@ -388,10 +388,10 @@ cfq_choose_req(struct cfq_data *cfqd, struct request *rq1, struct request *rq2) */ static struct rb_node *cfq_rb_first(struct cfq_rb_root *root) { - if (root->left) - return root->left; + if (!root->left) + root->left = rb_first(&root->rb); - return rb_first(&root->rb); + return root->left; } static void cfq_rb_erase(struct rb_node *n, struct cfq_rb_root *root)