aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/pid_namespace.c
diff options
context:
space:
mode:
authorOlof Johansson <olof@lixom.net>2012-11-05 13:09:12 -0500
committerOlof Johansson <olof@lixom.net>2012-11-05 13:09:12 -0500
commit6d06721570aa0c38d886e3036796d59983963a27 (patch)
treed674cf54e26837bee89095c211ffa362c8546f03 /kernel/pid_namespace.c
parent148a8698763130c96004ef419b5f0d44a93d413c (diff)
parent54ec52b6dd3b0ba4bc4eb97e7e1b2534705b326c (diff)
Merge branch 'depends/tty' into next/headers
Merging in Greg's tty tree including a cleanup patch needed by the OMAP serial header cleanups. * depends/tty: (305 commits) tty/serial/8250: Make omap hardware workarounds local to 8250.h serial/8250/8250_early: Prevent rounding error in uartclk serial: samsung: use clk_prepare_enable and clk_disable_unprepare TTY: Report warning when low_latency flag is wrongly used console: use might_sleep in console_lock TTY: move tty buffers to tty_port TTY: add port -> tty link TTY: tty_buffer, cache pointer to tty->buf TTY: move TTY_FLUSH* flags to tty_port TTY: n_tty, propagate n_tty_data TTY: move ldisc data from tty_struct: locks TTY: move ldisc data from tty_struct: read_* and echo_* and canon_* stuff TTY: move ldisc data from tty_struct: bitmaps TTY: move ldisc data from tty_struct: simple members TTY: n_tty, add ldisc data to n_tty TTY: audit, stop accessing tty->icount TTY: n_tty, remove bogus checks TTY: n_tty, simplify read_buf+echo_buf allocation TTY: hci_ldisc, remove invalid check in open TTY: ldisc, wait for idle ldisc in release ...
Diffstat (limited to 'kernel/pid_namespace.c')
-rw-r--r--kernel/pid_namespace.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/kernel/pid_namespace.c b/kernel/pid_namespace.c
index 478bad2745e3..eb00be205811 100644
--- a/kernel/pid_namespace.c
+++ b/kernel/pid_namespace.c
@@ -133,19 +133,26 @@ struct pid_namespace *copy_pid_ns(unsigned long flags, struct pid_namespace *old
133 return create_pid_namespace(old_ns); 133 return create_pid_namespace(old_ns);
134} 134}
135 135
136void free_pid_ns(struct kref *kref) 136static void free_pid_ns(struct kref *kref)
137{ 137{
138 struct pid_namespace *ns, *parent; 138 struct pid_namespace *ns;
139 139
140 ns = container_of(kref, struct pid_namespace, kref); 140 ns = container_of(kref, struct pid_namespace, kref);
141
142 parent = ns->parent;
143 destroy_pid_namespace(ns); 141 destroy_pid_namespace(ns);
142}
144 143
145 if (parent != NULL) 144void put_pid_ns(struct pid_namespace *ns)
146 put_pid_ns(parent); 145{
146 struct pid_namespace *parent;
147
148 while (ns != &init_pid_ns) {
149 parent = ns->parent;
150 if (!kref_put(&ns->kref, free_pid_ns))
151 break;
152 ns = parent;
153 }
147} 154}
148EXPORT_SYMBOL_GPL(free_pid_ns); 155EXPORT_SYMBOL_GPL(put_pid_ns);
149 156
150void zap_pid_ns_processes(struct pid_namespace *pid_ns) 157void zap_pid_ns_processes(struct pid_namespace *pid_ns)
151{ 158{