* [PATCH] net: af_unix can make unix_nr_socks visbile in /proc
@ 2008-11-17 7:58 Eric Dumazet
2008-11-17 8:01 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Eric Dumazet @ 2008-11-17 7:58 UTC (permalink / raw)
To: David S. Miller; +Cc: Linux Netdev List
[-- Attachment #1: Type: text/plain, Size: 528 bytes --]
Currently, /proc/net/protocols displays socket counts only for TCP/TCPv6
protocols
We can provide unix_nr_socks for free here, this counter being
already maintained in af_unix
Before patch :
# grep UNIX /proc/net/protocols
UNIX 428 -1 -1 NI 0 yes kernel
After patch :
# grep UNIX /proc/net/protocols
UNIX 428 98 -1 NI 0 yes kernel
Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
---
net/unix/af_unix.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
[-- Attachment #2: af_unix_sockets_allocated.patch --]
[-- Type: text/plain, Size: 471 bytes --]
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index 58db2a2..a1eb596 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -566,9 +566,10 @@ static const struct proto_ops unix_seqpacket_ops = {
};
static struct proto unix_proto = {
- .name = "UNIX",
- .owner = THIS_MODULE,
- .obj_size = sizeof(struct unix_sock),
+ .name = "UNIX",
+ .owner = THIS_MODULE,
+ .sockets_allocated = &unix_nr_socks,
+ .obj_size = sizeof(struct unix_sock),
};
/*
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] net: af_unix can make unix_nr_socks visbile in /proc
2008-11-17 7:58 [PATCH] net: af_unix can make unix_nr_socks visbile in /proc Eric Dumazet
@ 2008-11-17 8:01 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2008-11-17 8:01 UTC (permalink / raw)
To: dada1; +Cc: netdev
From: Eric Dumazet <dada1@cosmosbay.com>
Date: Mon, 17 Nov 2008 08:58:05 +0100
> Currently, /proc/net/protocols displays socket counts only for TCP/TCPv6
> protocols
>
> We can provide unix_nr_socks for free here, this counter being
> already maintained in af_unix
>
> Before patch :
>
> # grep UNIX /proc/net/protocols
> UNIX 428 -1 -1 NI 0 yes kernel
>
> After patch :
>
> # grep UNIX /proc/net/protocols
> UNIX 428 98 -1 NI 0 yes kernel
>
> Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
Applied, thanks a lot Eric.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-11-17 8:01 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-17 7:58 [PATCH] net: af_unix can make unix_nr_socks visbile in /proc Eric Dumazet
2008-11-17 8:01 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox