take the targets of /proc/*/ns/* symlinks to separate fs
New pseudo-filesystem: nsfs. Targets of /proc/*/ns/* live there now.
It's not mountable (not even registered, so it's not in /proc/filesystems,
etc.). Files on it *are* bindable - we explicitly permit that in do_loopback().
This stuff lives in fs/nsfs.c now; proc_ns_fget() moved there as well.
get_proc_ns() is a macro now (it's simply returning ->i_private; would
have been an inline, if not for header ordering headache).
proc_ns_inode() is an ex-parrot. The interface used in procfs is
ns_get_path(path, task, ops) and ns_get_name(buf, size, task, ops).
Dentries and inodes are never hashed; a non-counting reference to dentry
is stashed in ns_common (removed by ->d_prune()) and reused by ns_get_path()
if present. See ns_get_path()/ns_prune_dentry/nsfs_evict() for details
of that mechanism.
As the result, proc_ns_follow_link() has stopped poking in nd->path.mnt;
it does nd_jump_link() on a consistent <vfsmount,dentry> pair it gets
from ns_get_path().
Signed-off-by:
Al Viro <viro@zeniv.linux.org.uk>
Showing
- fs/Makefile 1 addition, 1 deletionfs/Makefile
- fs/internal.h 5 additions, 0 deletionsfs/internal.h
- fs/namespace.c 6 additions, 3 deletionsfs/namespace.c
- fs/nsfs.c 161 additions, 0 deletionsfs/nsfs.c
- fs/proc/inode.c 0 additions, 5 deletionsfs/proc/inode.c
- fs/proc/namespaces.c 13 additions, 139 deletionsfs/proc/namespaces.c
- include/linux/ns_common.h 1 addition, 0 deletionsinclude/linux/ns_common.h
- include/linux/proc_ns.h 18 additions, 13 deletionsinclude/linux/proc_ns.h
- include/uapi/linux/magic.h 1 addition, 0 deletionsinclude/uapi/linux/magic.h
- init/main.c 2 additions, 0 deletionsinit/main.c
Loading
Please register or sign in to comment