Commit cf0aa4e0 authored by Masatake YAMATO's avatar Masatake YAMATO Committed by David S. Miller

netlink: Adding inode field to /proc/net/netlink

The Inode field in /proc/net/{tcp,udp,packet,raw,...} is useful to know the types of
file descriptors associated to a process. Actually lsof utility uses the field.
Unfortunately, unlike /proc/net/{tcp,udp,packet,raw,...}, /proc/net/netlink doesn't have the field.
This patch adds the field to /proc/net/netlink.
Signed-off-by: default avatarMasatake YAMATO <yamato@redhat.com>
Acked-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 60bbc725
...@@ -1978,12 +1978,12 @@ static int netlink_seq_show(struct seq_file *seq, void *v) ...@@ -1978,12 +1978,12 @@ static int netlink_seq_show(struct seq_file *seq, void *v)
if (v == SEQ_START_TOKEN) if (v == SEQ_START_TOKEN)
seq_puts(seq, seq_puts(seq,
"sk Eth Pid Groups " "sk Eth Pid Groups "
"Rmem Wmem Dump Locks Drops\n"); "Rmem Wmem Dump Locks Drops Inode\n");
else { else {
struct sock *s = v; struct sock *s = v;
struct netlink_sock *nlk = nlk_sk(s); struct netlink_sock *nlk = nlk_sk(s);
seq_printf(seq, "%p %-3d %-6d %08x %-8d %-8d %p %-8d %-8d\n", seq_printf(seq, "%p %-3d %-6d %08x %-8d %-8d %p %-8d %-8d %-8lu\n",
s, s,
s->sk_protocol, s->sk_protocol,
nlk->pid, nlk->pid,
...@@ -1992,7 +1992,8 @@ static int netlink_seq_show(struct seq_file *seq, void *v) ...@@ -1992,7 +1992,8 @@ static int netlink_seq_show(struct seq_file *seq, void *v)
sk_wmem_alloc_get(s), sk_wmem_alloc_get(s),
nlk->cb, nlk->cb,
atomic_read(&s->sk_refcnt), atomic_read(&s->sk_refcnt),
atomic_read(&s->sk_drops) atomic_read(&s->sk_drops),
sock_i_ino(s)
); );
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment