Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Tue, 29 Oct 2002 22:31:56 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Tue, 29 Oct 2002 22:31:56 -0500 Received: from orion.netbank.com.br ([200.203.199.90]:25870 "EHLO orion.netbank.com.br") by vger.kernel.org with ESMTP id ; Tue, 29 Oct 2002 22:31:53 -0500 Date: Wed, 30 Oct 2002 00:38:00 -0300 From: Arnaldo Carvalho de Melo To: "David S. Miller" , Maciej Babinski Cc: Linux Kernel Mailing List Subject: [PATCH] llc: fix seq_file support Message-ID: <20021030033800.GA25217@conectiva.com.br> Mail-Followup-To: Arnaldo Carvalho de Melo , "David S. Miller" , Maciej Babinski , Linux Kernel Mailing List Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4i X-Url: http://advogato.org/person/acme Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 5017 Lines: 175 Hi David, Please pull from: kernel.bkbits.net:/home/acme/net-2.5 Best Regards, - Arnaldo You can import this changeset into BK by piping this whole message to: '| bk receive [path to repository]' or apply the patch as usual. =================================================================== ChangeSet@1.822, 2002-10-30 00:33:12-03:00, acme@conectiva.com.br o llc: fix seq_file support Thanks to Maciej Babinski for reporting this on lkml. This one also uninlines llc_get_sk_idx and turns the error message in snap_init an __initdata. 802/psnap.c | 5 ++++- llc/llc_proc.c | 37 ++++++++++++++++++------------------- 2 files changed, 22 insertions(+), 20 deletions(-) diff -Nru a/net/802/psnap.c b/net/802/psnap.c --- a/net/802/psnap.c Wed Oct 30 00:34:48 2002 +++ b/net/802/psnap.c Wed Oct 30 00:34:48 2002 @@ -91,12 +91,15 @@ EXPORT_SYMBOL(register_snap_client); EXPORT_SYMBOL(unregister_snap_client); +static char snap_err_msg[] __initdata = + KERN_CRIT "SNAP - unable to register with 802.2\n"; + static int __init snap_init(void) { snap_sap = llc_sap_open(0xAA, snap_rcv); if (!snap_sap) - printk(KERN_CRIT "SNAP - unable to register with 802.2\n"); + printk(snap_err_msg); return 0; } diff -Nru a/net/llc/llc_proc.c b/net/llc/llc_proc.c --- a/net/llc/llc_proc.c Wed Oct 30 00:34:48 2002 +++ b/net/llc/llc_proc.c Wed Oct 30 00:34:48 2002 @@ -13,10 +13,11 @@ */ #include +#include +#ifdef CONFIG_PROC_FS #include #include #include -#include #include #include #include @@ -27,14 +28,13 @@ #include #include -#ifdef CONFIG_PROC_FS static void llc_ui_format_mac(struct seq_file *seq, unsigned char *mac) { seq_printf(seq, "%02X:%02X:%02X:%02X:%02X:%02X", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]); } -static __inline__ struct sock *llc_get_sk_idx(loff_t pos) +static struct sock *llc_get_sk_idx(loff_t pos) { struct list_head *sap_entry; struct llc_sap *sap; @@ -44,15 +44,15 @@ sap = list_entry(sap_entry, struct llc_sap, node); read_lock_bh(&sap->sk_list.lock); - for (sk = sap->sk_list.list; pos && sk; sk = sk->next) - --pos; - if (!pos) { - if (!sk) - read_unlock_bh(&sap->sk_list.lock); - break; - } + for (sk = sap->sk_list.list; sk; sk = sk->next) + if (!pos--) { + if (!sk) + read_unlock_bh(&sap->sk_list.lock); + goto out; + } read_unlock_bh(&sap->sk_list.lock); } +out: return sk; } @@ -72,15 +72,7 @@ ++*pos; if (v == (void *)1) { - if (list_empty(&llc_main_station.sap_list.list)) { - sk = NULL; - goto out; - } - sap = list_entry(llc_main_station.sap_list.list.next, - struct llc_sap, node); - - read_lock_bh(&sap->sk_list.lock); - sk = sap->sk_list.list; + sk = llc_get_sk_idx(0); goto out; } sk = v; @@ -109,6 +101,13 @@ static void llc_seq_stop(struct seq_file *seq, void *v) { + if (v) { + struct sock *sk = v; + struct llc_opt *llc = llc_sk(sk); + struct llc_sap *sap = llc->sap; + + read_unlock_bh(&sap->sk_list.lock); + } read_unlock_bh(&llc_main_station.sap_list.lock); } =================================================================== This BitKeeper patch contains the following changesets: 1.822 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"unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/