blkcg: implement all_blkcgs list

Add all_blkcgs list goes through blkcg->all_blkcgs_node and is
protected by blkcg_pol_mutex.  This will be used to fix
blkcg_policy_data allocation bug.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Vivek Goyal <vgoyal@redhat.com>
Cc: Arianna Avanzini <avanzini.arianna@gmail.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
(cherry picked from commit 7876f930d0e78addc6bbdbba0d6c196a0788d545)
Signed-off-by: Alex Shi <alex.shi@linaro.org>
diff --git a/include/linux/blk-cgroup.h b/include/linux/blk-cgroup.h
index 60e7b49..475e057 100644
--- a/include/linux/blk-cgroup.h
+++ b/include/linux/blk-cgroup.h
@@ -45,10 +45,12 @@
 	struct blkcg_gq			*blkg_hint;
 	struct hlist_head		blkg_list;
 
+	struct blkcg_policy_data	*pd[BLKCG_MAX_POLS];
+
+	struct list_head		all_blkcgs_node;
 #ifdef CONFIG_CGROUP_WRITEBACK
 	struct list_head		cgwb_list;
 #endif
-	struct blkcg_policy_data	*pd[BLKCG_MAX_POLS];
 };
 
 struct blkg_stat {