diff options
| author | Alexey Dobriyan <[email protected]> | 2016-12-13 00:45:32 +0000 |
|---|---|---|
| committer | Linus Torvalds <[email protected]> | 2016-12-13 02:55:09 +0000 |
| commit | 1270dd8d994039b677d0504ba7260873d608bf75 (patch) | |
| tree | ced0d62305e9cfa38afb22f6eed06e59e499763d /fs/proc/root.c | |
| parent | fs/proc/base.c: save decrement during lookup/readdir in /proc/$PID (diff) | |
| download | kernel-1270dd8d994039b677d0504ba7260873d608bf75.tar.gz kernel-1270dd8d994039b677d0504ba7260873d608bf75.zip | |
fs/proc: calculate /proc/* and /proc/*/task/* nlink at init time
Runtime nlink calculation works but meh. I don't know how to do it at
compile time, but I know how to do it at init time.
Shift "2+" part into init time as a bonus.
Link: http://lkml.kernel.org/r/20161122195549.GB29812@avx2
Signed-off-by: Alexey Dobriyan <[email protected]>
Reviewed-by: Vegard Nossum <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'fs/proc/root.c')
| -rw-r--r-- | fs/proc/root.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/proc/root.c b/fs/proc/root.c index 8d3e484055a6..4bd0373576b5 100644 --- a/fs/proc/root.c +++ b/fs/proc/root.c @@ -122,6 +122,7 @@ void __init proc_root_init(void) int err; proc_init_inodecache(); + set_proc_pid_nlink(); err = register_filesystem(&proc_fs_type); if (err) return; |
