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

* Re: [PATCH] unix: define and set show_fdinfo only if procfs is enabled
  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:12 ` [PATCH] " David Miller
  2 siblings, 0 replies; 5+ messages in thread
From: Kirill Tkhai @ 2020-02-27  8:50 UTC (permalink / raw)
  To: Tobias Klauser, David S. Miller, Jakub Kicinski; +Cc: netdev, Arnd Bergmann

On 26.02.2020 20:29, Tobias Klauser wrote:
> 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>

Reviewed-by: Kirill Tkhai <ktkhai@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 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,
> 


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

* [PATCH net v1] unix: define and set show_fdinfo only if procfs is enabled
  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 ` Tobias Klauser
  2020-02-27 19:54   ` David Miller
  2020-02-27 19:12 ` [PATCH] " David Miller
  2 siblings, 1 reply; 5+ messages in thread
From: Tobias Klauser @ 2020-02-27 13:34 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_PROC_FS
is set.

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


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

* Re: [PATCH] unix: define and set show_fdinfo only if procfs is enabled
  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:12 ` David Miller
  2 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2020-02-27 19:12 UTC (permalink / raw)
  To: tklauser; +Cc: kuba, netdev, ktkhai, arnd

From: Tobias Klauser <tklauser@distanz.ch>
Date: Wed, 26 Feb 2020 18:29:53 +0100

> 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>

Applied, thanks.

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

* Re: [PATCH net v1] unix: define and set show_fdinfo only if procfs is enabled
  2020-02-27 13:34 ` [PATCH net v1] " Tobias Klauser
@ 2020-02-27 19:54   ` David Miller
  0 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2020-02-27 19:54 UTC (permalink / raw)
  To: tklauser; +Cc: kuba, netdev, ktkhai, arnd

From: Tobias Klauser <tklauser@distanz.ch>
Date: Thu, 27 Feb 2020 14:34:42 +0100

> 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 <ktkhai@virtuozzo.com>
> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>

I applied v0 before seeing this, so I just committed a relative fixup
to the tree instead.

Thanks.

^ permalink raw reply	[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.