Skip to content

Commit

Permalink
blk-cgroup: cleanup blkcg_maybe_throttle_current
Browse files Browse the repository at this point in the history
Use blkcg_css instead of opencoding it.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: Tejun Heo <tj@kernel.org>
Link: https://lore.kernel.org/r/20220420042723.1010598-15-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
Christoph Hellwig authored and axboe committed May 2, 2022
1 parent d200ca1 commit 8277825
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions block/blk-cgroup.c
Original file line number Diff line number Diff line change
Expand Up @@ -1808,7 +1808,6 @@ static void blkcg_maybe_throttle_blkg(struct blkcg_gq *blkg, bool use_memdelay)
void blkcg_maybe_throttle_current(void)
{
struct request_queue *q = current->throttle_queue;
struct cgroup_subsys_state *css;
struct blkcg *blkcg;
struct blkcg_gq *blkg;
bool use_memdelay = current->use_memdelay;
Expand All @@ -1820,12 +1819,7 @@ void blkcg_maybe_throttle_current(void)
current->use_memdelay = false;

rcu_read_lock();
css = kthread_blkcg();
if (css)
blkcg = css_to_blkcg(css);
else
blkcg = css_to_blkcg(task_css(current, io_cgrp_id));

blkcg = css_to_blkcg(blkcg_css());
if (!blkcg)
goto out;
blkg = blkg_lookup(blkcg, q);
Expand Down

0 comments on commit 8277825

Please sign in to comment.