Commit f084b246 authored by Kirill Tkhai's avatar Kirill Tkhai Committed by Pavel Emelyanov

files: Add task link to created fdinfo_list_entry and populate it

This will be used in further to determine whether task's namespace
allows to restore file_desc.
Signed-off-by: 's avatarKirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
parent a95f68e0
......@@ -704,6 +704,12 @@ static struct fdinfo_list_entry *alloc_fle(int pid, FdinfoEntry *fe)
fle->received = 0;
fle->fake = 0;
fle->stage = FLE_INITIALIZED;
fle->task = pstree_item_by_virt(pid);
if (!fle->task) {
pr_err("Can't find task with pid %d\n", pid);
shfree_last(fle);
return NULL;
}
return fle;
}
......
......@@ -83,6 +83,7 @@ struct fdinfo_list_entry {
struct list_head desc_list; /* To chain on @fd_info_head */
struct file_desc *desc; /* Associated file descriptor */
struct list_head ps_list; /* To chain per-task files */
struct pstree_item *task;
FdinfoEntry *fe;
int pid;
u8 received:1;
......
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