mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-30 13:58:34 +00:00
files: Populate file_desc::setns_userns
Do it here once to use cached value later. Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
This commit is contained in:
parent
eecdaebaee
commit
80c0c63b41
@ -73,12 +73,17 @@ void file_desc_init(struct file_desc *d, u32 id, struct file_desc_ops *ops)
|
||||
|
||||
d->id = id;
|
||||
d->ops = ops;
|
||||
d->setns_userns = NULL;
|
||||
}
|
||||
|
||||
int file_desc_add(struct file_desc *d, u32 id, struct file_desc_ops *ops)
|
||||
{
|
||||
uint32_t file_user_ns;
|
||||
file_desc_init(d, id, ops);
|
||||
hlist_add_head(&d->hash, &file_desc_hash[id % FDESC_HASH_SIZE]);
|
||||
if (d->ops->get_user_ns) {
|
||||
d->ops->get_user_ns(d, &file_user_ns, &d->setns_userns);
|
||||
}
|
||||
return 0; /* this is to make tail-calls in collect_one_foo look nice */
|
||||
}
|
||||
|
||||
|
@ -131,6 +131,7 @@ struct file_desc {
|
||||
struct file_desc_ops *ops; /* Associated operations */
|
||||
struct list_head fake_master_list;/* To chain in the list of file_desc, which don't
|
||||
have a fle in a task, that having permissions */
|
||||
struct ns_id *setns_userns; /* Minimal user_ns to be able to restore this file */
|
||||
};
|
||||
|
||||
struct fdtype_ops {
|
||||
|
Loading…
x
Reference in New Issue
Block a user