]> git.baikalelectronics.ru Git - kernel.git/commitdiff
blk-throttle: use 'READ/WRITE' instead of '0/1'
authorYu Kuai <yukuai3@huawei.com>
Sat, 27 Aug 2022 10:16:35 +0000 (18:16 +0800)
committerJens Axboe <axboe@kernel.dk>
Mon, 12 Sep 2022 06:20:07 +0000 (00:20 -0600)
Make the code easier to read, like everywhere else.

Signed-off-by: Yu Kuai <yukuai3@huawei.com>
Acked-by: Tejun Heo <tj@kernel.org>
Link: https://lore.kernel.org/r/20220827101637.1775111-2-yukuai1@huaweicloud.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-throttle.c

index d392f355977e02ad5c32c2ac82a2ebccdd919e29..27d46a7d309b3545b0b6280d67233fa553d3b567 100644 (file)
@@ -329,8 +329,8 @@ static struct bio *throtl_pop_queued(struct list_head *queued,
 /* init a service_queue, assumes the caller zeroed it */
 static void throtl_service_queue_init(struct throtl_service_queue *sq)
 {
-       INIT_LIST_HEAD(&sq->queued[0]);
-       INIT_LIST_HEAD(&sq->queued[1]);
+       INIT_LIST_HEAD(&sq->queued[READ]);
+       INIT_LIST_HEAD(&sq->queued[WRITE]);
        sq->pending_tree = RB_ROOT_CACHED;
        timer_setup(&sq->pending_timer, throtl_pending_timer_fn, 0);
 }
@@ -1151,7 +1151,7 @@ static int throtl_select_dispatch(struct throtl_service_queue *parent_sq)
                nr_disp += throtl_dispatch_tg(tg);
 
                sq = &tg->service_queue;
-               if (sq->nr_queued[0] || sq->nr_queued[1])
+               if (sq->nr_queued[READ] || sq->nr_queued[WRITE])
                        tg_update_disptime(tg);
 
                if (nr_disp >= THROTL_QUANTUM)