OSDN Git Service

block: Remove redundant parent blkcg_gp check in check_scale_change
authorKemeng Shi <shikemeng@huawei.com>
Tue, 18 Oct 2022 11:12:38 +0000 (19:12 +0800)
committerJens Axboe <axboe@kernel.dk>
Tue, 1 Nov 2022 15:12:24 +0000 (09:12 -0600)
Function blkcg_iolatency_throttle will make sure blkg->parent is not
NULL before calls check_scale_change. And function check_scale_change
is only called in blkcg_iolatency_throttle.

Signed-off-by: Kemeng Shi <shikemeng@huawei.com>
Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Link: https://lore.kernel.org/r/20221018111240.22612-2-shikemeng@huawei.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-iolatency.c

index 571fa95..b24d7b7 100644 (file)
@@ -403,9 +403,6 @@ static void check_scale_change(struct iolatency_grp *iolat)
        u64 scale_lat;
        int direction = 0;
 
-       if (lat_to_blkg(iolat)->parent == NULL)
-               return;
-
        parent = blkg_to_lat(lat_to_blkg(iolat)->parent);
        if (!parent)
                return;