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

blk-cgroup: cleanup blk_cgroup_congested

Use blkcg_css instead of open coding it, and switch to a slightly
more natural for loop.
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-14-hch@lst.deSigned-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent bc5fee91
...@@ -2038,15 +2038,11 @@ bool blk_cgroup_congested(void) ...@@ -2038,15 +2038,11 @@ bool blk_cgroup_congested(void)
bool ret = false; bool ret = false;
rcu_read_lock(); rcu_read_lock();
css = kthread_blkcg(); for (css = blkcg_css(); css; css = css->parent) {
if (!css)
css = task_css(current, io_cgrp_id);
while (css) {
if (atomic_read(&css->cgroup->congestion_count)) { if (atomic_read(&css->cgroup->congestion_count)) {
ret = true; ret = true;
break; break;
} }
css = css->parent;
} }
rcu_read_unlock(); rcu_read_unlock();
return ret; return ret;
......
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