Skip to content

Commit 024f906

Browse files
guijianfengJens Axboe
authored andcommitted
cfq: Remove useless css reference get
There's no need to take css reference here, for the caller has already called rcu_read_lock() to prevent cgroup from being removed. Signed-off-by: Gui Jianfeng <guijianfeng@cn.fujitsu.com> Reviewed-by: Li Zefan <lizf@cn.fujitsu.com> Acked-by: Vivek Goyal <vgoyal@redhat.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
1 parent 7f03292 commit 024f906

3 files changed

Lines changed: 0 additions & 22 deletions

File tree

‎block/blk-cgroup.c‎

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,6 @@ static LIST_HEAD(blkio_list);
2323
struct blkio_cgroup blkio_root_cgroup = { .weight = 2*BLKIO_WEIGHT_DEFAULT };
2424
EXPORT_SYMBOL_GPL(blkio_root_cgroup);
2525

26-
bool blkiocg_css_tryget(struct blkio_cgroup *blkcg)
27-
{
28-
if (!css_tryget(&blkcg->css))
29-
return false;
30-
return true;
31-
}
32-
EXPORT_SYMBOL_GPL(blkiocg_css_tryget);
33-
34-
void blkiocg_css_put(struct blkio_cgroup *blkcg)
35-
{
36-
css_put(&blkcg->css);
37-
}
38-
EXPORT_SYMBOL_GPL(blkiocg_css_put);
39-
4026
struct blkio_cgroup *cgroup_to_blkio_cgroup(struct cgroup *cgroup)
4127
{
4228
return container_of(cgroup_subsys_state(cgroup, blkio_subsys_id),

‎block/blk-cgroup.h‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,6 @@ struct blkio_group {
4343
unsigned long sectors;
4444
};
4545

46-
extern bool blkiocg_css_tryget(struct blkio_cgroup *blkcg);
47-
extern void blkiocg_css_put(struct blkio_cgroup *blkcg);
48-
4946
typedef void (blkio_unlink_group_fn) (void *key, struct blkio_group *blkg);
5047
typedef void (blkio_update_group_weight_fn) (struct blkio_group *blkg,
5148
unsigned int weight);

‎block/cfq-iosched.c‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -951,10 +951,6 @@ cfq_find_alloc_cfqg(struct cfq_data *cfqd, struct cgroup *cgroup, int create)
951951
struct backing_dev_info *bdi = &cfqd->queue->backing_dev_info;
952952
unsigned int major, minor;
953953

954-
/* Do we need to take this reference */
955-
if (!blkiocg_css_tryget(blkcg))
956-
return NULL;;
957-
958954
cfqg = cfqg_of_blkg(blkiocg_lookup_group(blkcg, key));
959955
if (cfqg || !create)
960956
goto done;
@@ -985,7 +981,6 @@ cfq_find_alloc_cfqg(struct cfq_data *cfqd, struct cgroup *cgroup, int create)
985981
hlist_add_head(&cfqg->cfqd_node, &cfqd->cfqg_list);
986982

987983
done:
988-
blkiocg_css_put(blkcg);
989984
return cfqg;
990985
}
991986

0 commit comments

Comments
 (0)