Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

blk-ioprio: remove ioprio_blkcg_from_bio()

Currently, if config is enabled, then ioprio is always enabled by
default from blkcg_init_disk(), hence there is no point to check if
the policy is enabled from blkg in ioprio_blkcg_from_bio(). Hence remove
it and get blkcg directly from bio.

Signed-off-by: Yu Kuai <yukuai3@huawei.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Acked-by: Tejun Heo <tj@kernel.org>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Link: https://lore.kernel.org/r/20240719071506.158075-3-yukuai1@huaweicloud.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Yu Kuai and committed by
Jens Axboe
d0e92795 ae8650b4

+1 -11
+1 -11
block/blk-ioprio.c
··· 84 84 return blkcg_to_ioprio_blkcg(css_to_blkcg(css)); 85 85 } 86 86 87 - static struct ioprio_blkcg *ioprio_blkcg_from_bio(struct bio *bio) 88 - { 89 - struct blkg_policy_data *pd = blkg_to_pd(bio->bi_blkg, &ioprio_policy); 90 - 91 - if (!pd) 92 - return NULL; 93 - 94 - return blkcg_to_ioprio_blkcg(pd->blkg->blkcg); 95 - } 96 - 97 87 static int ioprio_show_prio_policy(struct seq_file *sf, void *v) 98 88 { 99 89 struct ioprio_blkcg *blkcg = ioprio_blkcg_from_css(seq_css(sf)); ··· 176 186 177 187 void blkcg_set_ioprio(struct bio *bio) 178 188 { 179 - struct ioprio_blkcg *blkcg = ioprio_blkcg_from_bio(bio); 189 + struct ioprio_blkcg *blkcg = blkcg_to_ioprio_blkcg(bio->bi_blkg->blkcg); 180 190 u16 prio; 181 191 182 192 if (!blkcg || blkcg->prio_policy == POLICY_NO_CHANGE)