Commit 16ca152d authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Pavel Emelyanov

pstree: Add few comments in prepare_pstree_ids

Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent f318f404
...@@ -212,6 +212,12 @@ int prepare_pstree_ids(void) ...@@ -212,6 +212,12 @@ int prepare_pstree_ids(void)
* reparented to init. * reparented to init.
*/ */
list_for_each_entry(item, &root_item->children, list) { list_for_each_entry(item, &root_item->children, list) {
/*
* If a child belongs to the root task's session or it's
* a session leader himself -- this is a simple case, we
* just proceed in a normal way.
*/
if (item->sid == root_item->sid || item->sid == item->pid.virt) if (item->sid == root_item->sid || item->sid == item->pid.virt)
continue; continue;
...@@ -232,6 +238,9 @@ int prepare_pstree_ids(void) ...@@ -232,6 +238,9 @@ int prepare_pstree_ids(void)
child = list_entry(item->list.prev, struct pstree_item, list); child = list_entry(item->list.prev, struct pstree_item, list);
item = child; item = child;
/*
* Stack on helper task all children with target sid.
*/
list_for_each_entry_safe_continue(child, tmp, &root_item->children, list) { list_for_each_entry_safe_continue(child, tmp, &root_item->children, list) {
if (child->sid != helper->sid) if (child->sid != helper->sid)
continue; continue;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment