diff options
Diffstat (limited to 'include/linux/cgroup.h')
-rw-r--r-- | include/linux/cgroup.h | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index c40e508d54e9..8ec5b0f38292 100644 --- a/include/linux/cgroup.h +++ b/include/linux/cgroup.h | |||
@@ -798,7 +798,8 @@ css_rightmost_descendant(struct cgroup_subsys_state *pos); | |||
798 | * @pos: the css * to use as the loop cursor | 798 | * @pos: the css * to use as the loop cursor |
799 | * @root: css whose descendants to walk | 799 | * @root: css whose descendants to walk |
800 | * | 800 | * |
801 | * Walk @root's descendants. Must be called under rcu_read_lock(). A | 801 | * Walk @root's descendants. @root is included in the iteration and the |
802 | * first node to be visited. Must be called under rcu_read_lock(). A | ||
802 | * descendant css which hasn't finished ->css_online() or already has | 803 | * descendant css which hasn't finished ->css_online() or already has |
803 | * finished ->css_offline() may show up during traversal and it's each | 804 | * finished ->css_offline() may show up during traversal and it's each |
804 | * subsystem's responsibility to verify that each @pos is alive. | 805 | * subsystem's responsibility to verify that each @pos is alive. |
@@ -820,13 +821,12 @@ css_rightmost_descendant(struct cgroup_subsys_state *pos); | |||
820 | * | 821 | * |
821 | * my_update_state(@css) | 822 | * my_update_state(@css) |
822 | * { | 823 | * { |
823 | * Lock @css; | ||
824 | * Update @css's state; | ||
825 | * Unlock @css; | ||
826 | * | ||
827 | * css_for_each_descendant_pre(@pos, @css) { | 824 | * css_for_each_descendant_pre(@pos, @css) { |
828 | * Lock @pos; | 825 | * Lock @pos; |
829 | * Verify @pos is alive and inherit state from @pos's parent; | 826 | * if (@pos == @css) |
827 | * Update @css's state; | ||
828 | * else | ||
829 | * Verify @pos is alive and inherit state from its parent; | ||
830 | * Unlock @pos; | 830 | * Unlock @pos; |
831 | * } | 831 | * } |
832 | * } | 832 | * } |
@@ -864,8 +864,9 @@ css_next_descendant_post(struct cgroup_subsys_state *pos, | |||
864 | * @css: css whose descendants to walk | 864 | * @css: css whose descendants to walk |
865 | * | 865 | * |
866 | * Similar to css_for_each_descendant_pre() but performs post-order | 866 | * Similar to css_for_each_descendant_pre() but performs post-order |
867 | * traversal instead. Note that the walk visibility guarantee described in | 867 | * traversal instead. @root is included in the iteration and the last |
868 | * pre-order walk doesn't apply the same to post-order walks. | 868 | * node to be visited. Note that the walk visibility guarantee described |
869 | * in pre-order walk doesn't apply the same to post-order walks. | ||
869 | */ | 870 | */ |
870 | #define css_for_each_descendant_post(pos, css) \ | 871 | #define css_for_each_descendant_post(pos, css) \ |
871 | for ((pos) = css_next_descendant_post(NULL, (css)); (pos); \ | 872 | for ((pos) = css_next_descendant_post(NULL, (css)); (pos); \ |