Commit 024f9066 authored by Gui Jianfeng's avatar Gui Jianfeng Committed by Jens Axboe

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: default avatarGui Jianfeng <guijianfeng@cn.fujitsu.com>
Reviewed-by: default avatarLi Zefan <lizf@cn.fujitsu.com>
Acked-by: default avatarVivek Goyal <vgoyal@redhat.com>
Signed-off-by: default avatarJens Axboe <jens.axboe@oracle.com>
parent 7f03292e
...@@ -23,20 +23,6 @@ static LIST_HEAD(blkio_list); ...@@ -23,20 +23,6 @@ static LIST_HEAD(blkio_list);
struct blkio_cgroup blkio_root_cgroup = { .weight = 2*BLKIO_WEIGHT_DEFAULT }; struct blkio_cgroup blkio_root_cgroup = { .weight = 2*BLKIO_WEIGHT_DEFAULT };
EXPORT_SYMBOL_GPL(blkio_root_cgroup); EXPORT_SYMBOL_GPL(blkio_root_cgroup);
bool blkiocg_css_tryget(struct blkio_cgroup *blkcg)
{
if (!css_tryget(&blkcg->css))
return false;
return true;
}
EXPORT_SYMBOL_GPL(blkiocg_css_tryget);
void blkiocg_css_put(struct blkio_cgroup *blkcg)
{
css_put(&blkcg->css);
}
EXPORT_SYMBOL_GPL(blkiocg_css_put);
struct blkio_cgroup *cgroup_to_blkio_cgroup(struct cgroup *cgroup) struct blkio_cgroup *cgroup_to_blkio_cgroup(struct cgroup *cgroup)
{ {
return container_of(cgroup_subsys_state(cgroup, blkio_subsys_id), return container_of(cgroup_subsys_state(cgroup, blkio_subsys_id),
......
...@@ -43,9 +43,6 @@ struct blkio_group { ...@@ -43,9 +43,6 @@ struct blkio_group {
unsigned long sectors; unsigned long sectors;
}; };
extern bool blkiocg_css_tryget(struct blkio_cgroup *blkcg);
extern void blkiocg_css_put(struct blkio_cgroup *blkcg);
typedef void (blkio_unlink_group_fn) (void *key, struct blkio_group *blkg); typedef void (blkio_unlink_group_fn) (void *key, struct blkio_group *blkg);
typedef void (blkio_update_group_weight_fn) (struct blkio_group *blkg, typedef void (blkio_update_group_weight_fn) (struct blkio_group *blkg,
unsigned int weight); unsigned int weight);
......
...@@ -951,10 +951,6 @@ cfq_find_alloc_cfqg(struct cfq_data *cfqd, struct cgroup *cgroup, int create) ...@@ -951,10 +951,6 @@ cfq_find_alloc_cfqg(struct cfq_data *cfqd, struct cgroup *cgroup, int create)
struct backing_dev_info *bdi = &cfqd->queue->backing_dev_info; struct backing_dev_info *bdi = &cfqd->queue->backing_dev_info;
unsigned int major, minor; unsigned int major, minor;
/* Do we need to take this reference */
if (!blkiocg_css_tryget(blkcg))
return NULL;;
cfqg = cfqg_of_blkg(blkiocg_lookup_group(blkcg, key)); cfqg = cfqg_of_blkg(blkiocg_lookup_group(blkcg, key));
if (cfqg || !create) if (cfqg || !create)
goto done; goto done;
...@@ -985,7 +981,6 @@ cfq_find_alloc_cfqg(struct cfq_data *cfqd, struct cgroup *cgroup, int create) ...@@ -985,7 +981,6 @@ cfq_find_alloc_cfqg(struct cfq_data *cfqd, struct cgroup *cgroup, int create)
hlist_add_head(&cfqg->cfqd_node, &cfqd->cfqg_list); hlist_add_head(&cfqg->cfqd_node, &cfqd->cfqg_list);
done: done:
blkiocg_css_put(blkcg);
return cfqg; return cfqg;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment