diff options
author | Gargi Sharma <gs051095@gmail.com> | 2017-11-17 18:30:34 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-11-17 19:10:04 -0500 |
commit | e8cfbc245e24887e3c30235f71e9e9405e0cfc39 (patch) | |
tree | 0a9bc847f3c3328e822d1b9f0790999282390cf3 /kernel/pid_namespace.c | |
parent | 95846ecf9dac5089aed4b144d912225f8ef86ae4 (diff) |
pid: remove pidhash
pidhash is no longer required as all the information can be looked up
from idr tree. nr_hashed represented the number of pids that had been
hashed. Since, nr_hashed and PIDNS_HASH_ADDING are no longer relevant,
it has been renamed to pid_allocated and PIDNS_ADDING respectively.
[gs051095@gmail.com: v6]
Link: http://lkml.kernel.org/r/1507760379-21662-3-git-send-email-gs051095@gmail.com
Link: http://lkml.kernel.org/r/1507583624-22146-3-git-send-email-gs051095@gmail.com
Signed-off-by: Gargi Sharma <gs051095@gmail.com>
Reviewed-by: Rik van Riel <riel@redhat.com>
Tested-by: Tony Luck <tony.luck@intel.com> [ia64]
Cc: Julia Lawall <julia.lawall@lip6.fr>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Pavel Tatashin <pasha.tatashin@oracle.com>
Cc: Kirill Tkhai <ktkhai@virtuozzo.com>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Eric W. Biederman <ebiederm@xmission.com>
Cc: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/pid_namespace.c')
-rw-r--r-- | kernel/pid_namespace.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/kernel/pid_namespace.c b/kernel/pid_namespace.c index ca7c8a8823b1..0b53eef7d34b 100644 --- a/kernel/pid_namespace.c +++ b/kernel/pid_namespace.c | |||
@@ -133,7 +133,7 @@ static struct pid_namespace *create_pid_namespace(struct user_namespace *user_ns | |||
133 | ns->parent = get_pid_ns(parent_pid_ns); | 133 | ns->parent = get_pid_ns(parent_pid_ns); |
134 | ns->user_ns = get_user_ns(user_ns); | 134 | ns->user_ns = get_user_ns(user_ns); |
135 | ns->ucounts = ucounts; | 135 | ns->ucounts = ucounts; |
136 | ns->nr_hashed = PIDNS_HASH_ADDING; | 136 | ns->pid_allocated = PIDNS_ADDING; |
137 | INIT_WORK(&ns->proc_work, proc_cleanup_work); | 137 | INIT_WORK(&ns->proc_work, proc_cleanup_work); |
138 | 138 | ||
139 | return ns; | 139 | return ns; |
@@ -254,7 +254,7 @@ void zap_pid_ns_processes(struct pid_namespace *pid_ns) | |||
254 | * sys_wait4() above can't reap the EXIT_DEAD children but we do not | 254 | * sys_wait4() above can't reap the EXIT_DEAD children but we do not |
255 | * really care, we could reparent them to the global init. We could | 255 | * really care, we could reparent them to the global init. We could |
256 | * exit and reap ->child_reaper even if it is not the last thread in | 256 | * exit and reap ->child_reaper even if it is not the last thread in |
257 | * this pid_ns, free_pid(nr_hashed == 0) calls proc_cleanup_work(), | 257 | * this pid_ns, free_pid(pid_allocated == 0) calls proc_cleanup_work(), |
258 | * pid_ns can not go away until proc_kill_sb() drops the reference. | 258 | * pid_ns can not go away until proc_kill_sb() drops the reference. |
259 | * | 259 | * |
260 | * But this ns can also have other tasks injected by setns()+fork(). | 260 | * But this ns can also have other tasks injected by setns()+fork(). |
@@ -268,7 +268,7 @@ void zap_pid_ns_processes(struct pid_namespace *pid_ns) | |||
268 | */ | 268 | */ |
269 | for (;;) { | 269 | for (;;) { |
270 | set_current_state(TASK_INTERRUPTIBLE); | 270 | set_current_state(TASK_INTERRUPTIBLE); |
271 | if (pid_ns->nr_hashed == init_pids) | 271 | if (pid_ns->pid_allocated == init_pids) |
272 | break; | 272 | break; |
273 | schedule(); | 273 | schedule(); |
274 | } | 274 | } |