Skip to content

Commit

Permalink
net: af_unix can make unix_nr_socks visbile in /proc
Browse files Browse the repository at this point in the history
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Nov 17, 2008
1 parent c3ccc12 commit 248969a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions net/unix/af_unix.c
Original file line number Diff line number Diff line change
Expand Up @@ -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),
};

/*
Expand Down

0 comments on commit 248969a

Please sign in to comment.