Skip to content

Commit

Permalink
blk-cgroup: move blkcg_css to blk-cgroup.c
Browse files Browse the repository at this point in the history
blkcg_css is only used in blk-cgroup.c, so move it there.

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]>
  • Loading branch information
Christoph Hellwig authored and axboe committed May 2, 2022
1 parent c97ab27 commit bc5fee9
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
17 changes: 17 additions & 0 deletions block/blk-cgroup.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
17 changes: 0 additions & 17 deletions block/blk-cgroup.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit bc5fee9

Please sign in to comment.