Skip to content

Commit bc5fee9

Browse files
Christoph Hellwigaxboe
authored andcommitted
blk-cgroup: move blkcg_css to blk-cgroup.c
blkcg_css is only used in blk-cgroup.c, so move it there. Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Tejun Heo <tj@kernel.org> Link: https://lore.kernel.org/r/20220420042723.1010598-13-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent c97ab27 commit bc5fee9

2 files changed

Lines changed: 17 additions & 17 deletions

File tree

block/blk-cgroup.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,23 @@ static struct workqueue_struct *blkcg_punt_bio_wq;
5959

6060
#define BLKG_DESTROY_BATCH_SIZE 64
6161

62+
/**
63+
* blkcg_css - find the current css
64+
*
65+
* Find the css associated with either the kthread or the current task.
66+
* This may return a dying css, so it is up to the caller to use tryget logic
67+
* to confirm it is alive and well.
68+
*/
69+
static struct cgroup_subsys_state *blkcg_css(void)
70+
{
71+
struct cgroup_subsys_state *css;
72+
73+
css = kthread_blkcg();
74+
if (css)
75+
return css;
76+
return task_css(current, io_cgrp_id);
77+
}
78+
6279
static bool blkcg_policy_enabled(struct request_queue *q,
6380
const struct blkcg_policy *pol)
6481
{

block/blk-cgroup.h

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -210,23 +210,6 @@ int blkg_conf_prep(struct blkcg *blkcg, const struct blkcg_policy *pol,
210210
char *input, struct blkg_conf_ctx *ctx);
211211
void blkg_conf_finish(struct blkg_conf_ctx *ctx);
212212

213-
/**
214-
* blkcg_css - find the current css
215-
*
216-
* Find the css associated with either the kthread or the current task.
217-
* This may return a dying css, so it is up to the caller to use tryget logic
218-
* to confirm it is alive and well.
219-
*/
220-
static inline struct cgroup_subsys_state *blkcg_css(void)
221-
{
222-
struct cgroup_subsys_state *css;
223-
224-
css = kthread_blkcg();
225-
if (css)
226-
return css;
227-
return task_css(current, io_cgrp_id);
228-
}
229-
230213
/**
231214
* bio_issue_as_root_blkg - see if this bio needs to be issued as root blkg
232215
* @return: true if this bio needs to be submitted with the root blkg context.

0 commit comments

Comments
 (0)