Commit 60470bae authored by Andrew Vagin's avatar Andrew Vagin Committed by Pavel Emelyanov

pstree: split alloc_pstree_helper

Signed-off-by: 's avatarAndrew Vagin <avagin@virtuozzo.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
parent b0bd9204
......@@ -66,6 +66,7 @@ extern struct pstree_item *__alloc_pstree_item(bool rst);
#define alloc_pstree_item() __alloc_pstree_item(false)
#define alloc_pstree_item_with_rst() __alloc_pstree_item(true)
extern struct pstree_item *alloc_pstree_helper(void);
extern void init_pstree_helper(struct pstree_item *ret);
extern struct pstree_item *root_item;
extern struct pstree_item *pstree_item_next(struct pstree_item *item);
......
......@@ -217,16 +217,20 @@ struct pstree_item *__alloc_pstree_item(bool rst)
return item;
}
void init_pstree_helper(struct pstree_item *ret)
{
ret->pid.state = TASK_HELPER;
rsti(ret)->clone_flags = CLONE_FILES | CLONE_FS;
task_entries->nr_helpers++;
}
struct pstree_item *alloc_pstree_helper(void)
{
struct pstree_item *ret;
ret = alloc_pstree_item_with_rst();
if (ret) {
ret->pid.state = TASK_HELPER;
rsti(ret)->clone_flags = CLONE_FILES | CLONE_FS;
task_entries->nr_helpers++;
}
if (ret)
init_pstree_helper(ret);
return ret;
}
......
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