aboutsummaryrefslogtreecommitdiffstats
path: root/net/llc/llc_proc.c
diff options
context:
space:
mode:
authorOctavian Purdila <opurdila@ixiacom.com>2009-12-26 06:51:06 -0500
committerDavid S. Miller <davem@davemloft.net>2009-12-26 23:46:28 -0500
commit8beb9ab6c2df203e8d68cb1f48cf42604a6bed86 (patch)
treef342d582af0dd5f62016edcd2a50d2873ebcdbf2 /net/llc/llc_proc.c
parent52d58aef5ee460fedd7f250f05e79081019f2c79 (diff)
llc: convert llc_sap_list to RCU
Signed-off-by: Octavian Purdila <opurdila@ixiacom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/llc/llc_proc.c')
-rw-r--r--net/llc/llc_proc.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/net/llc/llc_proc.c b/net/llc/llc_proc.c
index 09dec6307206..7af1ff2d1f19 100644
--- a/net/llc/llc_proc.c
+++ b/net/llc/llc_proc.c
@@ -32,14 +32,11 @@ static void llc_ui_format_mac(struct seq_file *seq, u8 *addr)
32 32
33static struct sock *llc_get_sk_idx(loff_t pos) 33static struct sock *llc_get_sk_idx(loff_t pos)
34{ 34{
35 struct list_head *sap_entry;
36 struct llc_sap *sap; 35 struct llc_sap *sap;
37 struct sock *sk = NULL; 36 struct sock *sk = NULL;
38 int i; 37 int i;
39 38
40 list_for_each(sap_entry, &llc_sap_list) { 39 list_for_each_entry_rcu(sap, &llc_sap_list, node) {
41 sap = list_entry(sap_entry, struct llc_sap, node);
42
43 spin_lock_bh(&sap->sk_lock); 40 spin_lock_bh(&sap->sk_lock);
44 for (i = 0; i < LLC_SK_LADDR_HASH_ENTRIES; i++) { 41 for (i = 0; i < LLC_SK_LADDR_HASH_ENTRIES; i++) {
45 struct hlist_nulls_head *head = &sap->sk_laddr_hash[i]; 42 struct hlist_nulls_head *head = &sap->sk_laddr_hash[i];
@@ -62,7 +59,7 @@ static void *llc_seq_start(struct seq_file *seq, loff_t *pos)
62{ 59{
63 loff_t l = *pos; 60 loff_t l = *pos;
64 61
65 read_lock_bh(&llc_sap_list_lock); 62 rcu_read_lock_bh();
66 return l ? llc_get_sk_idx(--l) : SEQ_START_TOKEN; 63 return l ? llc_get_sk_idx(--l) : SEQ_START_TOKEN;
67} 64}
68 65
@@ -102,7 +99,7 @@ static void *llc_seq_next(struct seq_file *seq, void *v, loff_t *pos)
102 if (sk) 99 if (sk)
103 goto out; 100 goto out;
104 spin_unlock_bh(&sap->sk_lock); 101 spin_unlock_bh(&sap->sk_lock);
105 list_for_each_entry_continue(sap, &llc_sap_list, node) { 102 list_for_each_entry_continue_rcu(sap, &llc_sap_list, node) {
106 spin_lock_bh(&sap->sk_lock); 103 spin_lock_bh(&sap->sk_lock);
107 sk = laddr_hash_next(sap, -1); 104 sk = laddr_hash_next(sap, -1);
108 if (sk) 105 if (sk)
@@ -122,7 +119,7 @@ static void llc_seq_stop(struct seq_file *seq, void *v)
122 119
123 spin_unlock_bh(&sap->sk_lock); 120 spin_unlock_bh(&sap->sk_lock);
124 } 121 }
125 read_unlock_bh(&llc_sap_list_lock); 122 rcu_read_unlock_bh();
126} 123}
127 124
128static int llc_seq_socket_show(struct seq_file *seq, void *v) 125static int llc_seq_socket_show(struct seq_file *seq, void *v)