Commit 82778259 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Jens Axboe

blk-cgroup: cleanup blkcg_maybe_throttle_current

Use blkcg_css instead of opencoding it.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Acked-by: default avatarTejun Heo <tj@kernel.org>
Link: https://lore.kernel.org/r/20220420042723.1010598-15-hch@lst.deSigned-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent d200ca14
...@@ -1808,7 +1808,6 @@ static void blkcg_maybe_throttle_blkg(struct blkcg_gq *blkg, bool use_memdelay) ...@@ -1808,7 +1808,6 @@ static void blkcg_maybe_throttle_blkg(struct blkcg_gq *blkg, bool use_memdelay)
void blkcg_maybe_throttle_current(void) void blkcg_maybe_throttle_current(void)
{ {
struct request_queue *q = current->throttle_queue; struct request_queue *q = current->throttle_queue;
struct cgroup_subsys_state *css;
struct blkcg *blkcg; struct blkcg *blkcg;
struct blkcg_gq *blkg; struct blkcg_gq *blkg;
bool use_memdelay = current->use_memdelay; bool use_memdelay = current->use_memdelay;
...@@ -1820,12 +1819,7 @@ void blkcg_maybe_throttle_current(void) ...@@ -1820,12 +1819,7 @@ void blkcg_maybe_throttle_current(void)
current->use_memdelay = false; current->use_memdelay = false;
rcu_read_lock(); rcu_read_lock();
css = kthread_blkcg(); blkcg = css_to_blkcg(blkcg_css());
if (css)
blkcg = css_to_blkcg(css);
else
blkcg = css_to_blkcg(task_css(current, io_cgrp_id));
if (!blkcg) if (!blkcg)
goto out; goto out;
blkg = blkg_lookup(blkcg, q); blkg = blkg_lookup(blkcg, q);
......
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