From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933113AbbI3UuD (ORCPT ); Wed, 30 Sep 2015 16:50:03 -0400 Received: from mail-la0-f48.google.com ([209.85.215.48]:35103 "EHLO mail-la0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932916AbbI3Utw (ORCPT ); Wed, 30 Sep 2015 16:49:52 -0400 From: Rasmus Villemoes To: "Eric W. Biederman" , Oleg Nesterov Cc: Rasmus Villemoes , linux-kernel@vger.kernel.org Subject: [RFC 4/4] pid_namespace: disable_pid_allocation is unused for !CONFIG_PID_NS Date: Wed, 30 Sep 2015 22:49:23 +0200 Message-Id: <1443646163-31316-5-git-send-email-linux@rasmusvillemoes.dk> X-Mailer: git-send-email 2.1.3 In-Reply-To: <1443646163-31316-1-git-send-email-linux@rasmusvillemoes.dk> References: <1443646163-31316-1-git-send-email-linux@rasmusvillemoes.dk> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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