diff options
Diffstat (limited to 'block/blk-cgroup.h')
-rw-r--r-- | block/blk-cgroup.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/block/blk-cgroup.h b/block/blk-cgroup.h index 24597309e23d..b26ed58899fe 100644 --- a/block/blk-cgroup.h +++ b/block/blk-cgroup.h | |||
@@ -94,8 +94,13 @@ struct blkcg_gq { | |||
94 | struct list_head q_node; | 94 | struct list_head q_node; |
95 | struct hlist_node blkcg_node; | 95 | struct hlist_node blkcg_node; |
96 | struct blkcg *blkcg; | 96 | struct blkcg *blkcg; |
97 | |||
98 | /* all non-root blkcg_gq's are guaranteed to have access to parent */ | ||
99 | struct blkcg_gq *parent; | ||
100 | |||
97 | /* request allocation list for this blkcg-q pair */ | 101 | /* request allocation list for this blkcg-q pair */ |
98 | struct request_list rl; | 102 | struct request_list rl; |
103 | |||
99 | /* reference count */ | 104 | /* reference count */ |
100 | int refcnt; | 105 | int refcnt; |
101 | 106 | ||
@@ -181,6 +186,19 @@ static inline struct blkcg *bio_blkcg(struct bio *bio) | |||
181 | } | 186 | } |
182 | 187 | ||
183 | /** | 188 | /** |
189 | * blkcg_parent - get the parent of a blkcg | ||
190 | * @blkcg: blkcg of interest | ||
191 | * | ||
192 | * Return the parent blkcg of @blkcg. Can be called anytime. | ||
193 | */ | ||
194 | static inline struct blkcg *blkcg_parent(struct blkcg *blkcg) | ||
195 | { | ||
196 | struct cgroup *pcg = blkcg->css.cgroup->parent; | ||
197 | |||
198 | return pcg ? cgroup_to_blkcg(pcg) : NULL; | ||
199 | } | ||
200 | |||
201 | /** | ||
184 | * blkg_to_pdata - get policy private data | 202 | * blkg_to_pdata - get policy private data |
185 | * @blkg: blkg of interest | 203 | * @blkg: blkg of interest |
186 | * @pol: policy of interest | 204 | * @pol: policy of interest |