Commit 3a12500e authored by Tobias Klauser's avatar Tobias Klauser Committed by David S. Miller

unix: define and set show_fdinfo only if procfs is enabled

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: 3c32da19 ("unix: Show number of pending scm files of receive queue in fdinfo")
Signed-off-by: default avatarTobias Klauser <tklauser@distanz.ch>
Reviewed-by: default avatarKirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent f4979b41
...@@ -682,6 +682,7 @@ static int unix_set_peek_off(struct sock *sk, int val) ...@@ -682,6 +682,7 @@ static int unix_set_peek_off(struct sock *sk, int val)
return 0; return 0;
} }
#ifdef CONFIG_PROCFS
static void unix_show_fdinfo(struct seq_file *m, struct socket *sock) static void unix_show_fdinfo(struct seq_file *m, struct socket *sock)
{ {
struct sock *sk = sock->sk; struct sock *sk = sock->sk;
...@@ -692,6 +693,9 @@ static void unix_show_fdinfo(struct seq_file *m, struct socket *sock) ...@@ -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)); 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 = { static const struct proto_ops unix_stream_ops = {
.family = PF_UNIX, .family = PF_UNIX,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment