summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--block/blk-throttle.c7
-rw-r--r--include/linux/blk-cgroup.h3
2 files changed, 3 insertions, 7 deletions
diff --git a/block/blk-throttle.c b/block/blk-throttle.c
index c2c75477a6b2..1f63fc834dc3 100644
--- a/block/blk-throttle.c
+++ b/block/blk-throttle.c
@@ -452,13 +452,6 @@ static void throtl_pd_reset_stats(struct blkg_policy_data *pd)
static struct throtl_grp *throtl_lookup_tg(struct throtl_data *td,
struct blkcg *blkcg)
{
- /*
- * This is the common case when there are no blkcgs. Avoid lookup
- * in this case
- */
- if (blkcg == &blkcg_root)
- return td_root_tg(td);
-
return blkg_to_tg(blkg_lookup(blkcg, td->queue));
}
diff --git a/include/linux/blk-cgroup.h b/include/linux/blk-cgroup.h
index d5b54aa50582..0609bce69f68 100644
--- a/include/linux/blk-cgroup.h
+++ b/include/linux/blk-cgroup.h
@@ -249,6 +249,9 @@ static inline struct blkcg_gq *__blkg_lookup(struct blkcg *blkcg,
{
struct blkcg_gq *blkg;
+ if (blkcg == &blkcg_root)
+ return q->root_blkg;
+
blkg = rcu_dereference(blkcg->blkg_hint);
if (blkg && blkg->q == q)
return blkg;