diff options
author | Masatake YAMATO <yamato@redhat.com> | 2010-02-27 14:45:37 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-02-28 04:29:49 -0500 |
commit | cf0aa4e07c32b0c211c24742aa015c0e7a135293 (patch) | |
tree | d010a4d165d71965529338fc9f41a8f5549d7ed0 /net/netlink/af_netlink.c | |
parent | 60bbc725b5b3009bb1bf2628ce5033d9bc108881 (diff) |
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: Masatake YAMATO <yamato@redhat.com>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/netlink/af_netlink.c')
-rw-r--r-- | net/netlink/af_netlink.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c index 4c5972ba8c78..320d0423a240 100644 --- a/net/netlink/af_netlink.c +++ b/net/netlink/af_netlink.c | |||
@@ -1978,12 +1978,12 @@ static int netlink_seq_show(struct seq_file *seq, void *v) | |||
1978 | if (v == SEQ_START_TOKEN) | 1978 | if (v == SEQ_START_TOKEN) |
1979 | seq_puts(seq, | 1979 | seq_puts(seq, |
1980 | "sk Eth Pid Groups " | 1980 | "sk Eth Pid Groups " |
1981 | "Rmem Wmem Dump Locks Drops\n"); | 1981 | "Rmem Wmem Dump Locks Drops Inode\n"); |
1982 | else { | 1982 | else { |
1983 | struct sock *s = v; | 1983 | struct sock *s = v; |
1984 | struct netlink_sock *nlk = nlk_sk(s); | 1984 | struct netlink_sock *nlk = nlk_sk(s); |
1985 | 1985 | ||
1986 | seq_printf(seq, "%p %-3d %-6d %08x %-8d %-8d %p %-8d %-8d\n", | 1986 | seq_printf(seq, "%p %-3d %-6d %08x %-8d %-8d %p %-8d %-8d %-8lu\n", |
1987 | s, | 1987 | s, |
1988 | s->sk_protocol, | 1988 | s->sk_protocol, |
1989 | nlk->pid, | 1989 | nlk->pid, |
@@ -1992,7 +1992,8 @@ static int netlink_seq_show(struct seq_file *seq, void *v) | |||
1992 | sk_wmem_alloc_get(s), | 1992 | sk_wmem_alloc_get(s), |
1993 | nlk->cb, | 1993 | nlk->cb, |
1994 | atomic_read(&s->sk_refcnt), | 1994 | atomic_read(&s->sk_refcnt), |
1995 | atomic_read(&s->sk_drops) | 1995 | atomic_read(&s->sk_drops), |
1996 | sock_i_ino(s) | ||
1996 | ); | 1997 | ); |
1997 | 1998 | ||
1998 | } | 1999 | } |