Make some network-related proc files use seq_list_xxx helpers
Subsystems (4)
PATCH 2/8 Make some network-related proc files use seq_list_xxx helpers
From: Pavel Emelianov <[email protected]>
This includes /proc/net/protocols, /proc/net/rxrpc_calls and /proc/net/rxrpc_connections files.
All three need seq_list_start_head to show some header.
---
net/core/sock.c | 39 +++------------------------------- net/rxrpc/ar-proc.c | 48 +++++------------------------------------- 2 files changed, 10 insertions(+), 77 deletions(-)
net/core/sock.c renamed from net/core/sock.c~make-some-network-related-proc-files-use-seq_list_xxx +4 -35
@@ -1851,46 +1851,15 @@ void proto_unregister(struct proto *protEXPORT_SYMBOL (proto_unregister);#ifdef CONFIG_PROC_FS -static inline struct proto *__proto_head (void ) -{ - return list_entry(proto_list.next, struct proto, node); -} - -static inline struct proto *proto_head (void ) -{ -return list_empty (&proto_list) ?NULL :__proto_head (); -} - -static inline struct proto *proto_next (struct proto *proto) -{ -return proto->node.next == &proto_list ?NULL : - list_entry(proto->node.next, struct proto, node); -} - -static inline struct proto *proto_get_idx (loff_t pos) -{ -struct proto *proto; -loff_t i =0 ; - -list_for_each_entry (proto, &proto_list, node) -if (i++ == pos) - goto out; - - proto =NULL ; -out: -return proto; -} -static void *proto_seq_start (struct seq_file *seq,loff_t *pos) {read_lock (&proto_list_lock); -return *pos ?proto_get_idx (*pos -1 ) :SEQ_START_TOKEN ; +return seq_list_start_head (&proto_list, *pos); }static void *proto_seq_next (struct seq_file *seq,void *v,loff_t *pos) { - ++*pos; -return v ==SEQ_START_TOKEN ?proto_head () :proto_next (v); +return seq_list_next (v, &proto_list, pos); }static void proto_seq_stop (struct seq_file *seq,void *v)
@@ -1938,7 +1907,7 @@ static void proto_seq_printf(struct seq_static int proto_seq_show (struct seq_file *seq,void *v) { -if (v ==SEQ_START_TOKEN ) +if (v == &proto_list) seq_printf(seq, "%-9s %-4s %-8s %-6s %-5s %-7s %-4s %-10s %s", "protocol", "size",
@@ -1950,7 +1919,7 @@ static int proto_seq_show(struct seq_fil"module" , "cl co di ac io in de sh ss gs se re sp bi br ha uh gp em\n"); else -proto_seq_printf (seq ,v ); +proto_seq_printf (seq ,list_entry (v ,struct proto ,node ));return 0 ; }
net/rxrpc/ar-proc.c renamed from net/rxrpc/ar-proc.c~make-some-network-related-proc-files-use-seq_list_xxx +6 -42
83 lines not on this page · raw message
_
From: [email protected]
Date: Mon, 09 Jul 2007 11:51:10 -0700
Quoted 10 lines
From: Pavel Emelianov <[email protected]>
This includes
/proc/net/protocols,/proc/net/rxrpc_callsand/proc/net/rxrpc_connectionsfiles.All three need
seq_list_start_headto show some header.Signed-off-by Pavel Emelianov <[email protected]>Acked-by David S. Miller <[email protected]>Signed-off-by Andrew Morton <[email protected]>
Applied, thanks.
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 9 lines · On Wed, 11 Jul 2007 09:05:13 +0900 (JST) Yasuyuki KOZAKAI…
I've met compile error on net-2.6.23 tree.
net/built-in.o: In function `proto_seq_next':
sock.c:(.text+0x3008): undefined reference toseq_list_next' net/built-in.o: In functionproto_seq_start':
sock.c:(.text+0x3079): undefined reference to `seq_list_start_head'
make: *** [.tmp_vmlinux1] Error 1
crap, that's my fault, sorry. Sending David patches which depend on things which are in -mm.
Let me send make-common-helpers-for-seq_files-that-work-with-list_head-s.patch Linuswards and it all should come good.
David Miller
maintainerFrom: Andrew Morton <[email protected]>
Date: Tue, 10 Jul 2007 17:20:52 -0700
Quoted 13 lines
Quoted 9 lines · On Wed, 11 Jul 2007 09:05:13 +0900 (JST) Yasuyuki KOZAKAI…
I've met compile error on net-2.6.23 tree.
net/built-in.o: In function `proto_seq_next':
sock.c:(.text+0x3008): undefined reference toseq_list_next' net/built-in.o: In functionproto_seq_start':
sock.c:(.text+0x3079): undefined reference to `seq_list_start_head'
make: *** [.tmp_vmlinux1] Error 1
Quoted 6 lines
crap, that's my fault, sorry. Sending David patches which depend on things which are in -mm.
Let me send make-common-helpers-for-seq_files-that-work-with-list_head-s.patch Linuswards and it all should come good.
I've rebased my tree at:
kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6.git
now that this has been sorted out.
I've met compile error on net-2.6.23 tree.
net/built-in.o: In function `proto_seq_next':
sock.c:(.text+0x3008): undefined reference to seq_list_next' net/built-in.o: In function proto_seq_start':
sock.c:(.text+0x3079): undefined reference to `seq_list_start_head'
make: *** [.tmp_vmlinux1] Error 1
-- Yasuyuki Kozakai
From: David Miller <[email protected]>
Date: Mon, 09 Jul 2007 13:15:23 -0700 (PDT)
Quoted 19 lines
From: [email protected]
Date: Mon, 09 Jul 2007 11:51:10 -0700Quoted 10 lines
From: Pavel Emelianov <[email protected]>
This includes
/proc/net/protocols,/proc/net/rxrpc_callsand/proc/net/rxrpc_connectionsfiles.All three need
seq_list_start_headto show some header.Signed-off-by Pavel Emelianov <[email protected]>Acked-by David S. Miller <[email protected]>Signed-off-by Andrew Morton <[email protected]>Applied, thanks.
-
To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html