Skip to content

Commit d200ca1

Browse files
Christoph Hellwigaxboe
authored andcommitted
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: Christoph Hellwig <[email protected]> Acked-by: Tejun Heo <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
1 parent bc5fee9 commit d200ca1

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

block/blk-cgroup.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2038,15 +2038,11 @@ bool blk_cgroup_congested(void)
20382038
bool ret = false;
20392039

20402040
rcu_read_lock();
2041-
css = kthread_blkcg();
2042-
if (!css)
2043-
css = task_css(current, io_cgrp_id);
2044-
while (css) {
2041+
for (css = blkcg_css(); css; css = css->parent) {
20452042
if (atomic_read(&css->cgroup->congestion_count)) {
20462043
ret = true;
20472044
break;
20482045
}
2049-
css = css->parent;
20502046
}
20512047
rcu_read_unlock();
20522048
return ret;

0 commit comments

Comments
 (0)