aboutsummaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorGui Jianfeng <guijianfeng@cn.fujitsu.com>2010-02-26 02:56:15 -0500
committerJens Axboe <jens.axboe@oracle.com>2010-02-26 02:56:15 -0500
commit024f9066165ffe9c8284431c78adcbcddd309831 (patch)
tree11b64dd7861985aca57bd7624cd25c804afd4b1a /block
parent7f03292ee16e68be96aa88904afc6152f8d37736 (diff)
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>
Diffstat (limited to 'block')
-rw-r--r--block/blk-cgroup.c14
-rw-r--r--block/blk-cgroup.h3
-rw-r--r--block/cfq-iosched.c5
3 files changed, 0 insertions, 22 deletions
diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c
index e7dbbaf5fb3..c85d74cae20 100644
--- a/block/blk-cgroup.c
+++ b/block/blk-cgroup.c
@@ -23,20 +23,6 @@ static LIST_HEAD(blkio_list);
23struct blkio_cgroup blkio_root_cgroup = { .weight = 2*BLKIO_WEIGHT_DEFAULT }; 23struct blkio_cgroup blkio_root_cgroup = { .weight = 2*BLKIO_WEIGHT_DEFAULT };
24EXPORT_SYMBOL_GPL(blkio_root_cgroup); 24EXPORT_SYMBOL_GPL(blkio_root_cgroup);
25 25
26bool blkiocg_css_tryget(struct blkio_cgroup *blkcg)
27{
28 if (!css_tryget(&blkcg->css))
29 return false;
30 return true;
31}
32EXPORT_SYMBOL_GPL(blkiocg_css_tryget);
33
34void blkiocg_css_put(struct blkio_cgroup *blkcg)
35{
36 css_put(&blkcg->css);
37}
38EXPORT_SYMBOL_GPL(blkiocg_css_put);
39
40struct blkio_cgroup *cgroup_to_blkio_cgroup(struct cgroup *cgroup) 26struct blkio_cgroup *cgroup_to_blkio_cgroup(struct cgroup *cgroup)
41{ 27{
42 return container_of(cgroup_subsys_state(cgroup, blkio_subsys_id), 28 return container_of(cgroup_subsys_state(cgroup, blkio_subsys_id),
diff --git a/block/blk-cgroup.h b/block/blk-cgroup.h
index 4d316df863b..84bf745fa77 100644
--- a/block/blk-cgroup.h
+++ b/block/blk-cgroup.h
@@ -43,9 +43,6 @@ struct blkio_group {
43 unsigned long sectors; 43 unsigned long sectors;
44}; 44};
45 45
46extern bool blkiocg_css_tryget(struct blkio_cgroup *blkcg);
47extern void blkiocg_css_put(struct blkio_cgroup *blkcg);
48
49typedef void (blkio_unlink_group_fn) (void *key, struct blkio_group *blkg); 46typedef void (blkio_unlink_group_fn) (void *key, struct blkio_group *blkg);
50typedef void (blkio_update_group_weight_fn) (struct blkio_group *blkg, 47typedef void (blkio_update_group_weight_fn) (struct blkio_group *blkg,
51 unsigned int weight); 48 unsigned int weight);
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c
index e3dedfd3bcb..10eb286f1f4 100644
--- a/block/cfq-iosched.c
+++ b/block/cfq-iosched.c
@@ -951,10 +951,6 @@ cfq_find_alloc_cfqg(struct cfq_data *cfqd, struct cgroup *cgroup, int create)
951 struct backing_dev_info *bdi = &cfqd->queue->backing_dev_info; 951 struct backing_dev_info *bdi = &cfqd->queue->backing_dev_info;
952 unsigned int major, minor; 952 unsigned int major, minor;
953 953
954 /* Do we need to take this reference */
955 if (!blkiocg_css_tryget(blkcg))
956 return NULL;;
957
958 cfqg = cfqg_of_blkg(blkiocg_lookup_group(blkcg, key)); 954 cfqg = cfqg_of_blkg(blkiocg_lookup_group(blkcg, key));
959 if (cfqg || !create) 955 if (cfqg || !create)
960 goto done; 956 goto done;
@@ -985,7 +981,6 @@ cfq_find_alloc_cfqg(struct cfq_data *cfqd, struct cgroup *cgroup, int create)
985 hlist_add_head(&cfqg->cfqd_node, &cfqd->cfqg_list); 981 hlist_add_head(&cfqg->cfqd_node, &cfqd->cfqg_list);
986 982
987done: 983done:
988 blkiocg_css_put(blkcg);
989 return cfqg; 984 return cfqg;
990} 985}
991 986