Skip to content

Commit 3a12500

Browse files
tklauserdavem330
authored andcommitted
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: 3c32da1 ("unix: Show number of pending scm files of receive queue in fdinfo") Signed-off-by: Tobias Klauser <[email protected]> Reviewed-by: Kirill Tkhai <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent f4979b4 commit 3a12500

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

net/unix/af_unix.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -682,6 +682,7 @@ static int unix_set_peek_off(struct sock *sk, int val)
682682
return 0;
683683
}
684684

685+
#ifdef CONFIG_PROCFS
685686
static void unix_show_fdinfo(struct seq_file *m, struct socket *sock)
686687
{
687688
struct sock *sk = sock->sk;
@@ -692,6 +693,9 @@ static void unix_show_fdinfo(struct seq_file *m, struct socket *sock)
692693
seq_printf(m, "scm_fds: %u\n", READ_ONCE(u->scm_stat.nr_fds));
693694
}
694695
}
696+
#else
697+
#define unix_show_fdinfo NULL
698+
#endif
695699

696700
static const struct proto_ops unix_stream_ops = {
697701
.family = PF_UNIX,

0 commit comments

Comments
 (0)