mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 19:51:31 -04:00
nsfs: add ioctl to get a parent namespace
Pid and user namepaces are hierarchical. There is no way to discover parent-child relationships. In a future we will use this interface to dump and restore nested namespaces. Acked-by: Serge Hallyn <[email protected]> Signed-off-by: Andrei Vagin <[email protected]> Signed-off-by: Eric W. Biederman <[email protected]>
This commit is contained in:
parent
6786741dbf
commit
a7306ed8d9
5 changed files with 27 additions and 0 deletions
|
|
@ -171,6 +171,10 @@ static long ns_ioctl(struct file *filp, unsigned int ioctl,
|
|||
switch (ioctl) {
|
||||
case NS_GET_USERNS:
|
||||
return open_related_ns(ns, ns_get_owner);
|
||||
case NS_GET_PARENT:
|
||||
if (!ns->ops->get_parent)
|
||||
return -EINVAL;
|
||||
return open_related_ns(ns, ns->ops->get_parent);
|
||||
default:
|
||||
return -ENOTTY;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue