blkcg: remove blkcg->id
authorTejun Heo <tj@kernel.org>
Sun, 7 Sep 2014 23:15:20 +0000 (08:15 +0900)
committerJens Axboe <axboe@fb.com>
Mon, 8 Sep 2014 15:55:37 +0000 (09:55 -0600)
blkcg->id is a unique id given to each blkcg; however, the
cgroup_subsys_state which each blkcg embeds already has ->serial_nr
which can be used for the same purpose.  Drop blkcg->id and replace
its uses with blkcg->css.serial_nr.  Rename cfq_cgroup->blkcg_id to
->blkcg_serial_nr and @id in check_blkcg_changed() to @serial_nr for
consistency.

Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
block/blk-cgroup.c
block/blk-cgroup.h
block/cfq-iosched.c

index e17da94..0ac817b 100644 (file)
@@ -822,7 +822,6 @@ static void blkcg_css_free(struct cgroup_subsys_state *css)
 static struct cgroup_subsys_state *
 blkcg_css_alloc(struct cgroup_subsys_state *parent_css)
 {
-       static atomic64_t id_seq = ATOMIC64_INIT(0);
        struct blkcg *blkcg;
 
        if (!parent_css) {
@@ -836,7 +835,6 @@ blkcg_css_alloc(struct cgroup_subsys_state *parent_css)
 
        blkcg->cfq_weight = CFQ_WEIGHT_DEFAULT;
        blkcg->cfq_leaf_weight = CFQ_WEIGHT_DEFAULT;
-       blkcg->id = atomic64_inc_return(&id_seq); /* root is 0, start from 1 */
 done:
        spin_lock_init(&blkcg->lock);
        INIT_RADIX_TREE(&blkcg->blkg_tree, GFP_ATOMIC);
index d3fd7aa..c567865 100644 (file)
@@ -50,9 +50,6 @@ struct blkcg {
        struct blkcg_gq                 *blkg_hint;
        struct hlist_head               blkg_list;
 
-       /* for policies to test whether associated blkcg has changed */
-       uint64_t                        id;
-
        /* TODO: per-policy storage in blkcg */
        unsigned int                    cfq_weight;     /* belongs to cfq */
        unsigned int                    cfq_leaf_weight;
Simple merge