Commit 29379674 authored by Baolin Wang's avatar Baolin Wang Committed by Jens Axboe

blk-throttle: Open code __throtl_de/enqueue_tg()

The __throtl_de/enqueue_tg() functions are only be called by
throtl_de/enqueue_tg(), thus we can just open code them to
make code more readable.
Signed-off-by: default avatarBaolin Wang <baolin.wang@linux.alibaba.com>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 2397611a
...@@ -691,29 +691,21 @@ static void tg_service_queue_add(struct throtl_grp *tg) ...@@ -691,29 +691,21 @@ static void tg_service_queue_add(struct throtl_grp *tg)
leftmost); leftmost);
} }
static void __throtl_enqueue_tg(struct throtl_grp *tg)
{
tg_service_queue_add(tg);
tg->flags |= THROTL_TG_PENDING;
tg->service_queue.parent_sq->nr_pending++;
}
static void throtl_enqueue_tg(struct throtl_grp *tg) static void throtl_enqueue_tg(struct throtl_grp *tg)
{ {
if (!(tg->flags & THROTL_TG_PENDING)) if (!(tg->flags & THROTL_TG_PENDING)) {
__throtl_enqueue_tg(tg); tg_service_queue_add(tg);
} tg->flags |= THROTL_TG_PENDING;
tg->service_queue.parent_sq->nr_pending++;
static void __throtl_dequeue_tg(struct throtl_grp *tg) }
{
throtl_rb_erase(&tg->rb_node, tg->service_queue.parent_sq);
tg->flags &= ~THROTL_TG_PENDING;
} }
static void throtl_dequeue_tg(struct throtl_grp *tg) static void throtl_dequeue_tg(struct throtl_grp *tg)
{ {
if (tg->flags & THROTL_TG_PENDING) if (tg->flags & THROTL_TG_PENDING) {
__throtl_dequeue_tg(tg); throtl_rb_erase(&tg->rb_node, tg->service_queue.parent_sq);
tg->flags &= ~THROTL_TG_PENDING;
}
} }
/* Call with queue lock held */ /* Call with queue lock held */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment