From patchwork Thu Feb 27 13:34:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tobias Klauser X-Patchwork-Id: 1245858 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=distanz.ch Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 48StvC50wWz9sSZ for ; Fri, 28 Feb 2020 00:34:47 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729203AbgB0Neq (ORCPT ); Thu, 27 Feb 2020 08:34:46 -0500 Received: from sym2.noone.org ([178.63.92.236]:49774 "EHLO sym2.noone.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729076AbgB0Neq (ORCPT ); Thu, 27 Feb 2020 08:34:46 -0500 Received: by sym2.noone.org (Postfix, from userid 1002) id 48Stv73m9xzvjcZ; Thu, 27 Feb 2020 14:34:43 +0100 (CET) From: Tobias Klauser To: "David S. Miller" , Jakub Kicinski Cc: netdev@vger.kernel.org, Kirill Tkhai , Arnd Bergmann Subject: [PATCH net v1] unix: define and set show_fdinfo only if procfs is enabled Date: Thu, 27 Feb 2020 14:34:42 +0100 Message-Id: <20200227133442.18728-1-tklauser@distanz.ch> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20200226172953.16471-1-tklauser@distanz.ch> References: <20200226172953.16471-1-tklauser@distanz.ch> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Follow the pattern used with other *_show_fdinfo functions and only define unix_show_fdinfo and set it in proto_ops if CONFIG_PROC_FS is set. Fixes: 3c32da19a858 ("unix: Show number of pending scm files of receive queue in fdinfo") Reviewed-by: Kirill Tkhai Signed-off-by: Tobias Klauser --- v1: - s/CONFIG_PROCFS/CONFIG_PROC_FS/ net/unix/af_unix.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c index 62c12cb5763e..68debcb28fa4 100644 --- a/net/unix/af_unix.c +++ b/net/unix/af_unix.c @@ -682,6 +682,7 @@ static int unix_set_peek_off(struct sock *sk, int val) return 0; } +#ifdef CONFIG_PROC_FS static void unix_show_fdinfo(struct seq_file *m, struct socket *sock) { struct sock *sk = sock->sk; @@ -692,6 +693,9 @@ static void unix_show_fdinfo(struct seq_file *m, struct socket *sock) seq_printf(m, "scm_fds: %u\n", READ_ONCE(u->scm_stat.nr_fds)); } } +#else +#define unix_show_fdinfo NULL +#endif static const struct proto_ops unix_stream_ops = { .family = PF_UNIX,