[Devel] [PATCH RH8 4/5] unix: define and set show_fdinfo only if procfs is enabled
Vasily Averin
vvs at virtuozzo.com
Mon May 31 12:35:05 MSK 2021
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 at distanz.ch>
Reviewed-by: Kirill Tkhai <ktkhai at virtuozzo.com>
Signed-off-by: David S. Miller <davem at davemloft.net>
(cherry picked from commit 3a12500ed5dd21a63da779ac73503f11085bbc1c)
Signed-off-by: Vasily Averin <vvs at virtuozzo.com>
+++
unix: It's CONFIG_PROC_FS not CONFIG_PROCFS
Fixes: 3a12500ed5dd ("unix: define and set show_fdinfo only if procfs is enabled")
Signed-off-by: David S. Miller <davem at davemloft.net>
(cherry picked from commit 5c05a164d441a1792791175e4959ea9df12f7e2b)
Signed-off-by: Vasily Averin <vvs at virtuozzo.com>
---
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 67648b61ce11..acd7985d1faa 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -673,6 +673,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;
@@ -683,6 +684,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.1
More information about the Devel
mailing list