block, bfq: don't declare 'bfqd' as type 'void *' in bfq_group
authorYu Kuai <yukuai3@huawei.com>
Wed, 2 Nov 2022 02:25:42 +0000 (10:25 +0800)
committerJens Axboe <axboe@kernel.dk>
Wed, 2 Nov 2022 02:10:55 +0000 (20:10 -0600)
Prevent unnecessary format conversion for bfqg->bfqd in multiple
places.

Signed-off-by: Yu Kuai <yukuai3@huawei.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Acked-by: Paolo Valente <paolo.valente@unimore.it>
Link: https://lore.kernel.org/r/20221102022542.3621219-6-yukuai1@huaweicloud.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/bfq-cgroup.c
block/bfq-iosched.h
block/bfq-wf2q.c

index 4c37398..d57872c 100644 (file)
@@ -224,7 +224,7 @@ void bfqg_stats_update_io_add(struct bfq_group *bfqg, struct bfq_queue *bfqq,
 {
        blkg_rwstat_add(&bfqg->stats.queued, opf, 1);
        bfqg_stats_end_empty_time(&bfqg->stats);
-       if (!(bfqq == ((struct bfq_data *)bfqg->bfqd)->in_service_queue))
+       if (!(bfqq == bfqg->bfqd->in_service_queue))
                bfqg_stats_set_start_group_wait_time(bfqg, bfqq_group(bfqq));
 }
 
index 7636384..9fa8957 100644 (file)
@@ -931,7 +931,7 @@ struct bfq_group {
        struct bfq_entity entity;
        struct bfq_sched_data sched_data;
 
-       void *bfqd;
+       struct bfq_data *bfqd;
 
        struct bfq_queue *async_bfqq[2][IOPRIO_NR_LEVELS];
        struct bfq_queue *async_idle_bfqq;
index 4d4b84e..b02b536 100644 (file)
@@ -222,9 +222,8 @@ static void bfq_inc_active_entities(struct bfq_entity *entity)
 {
        struct bfq_sched_data *sd = entity->sched_data;
        struct bfq_group *bfqg = container_of(sd, struct bfq_group, sched_data);
-       struct bfq_data *bfqd = (struct bfq_data *)bfqg->bfqd;
 
-       if (bfqg != bfqd->root_group)
+       if (bfqg != bfqg->bfqd->root_group)
                bfqg->active_entities++;
 }
 
@@ -232,9 +231,8 @@ static void bfq_dec_active_entities(struct bfq_entity *entity)
 {
        struct bfq_sched_data *sd = entity->sched_data;
        struct bfq_group *bfqg = container_of(sd, struct bfq_group, sched_data);
-       struct bfq_data *bfqd = (struct bfq_data *)bfqg->bfqd;
 
-       if (bfqg != bfqd->root_group)
+       if (bfqg != bfqg->bfqd->root_group)
                bfqg->active_entities--;
 }