blkcg: remove additional reference to the css
[sfrench/cifs-2.6.git] / include / linux / blk-cgroup.h
index f11c37f8ce09fe657b7800f3da479cbbc3c361ac..284819a4d12233b6ef471b71d87f6b35c76c2a09 100644 (file)
@@ -247,47 +247,6 @@ static inline struct cgroup_subsys_state *blkcg_css(void)
        return task_css(current, io_cgrp_id);
 }
 
-/**
- * blkcg_get_css - find and get a reference to the css
- *
- * Find the css associated with either the kthread or the current task.
- * This takes a reference on the blkcg which will need to be managed by the
- * caller.
- */
-static inline struct cgroup_subsys_state *blkcg_get_css(void)
-{
-       struct cgroup_subsys_state *css;
-
-       rcu_read_lock();
-
-       css = kthread_blkcg();
-       if (css) {
-               css_get(css);
-       } else {
-               /*
-                * This is a bit complicated.  It is possible task_css() is
-                * seeing an old css pointer here.  This is caused by the
-                * current thread migrating away from this cgroup and this
-                * cgroup dying.  css_tryget() will fail when trying to take a
-                * ref on a cgroup that's ref count has hit 0.
-                *
-                * Therefore, if it does fail, this means current must have
-                * been swapped away already and this is waiting for it to
-                * propagate on the polling cpu.  Hence the use of cpu_relax().
-                */
-               while (true) {
-                       css = task_css(current, io_cgrp_id);
-                       if (likely(css_tryget(css)))
-                               break;
-                       cpu_relax();
-               }
-       }
-
-       rcu_read_unlock();
-
-       return css;
-}
-
 static inline struct blkcg *css_to_blkcg(struct cgroup_subsys_state *css)
 {
        return css ? container_of(css, struct blkcg, css) : NULL;