/*- * Currently put the group at the end. Later implement something- * so that groups get lesser vtime based on their weights, so that- * if group does not loose all if it was not continously backlogged.+ * Enqueue this group and its ancestors onto their service tree. */- n = rb_last(&st->rb);- if (n) {- __cfqe = rb_entry_entity(n);- cfqe->vdisktime = __cfqe->vdisktime + CFQ_IDLE_DELAY;- } else- cfqe->vdisktime = st->min_vdisktime;+ while (cfqe) {+ if (!RB_EMPTY_NODE(&cfqe->rb_node))+ return;

- /* If there are other cfq queues under this group, don't delete it */- if (cfqg->nr_cfqq)+ /*+ * If there are other cfq queues under this group, or there are other+ * cfq groups under this group, don't delete it.+ */+ if (cfqg->nr_cfqq || cfqg->nr_subgp) return;