namespacefs: Couple namespacefs to the PID namespace

When the PID namespace gets initialized, a directory called 'pid'
is added to namespacesfs. This directory represents the main PID
namespace and also serves as a trunk (parent) of all child PID
namespaces. Every time when a new PID namespace is created a
corresponding directory is added to 'namespacefs/pid/'. The 'inum'
of the new namespace gives the name of its directory. When the PID
namespace is destroyed the corresponding directory is removed. The
directory of  each new namespace contains a file called 'tasks'.
This file can be used to get a list of PIDs of all tasks contained
in a particular PID namespace.

Signed-off-by: Yordan Karadzhov (VMware) <>
2 files changed