diff options
author | Peter Zijlstra <peterz@infradead.org> | 2016-11-14 11:12:23 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2017-01-14 05:37:18 -0500 |
commit | 1e24edca0557dba6486d39d3c24c288475432bcf (patch) | |
tree | 9ee0931fdfa80b2b2b809bd26ad2aced7c8bce33 /kernel/pid.c | |
parent | 2b0b211134a65401ed874ce0d5d48844f4f6f341 (diff) |
locking/atomic, kref: Add KREF_INIT()
Since we need to change the implementation, stop exposing internals.
Provide KREF_INIT() to allow static initialization of struct kref.
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel/pid.c')
-rw-r--r-- | kernel/pid.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/kernel/pid.c b/kernel/pid.c index f66162f2359b..0291804151b5 100644 --- a/kernel/pid.c +++ b/kernel/pid.c | |||
@@ -68,9 +68,7 @@ static inline int mk_pid(struct pid_namespace *pid_ns, | |||
68 | * the scheme scales to up to 4 million PIDs, runtime. | 68 | * the scheme scales to up to 4 million PIDs, runtime. |
69 | */ | 69 | */ |
70 | struct pid_namespace init_pid_ns = { | 70 | struct pid_namespace init_pid_ns = { |
71 | .kref = { | 71 | .kref = KREF_INIT(2), |
72 | .refcount = ATOMIC_INIT(2), | ||
73 | }, | ||
74 | .pidmap = { | 72 | .pidmap = { |
75 | [ 0 ... PIDMAP_ENTRIES-1] = { ATOMIC_INIT(BITS_PER_PAGE), NULL } | 73 | [ 0 ... PIDMAP_ENTRIES-1] = { ATOMIC_INIT(BITS_PER_PAGE), NULL } |
76 | }, | 74 | }, |