Commit fa85be80 authored by Stephen Hemminger's avatar Stephen Hemminger Committed by David S. Miller

[TOKENRING]: spin_lock consistency.

Use spin_lock on hash table consistently, this code is only called
from bottom half context, never from interrupt context so use spin_lock_bh.
parent 7384a506
...@@ -236,9 +236,8 @@ void tr_source_route(struct sk_buff *skb,struct trh_hdr *trh,struct net_device * ...@@ -236,9 +236,8 @@ void tr_source_route(struct sk_buff *skb,struct trh_hdr *trh,struct net_device *
struct rif_cache_s *entry; struct rif_cache_s *entry;
unsigned char *olddata; unsigned char *olddata;
unsigned char mcast_func_addr[] = {0xC0,0x00,0x00,0x04,0x00,0x00}; unsigned char mcast_func_addr[] = {0xC0,0x00,0x00,0x04,0x00,0x00};
unsigned long flags ;
spin_lock_irqsave(&rif_lock,flags); spin_lock_bh(&rif_lock);
/* /*
* Broadcasts are single route as stated in RFC 1042 * Broadcasts are single route as stated in RFC 1042
...@@ -308,7 +307,7 @@ printk("source routing for %02X:%02X:%02X:%02X:%02X:%02X\n",trh->daddr[0], ...@@ -308,7 +307,7 @@ printk("source routing for %02X:%02X:%02X:%02X:%02X:%02X\n",trh->daddr[0],
else else
slack = 18 - ((ntohs(trh->rcf) & TR_RCF_LEN_MASK)>>8); slack = 18 - ((ntohs(trh->rcf) & TR_RCF_LEN_MASK)>>8);
olddata = skb->data; olddata = skb->data;
spin_unlock_irqrestore(&rif_lock,flags); spin_unlock_bh(&rif_lock);
skb_pull(skb, slack); skb_pull(skb, slack);
memmove(skb->data, olddata, sizeof(struct trh_hdr) - slack); memmove(skb->data, olddata, sizeof(struct trh_hdr) - slack);
...@@ -418,9 +417,8 @@ static void rif_check_expire(unsigned long dummy) ...@@ -418,9 +417,8 @@ static void rif_check_expire(unsigned long dummy)
{ {
int i; int i;
unsigned long now=jiffies; unsigned long now=jiffies;
unsigned long flags ;
spin_lock_irqsave(&rif_lock,flags); spin_lock_bh(&rif_lock);
for(i=0; i < RIF_TABLE_SIZE;i++) for(i=0; i < RIF_TABLE_SIZE;i++)
{ {
...@@ -440,7 +438,7 @@ static void rif_check_expire(unsigned long dummy) ...@@ -440,7 +438,7 @@ static void rif_check_expire(unsigned long dummy)
} }
} }
spin_unlock_irqrestore(&rif_lock,flags); spin_unlock_bh(&rif_lock);
/* /*
* Reset the timer * Reset the timer
...@@ -477,10 +475,7 @@ static struct rif_cache_s *rif_get_idx(loff_t pos) ...@@ -477,10 +475,7 @@ static struct rif_cache_s *rif_get_idx(loff_t pos)
static void *rif_seq_start(struct seq_file *seq, loff_t *pos) static void *rif_seq_start(struct seq_file *seq, loff_t *pos)
{ {
unsigned long flags; spin_lock_bh(&rif_lock);
spin_lock_irqsave(&rif_lock, flags);
seq->private = (void *) flags;
return *pos ? rif_get_idx(*pos - 1) : RIF_PROC_START; return *pos ? rif_get_idx(*pos - 1) : RIF_PROC_START;
} }
...@@ -492,8 +487,7 @@ static void *rif_seq_next(struct seq_file *seq, void *v, loff_t *pos) ...@@ -492,8 +487,7 @@ static void *rif_seq_next(struct seq_file *seq, void *v, loff_t *pos)
static void rif_seq_stop(struct seq_file *seq, void *v) static void rif_seq_stop(struct seq_file *seq, void *v)
{ {
unsigned long flags = (unsigned long) seq->private; spin_unlock_bh(&rif_lock);
spin_lock_irqsave(&rif_lock, flags);
} }
static int rif_seq_show(struct seq_file *seq, void *v) static int rif_seq_show(struct seq_file *seq, void *v)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment