Commit d0e92795 authored by Yu Kuai's avatar Yu Kuai Committed by Jens Axboe

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: default avatarYu Kuai <yukuai3@huawei.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Acked-by: default avatarTejun Heo <tj@kernel.org>
Reviewed-by: default avatarBart Van Assche <bvanassche@acm.org>
Link: https://lore.kernel.org/r/20240719071506.158075-3-yukuai1@huaweicloud.comSigned-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent ae8650b4
...@@ -84,16 +84,6 @@ ioprio_blkcg_from_css(struct cgroup_subsys_state *css) ...@@ -84,16 +84,6 @@ ioprio_blkcg_from_css(struct cgroup_subsys_state *css)
return blkcg_to_ioprio_blkcg(css_to_blkcg(css)); return blkcg_to_ioprio_blkcg(css_to_blkcg(css));
} }
static struct ioprio_blkcg *ioprio_blkcg_from_bio(struct bio *bio)
{
struct blkg_policy_data *pd = blkg_to_pd(bio->bi_blkg, &ioprio_policy);
if (!pd)
return NULL;
return blkcg_to_ioprio_blkcg(pd->blkg->blkcg);
}
static int ioprio_show_prio_policy(struct seq_file *sf, void *v) static int ioprio_show_prio_policy(struct seq_file *sf, void *v)
{ {
struct ioprio_blkcg *blkcg = ioprio_blkcg_from_css(seq_css(sf)); struct ioprio_blkcg *blkcg = ioprio_blkcg_from_css(seq_css(sf));
...@@ -186,7 +176,7 @@ static struct blkcg_policy ioprio_policy = { ...@@ -186,7 +176,7 @@ static struct blkcg_policy ioprio_policy = {
void blkcg_set_ioprio(struct bio *bio) void blkcg_set_ioprio(struct bio *bio)
{ {
struct ioprio_blkcg *blkcg = ioprio_blkcg_from_bio(bio); struct ioprio_blkcg *blkcg = blkcg_to_ioprio_blkcg(bio->bi_blkg->blkcg);
u16 prio; u16 prio;
if (!blkcg || blkcg->prio_policy == POLICY_NO_CHANGE) if (!blkcg || blkcg->prio_policy == POLICY_NO_CHANGE)
......
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