Skip to content

Commit d0e9279

Browse files
YuKuai-huaweiaxboe
authored andcommitted
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 <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Acked-by: Tejun Heo <[email protected]> Reviewed-by: Bart Van Assche <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
1 parent ae8650b commit d0e9279

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

block/blk-ioprio.c

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -84,16 +84,6 @@ ioprio_blkcg_from_css(struct cgroup_subsys_state *css)
8484
return blkcg_to_ioprio_blkcg(css_to_blkcg(css));
8585
}
8686

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-
9787
static int ioprio_show_prio_policy(struct seq_file *sf, void *v)
9888
{
9989
struct ioprio_blkcg *blkcg = ioprio_blkcg_from_css(seq_css(sf));
@@ -186,7 +176,7 @@ static struct blkcg_policy ioprio_policy = {
186176

187177
void blkcg_set_ioprio(struct bio *bio)
188178
{
189-
struct ioprio_blkcg *blkcg = ioprio_blkcg_from_bio(bio);
179+
struct ioprio_blkcg *blkcg = blkcg_to_ioprio_blkcg(bio->bi_blkg->blkcg);
190180
u16 prio;
191181

192182
if (!blkcg || blkcg->prio_policy == POLICY_NO_CHANGE)

0 commit comments

Comments
 (0)