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().
Showing the changes to init (1 of 10 files). Show all
Unified · Split
| @@ -78,6 +78,7 @@ · 77 unmodified lines | |||
| 78 | #include <linux/context_tracking.h> | 78 | #include <linux/context_tracking.h> |
| 79 | #include <linux/random.h> | 79 | #include <linux/random.h> |
| 80 | #include <linux/list.h> | 80 | #include <linux/list.h> |
| 81 | #include <linux/proc_ns.h> | ||
| 81 | 82 | ||
| 82 | #include <asm/io.h> | 83 | #include <asm/io.h> |
| 83 | #include <asm/bugs.h> | 84 | #include <asm/bugs.h> |
| @@ -660,6 +661,7 @@ asmlinkage __visible void __init start_kernel(void) · 576 unmodified lines | |||
| 660 | /* rootfs populating might need page-writeback */ | 661 | /* rootfs populating might need page-writeback */ |
| 661 | page_writeback_init(); | 662 | page_writeback_init(); |
| 662 | proc_root_init(); | 663 | proc_root_init(); |
| 664 | nsfs_init(); | ||
| 663 | cgroup_init(); | 665 | cgroup_init(); |
| 664 | cpuset_init(); | 666 | cpuset_init(); |
| 665 | taskstats_init_early(); | 667 | taskstats_init_early(); |