aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorDenis V. Lunev <den@openvz.org>2008-01-31 06:46:43 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-31 22:27:25 -0500
commit8cd850efa4948d57a2ed836911cfd1ab299e89c6 (patch)
tree682b2bff416864ff5271a17847ba0b471bd766f8 /net
parent377cf82d66ea43f3d3cb82c2563e65b5c12c9bfd (diff)
[RAW]: Cleanup IPv4 raw_seq_show.
There is no need to use 128 bytes on the stack at all. Clean the code in the IPv6 style. Signed-off-by: Denis V. Lunev <den@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/ipv4/raw.c24
1 files changed, 7 insertions, 17 deletions
diff --git a/net/ipv4/raw.c b/net/ipv4/raw.c
index 507cbfe72eb5..830f19e2fce9 100644
--- a/net/ipv4/raw.c
+++ b/net/ipv4/raw.c
@@ -927,7 +927,7 @@ void raw_seq_stop(struct seq_file *seq, void *v)
927} 927}
928EXPORT_SYMBOL_GPL(raw_seq_stop); 928EXPORT_SYMBOL_GPL(raw_seq_stop);
929 929
930static __inline__ char *get_raw_sock(struct sock *sp, char *tmpbuf, int i) 930static void raw_sock_seq_show(struct seq_file *seq, struct sock *sp, int i)
931{ 931{
932 struct inet_sock *inet = inet_sk(sp); 932 struct inet_sock *inet = inet_sk(sp);
933 __be32 dest = inet->daddr, 933 __be32 dest = inet->daddr,
@@ -935,33 +935,23 @@ static __inline__ char *get_raw_sock(struct sock *sp, char *tmpbuf, int i)
935 __u16 destp = 0, 935 __u16 destp = 0,
936 srcp = inet->num; 936 srcp = inet->num;
937 937
938 sprintf(tmpbuf, "%4d: %08X:%04X %08X:%04X" 938 seq_printf(seq, "%4d: %08X:%04X %08X:%04X"
939 " %02X %08X:%08X %02X:%08lX %08X %5d %8d %lu %d %p %d", 939 " %02X %08X:%08X %02X:%08lX %08X %5d %8d %lu %d %p %d",
940 i, src, srcp, dest, destp, sp->sk_state, 940 i, src, srcp, dest, destp, sp->sk_state,
941 atomic_read(&sp->sk_wmem_alloc), 941 atomic_read(&sp->sk_wmem_alloc),
942 atomic_read(&sp->sk_rmem_alloc), 942 atomic_read(&sp->sk_rmem_alloc),
943 0, 0L, 0, sock_i_uid(sp), 0, sock_i_ino(sp), 943 0, 0L, 0, sock_i_uid(sp), 0, sock_i_ino(sp),
944 atomic_read(&sp->sk_refcnt), sp, atomic_read(&sp->sk_drops)); 944 atomic_read(&sp->sk_refcnt), sp, atomic_read(&sp->sk_drops));
945 return tmpbuf;
946} 945}
947 946
948#define TMPSZ 128
949
950static int raw_seq_show(struct seq_file *seq, void *v) 947static int raw_seq_show(struct seq_file *seq, void *v)
951{ 948{
952 char tmpbuf[TMPSZ+1];
953
954 if (v == SEQ_START_TOKEN) 949 if (v == SEQ_START_TOKEN)
955 seq_printf(seq, "%-*s\n", TMPSZ-1, 950 seq_printf(seq, " sl local_address rem_address st tx_queue "
956 " sl local_address rem_address st tx_queue " 951 "rx_queue tr tm->when retrnsmt uid timeout "
957 "rx_queue tr tm->when retrnsmt uid timeout " 952 "inode drops\n");
958 "inode drops"); 953 else
959 else { 954 raw_sock_seq_show(seq, v, raw_seq_private(seq)->bucket);
960 struct raw_iter_state *state = raw_seq_private(seq);
961
962 seq_printf(seq, "%-*s\n", TMPSZ-1,
963 get_raw_sock(v, tmpbuf, state->bucket));
964 }
965 return 0; 955 return 0;
966} 956}
967 957