]> git.baikalelectronics.ru Git - kernel.git/commitdiff
blk-cgroup: move blk_cgroup_congested out line
authorChristoph Hellwig <hch@lst.de>
Wed, 20 Apr 2022 04:27:13 +0000 (06:27 +0200)
committerJens Axboe <axboe@kernel.dk>
Mon, 2 May 2022 20:06:20 +0000 (14:06 -0600)
There is no urgent need to inline this function, so move it out of line.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: Tejun Heo <tj@kernel.org>
Link: https://lore.kernel.org/r/20220420042723.1010598-6-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-cgroup.c
include/linux/blk-cgroup.h

index 8dfe62786cd5fa5eae77afed283fcff238070835..97266ebde975b259c205f13f07c3e3acd9159d71 100644 (file)
@@ -1950,6 +1950,26 @@ void blk_cgroup_bio_start(struct bio *bio)
        put_cpu();
 }
 
+bool blk_cgroup_congested(void)
+{
+       struct cgroup_subsys_state *css;
+       bool ret = false;
+
+       rcu_read_lock();
+       css = kthread_blkcg();
+       if (!css)
+               css = task_css(current, io_cgrp_id);
+       while (css) {
+               if (atomic_read(&css->cgroup->congestion_count)) {
+                       ret = true;
+                       break;
+               }
+               css = css->parent;
+       }
+       rcu_read_unlock();
+       return ret;
+}
+
 static int __init blkcg_init(void)
 {
        blkcg_punt_bio_wq = alloc_workqueue("blkcg_punt_bio",
index 7a2f7de30173c29a6abef1cf1550c76954c6f72d..988965c1c27b89292a5922a88d1a14e87d5c1156 100644 (file)
@@ -135,25 +135,7 @@ static inline struct blkcg *bio_blkcg(struct bio *bio)
        return NULL;
 }
 
-static inline bool blk_cgroup_congested(void)
-{
-       struct cgroup_subsys_state *css;
-       bool ret = false;
-
-       rcu_read_lock();
-       css = kthread_blkcg();
-       if (!css)
-               css = task_css(current, io_cgrp_id);
-       while (css) {
-               if (atomic_read(&css->cgroup->congestion_count)) {
-                       ret = true;
-                       break;
-               }
-               css = css->parent;
-       }
-       rcu_read_unlock();
-       return ret;
-}
+bool blk_cgroup_congested(void);
 
 /**
  * blkcg_parent - get the parent of a blkcg