All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] unix: define and set show_fdinfo only if procfs is enabled
@ 2020-02-26 17:29 Tobias Klauser
  2020-02-27  8:50 ` Kirill Tkhai
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Tobias Klauser @ 2020-02-26 17:29 UTC (permalink / raw)
  To: David S. Miller, Jakub Kicinski; +Cc: netdev, Kirill Tkhai, Arnd Bergmann

Follow the pattern used with other *_show_fdinfo functions and only
define unix_show_fdinfo and set it in proto_ops if CONFIG_PROCFS
is set.

Fixes: 3c32da19a858 ("unix: Show number of pending scm files of receive queue in fdinfo")
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
---
 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..aa6e2530e1ec 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_PROCFS
 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,
-- 
2.25.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-02-27 19:54 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-26 17:29 [PATCH] unix: define and set show_fdinfo only if procfs is enabled Tobias Klauser
2020-02-27  8:50 ` Kirill Tkhai
2020-02-27 13:34 ` [PATCH net v1] " Tobias Klauser
2020-02-27 19:54   ` David Miller
2020-02-27 19:12 ` [PATCH] " David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.