]> www.infradead.org Git - users/hch/block.git/commitdiff
blk-cgroup: move blkcg_css to blk-cgroup.c
authorChristoph Hellwig <hch@lst.de>
Mon, 18 Apr 2022 07:01:47 +0000 (09:01 +0200)
committerChristoph Hellwig <hch@lst.de>
Tue, 19 Apr 2022 14:41:59 +0000 (16:41 +0200)
blkcg_css is only used in blk-cgroup.c, so move it there.

Signed-off-by: Christoph Hellwig <hch@lst.de>
block/blk-cgroup.c
block/blk-cgroup.h

index 8e32cc494808dc25ba8872235e363aba3f52f6ea..8da00ddc1766ecb09aefe409c92e9abd79034a23 100644 (file)
@@ -59,6 +59,23 @@ static struct workqueue_struct *blkcg_punt_bio_wq;
 
 #define BLKG_DESTROY_BATCH_SIZE  64
 
+/**
+ * blkcg_css - find the current css
+ *
+ * Find the css associated with either the kthread or the current task.
+ * This may return a dying css, so it is up to the caller to use tryget logic
+ * to confirm it is alive and well.
+ */
+static struct cgroup_subsys_state *blkcg_css(void)
+{
+       struct cgroup_subsys_state *css;
+
+       css = kthread_blkcg();
+       if (css)
+               return css;
+       return task_css(current, io_cgrp_id);
+}
+
 static bool blkcg_policy_enabled(struct request_queue *q,
                                 const struct blkcg_policy *pol)
 {
index 62ed8ed50b6e3e5615a22e6277d71c315a9b1db6..bb670e53a1de2a528a3485bdcf7aa5874e6ae274 100644 (file)
@@ -210,23 +210,6 @@ int blkg_conf_prep(struct blkcg *blkcg, const struct blkcg_policy *pol,
                   char *input, struct blkg_conf_ctx *ctx);
 void blkg_conf_finish(struct blkg_conf_ctx *ctx);
 
-/**
- * blkcg_css - find the current css
- *
- * Find the css associated with either the kthread or the current task.
- * This may return a dying css, so it is up to the caller to use tryget logic
- * to confirm it is alive and well.
- */
-static inline struct cgroup_subsys_state *blkcg_css(void)
-{
-       struct cgroup_subsys_state *css;
-
-       css = kthread_blkcg();
-       if (css)
-               return css;
-       return task_css(current, io_cgrp_id);
-}
-
 /**
  * bio_issue_as_root_blkg - see if this bio needs to be issued as root blkg
  * @return: true if this bio needs to be submitted with the root blkg context.