Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 277566
b: refs/heads/master
c: 61dc346
h: refs/heads/master
v: v3
  • Loading branch information
Jiri Pirko authored and David S. Miller committed Nov 16, 2011
1 parent 8c74bb5 commit 4bbaf97
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8c0713a57482ebfadef197c856a38af3a55444c6
refs/heads/master: 61dc3461b9549bc10a2f16d254250680cadafcce
32 changes: 16 additions & 16 deletions trunk/drivers/net/team/team.c
Original file line number Diff line number Diff line change
Expand Up @@ -443,9 +443,9 @@ static void __team_compute_features(struct team *team)

static void team_compute_features(struct team *team)
{
spin_lock(&team->lock);
mutex_lock(&team->lock);
__team_compute_features(team);
spin_unlock(&team->lock);
mutex_unlock(&team->lock);
}

static int team_port_enter(struct team *team, struct team_port *port)
Expand Down Expand Up @@ -647,7 +647,7 @@ static int team_init(struct net_device *dev)
int i;

team->dev = dev;
spin_lock_init(&team->lock);
mutex_init(&team->lock);

team->pcpu_stats = alloc_percpu(struct team_pcpu_stats);
if (!team->pcpu_stats)
Expand All @@ -672,13 +672,13 @@ static void team_uninit(struct net_device *dev)
struct team_port *port;
struct team_port *tmp;

spin_lock(&team->lock);
mutex_lock(&team->lock);
list_for_each_entry_safe(port, tmp, &team->port_list, list)
team_port_del(team, port->dev);

__team_change_mode(team, NULL); /* cleanup */
__team_options_unregister(team, team_options, ARRAY_SIZE(team_options));
spin_unlock(&team->lock);
mutex_unlock(&team->lock);
}

static void team_destructor(struct net_device *dev)
Expand Down Expand Up @@ -784,7 +784,7 @@ static int team_change_mtu(struct net_device *dev, int new_mtu)
* Alhough this is reader, it's guarded by team lock. It's not possible
* to traverse list in reverse under rcu_read_lock
*/
spin_lock(&team->lock);
mutex_lock(&team->lock);
list_for_each_entry(port, &team->port_list, list) {
err = dev_set_mtu(port->dev, new_mtu);
if (err) {
Expand All @@ -793,7 +793,7 @@ static int team_change_mtu(struct net_device *dev, int new_mtu)
goto unwind;
}
}
spin_unlock(&team->lock);
mutex_unlock(&team->lock);

dev->mtu = new_mtu;

Expand All @@ -802,7 +802,7 @@ static int team_change_mtu(struct net_device *dev, int new_mtu)
unwind:
list_for_each_entry_continue_reverse(port, &team->port_list, list)
dev_set_mtu(port->dev, dev->mtu);
spin_unlock(&team->lock);
mutex_unlock(&team->lock);

return err;
}
Expand Down Expand Up @@ -880,9 +880,9 @@ static int team_add_slave(struct net_device *dev, struct net_device *port_dev)
struct team *team = netdev_priv(dev);
int err;

spin_lock(&team->lock);
mutex_lock(&team->lock);
err = team_port_add(team, port_dev);
spin_unlock(&team->lock);
mutex_unlock(&team->lock);
return err;
}

Expand All @@ -891,9 +891,9 @@ static int team_del_slave(struct net_device *dev, struct net_device *port_dev)
struct team *team = netdev_priv(dev);
int err;

spin_lock(&team->lock);
mutex_lock(&team->lock);
err = team_port_del(team, port_dev);
spin_unlock(&team->lock);
mutex_unlock(&team->lock);
return err;
}

Expand Down Expand Up @@ -1064,13 +1064,13 @@ static struct team *team_nl_team_get(struct genl_info *info)
}

team = netdev_priv(dev);
spin_lock(&team->lock);
mutex_lock(&team->lock);
return team;
}

static void team_nl_team_put(struct team *team)
{
spin_unlock(&team->lock);
mutex_unlock(&team->lock);
dev_put(team->dev);
}

Expand Down Expand Up @@ -1486,9 +1486,9 @@ static void team_port_change_check(struct team_port *port, bool linkup)
{
struct team *team = port->team;

spin_lock(&team->lock);
mutex_lock(&team->lock);
__team_port_change_check(port, linkup);
spin_unlock(&team->lock);
mutex_unlock(&team->lock);
}

/************************************
Expand Down
2 changes: 1 addition & 1 deletion trunk/include/linux/if_team.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ struct team {
struct net_device *dev; /* associated netdevice */
struct team_pcpu_stats __percpu *pcpu_stats;

spinlock_t lock; /* used for overall locking, e.g. port lists write */
struct mutex lock; /* used for overall locking, e.g. port lists write */

/*
* port lists with port count
Expand Down

0 comments on commit 4bbaf97

Please sign in to comment.