Skip to content

Commit

Permalink
bonding: remove dev_base_lock use
Browse files Browse the repository at this point in the history
bond_info_seq_start() uses a read_lock(&dev_base_lock) to make sure
device doesn’t disappear. Same goal can be achieved using RCU.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Nov 8, 2010
1 parent 840a185 commit e4a7b93
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/net/bonding/bond_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -3209,7 +3209,7 @@ void bond_activebackup_arp_mon(struct work_struct *work)
#ifdef CONFIG_PROC_FS

static void *bond_info_seq_start(struct seq_file *seq, loff_t *pos)
__acquires(&dev_base_lock)
__acquires(RCU)
__acquires(&bond->lock)
{
struct bonding *bond = seq->private;
Expand All @@ -3218,7 +3218,7 @@ static void *bond_info_seq_start(struct seq_file *seq, loff_t *pos)
int i;

/* make sure the bond won't be taken away */
read_lock(&dev_base_lock);
rcu_read_lock();
read_lock(&bond->lock);

if (*pos == 0)
Expand Down Expand Up @@ -3248,12 +3248,12 @@ static void *bond_info_seq_next(struct seq_file *seq, void *v, loff_t *pos)

static void bond_info_seq_stop(struct seq_file *seq, void *v)
__releases(&bond->lock)
__releases(&dev_base_lock)
__releases(RCU)
{
struct bonding *bond = seq->private;

read_unlock(&bond->lock);
read_unlock(&dev_base_lock);
rcu_read_unlock();
}

static void bond_info_show_master(struct seq_file *seq)
Expand Down

0 comments on commit e4a7b93

Please sign in to comment.