ns: proc files for namespace naming policy.
authorEric W. Biederman <ebiederm@xmission.com>
Mon, 8 Mar 2010 00:41:34 +0000 (16:41 -0800)
committerEric W. Biederman <ebiederm@xmission.com>
Tue, 10 May 2011 21:31:44 +0000 (14:31 -0700)
commit6b4e306aa3dc94a0545eb9279475b1ab6209a31f
treeca8c6dec0805076f0b5ba7c547e3cb2004e3aea2
parent0ee5623f9a6e52df90a78bd21179f8ab370e102e
ns: proc files for namespace naming policy.

Create files under /proc/<pid>/ns/ to allow controlling the
namespaces of a process.

This addresses three specific problems that can make namespaces hard to
work with.
- Namespaces require a dedicated process to pin them in memory.
- It is not possible to use a namespace unless you are the child
  of the original creator.
- Namespaces don't have names that userspace can use to talk about
  them.

The namespace files under /proc/<pid>/ns/ can be opened and the
file descriptor can be used to talk about a specific namespace, and
to keep the specified namespace alive.

A namespace can be kept alive by either holding the file descriptor
open or bind mounting the file someplace else.  aka:
mount --bind /proc/self/ns/net /some/filesystem/path
mount --bind /proc/self/fd/<N> /some/filesystem/path

This allows namespaces to be named with userspace policy.

It requires additional support to make use of these filedescriptors
and that will be comming in the following patches.

Acked-by: Daniel Lezcano <daniel.lezcano@free.fr>
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
fs/proc/Makefile
fs/proc/base.c
fs/proc/inode.c
fs/proc/internal.h
fs/proc/namespaces.c [new file with mode: 0644]
include/linux/proc_fs.h
This page took 0.027957 seconds and 5 git commands to generate.