[RFC 4/4] pid_namespace: disable_pid_allocation is unused for !CONFIG_PID_NS

From: Rasmus Villemoes
Date: Wed Sep 30 2015 - 16:50:06 EST


disable_pid_allocation only has a single caller, in
kernel/pid_namespace.c, so when CONFIG_PID_NS=n we don't need it. I
don't think we need to #ifdef the declaration away, since we'll just
fail at link time rather than compile time, should
disable_pid_allocation ever grow a caller outside pid_namespace.c.

Signed-off-by: Rasmus Villemoes <linux@xxxxxxxxxxxxxxxxxx>
---
kernel/pid.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/kernel/pid.c b/kernel/pid.c
index d422ddae0484..c9b595517c4f 100644
--- a/kernel/pid.c
+++ b/kernel/pid.c
@@ -358,12 +358,14 @@ out_free:
return ERR_PTR(retval);
}

+#ifdef CONFIG_PID_NS
void disable_pid_allocation(struct pid_namespace *ns)
{
spin_lock_irq(&pidmap_lock);
ns->nr_hashed &= ~PIDNS_HASH_ADDING;
spin_unlock_irq(&pidmap_lock);
}
+#endif

struct pid *find_pid_ns(int nr, struct pid_namespace *ns)
{
--
2.1.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/