提交 248969ae 编写于 作者: E Eric Dumazet 提交者: David S. Miller

net: af_unix can make unix_nr_socks visbile in /proc

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: NEric Dumazet <dada1@cosmosbay.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 c3ccc123
......@@ -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),
};
/*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册