Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 202693
b: refs/heads/master
c: 8b37ef0
h: refs/heads/master
i:
  202691: 784aeb1
v: v3
  • Loading branch information
Jiri Pirko authored and David S. Miller committed Jun 8, 2010
1 parent c0ac603 commit da6a321
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 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: 271c1dfa61bc90a57648ff96f3eb92d4b4d4f11e
refs/heads/master: 8b37ef0a1f6c2401fea3536facfa21191936bd6c
12 changes: 10 additions & 2 deletions trunk/drivers/net/macvlan.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ struct macvlan_port {
struct net_device *dev;
struct hlist_head vlan_hash[MACVLAN_HASH_SIZE];
struct list_head vlans;
struct rcu_head rcu;
};

static struct macvlan_dev *macvlan_hash_lookup(const struct macvlan_port *port,
Expand Down Expand Up @@ -540,14 +541,21 @@ static int macvlan_port_create(struct net_device *dev)
return err;
}

static void macvlan_port_rcu_free(struct rcu_head *head)
{
struct macvlan_port *port;

port = container_of(head, struct macvlan_port, rcu);
kfree(port);
}

static void macvlan_port_destroy(struct net_device *dev)
{
struct macvlan_port *port = dev->macvlan_port;

netdev_rx_handler_unregister(dev);
rcu_assign_pointer(dev->macvlan_port, NULL);
synchronize_rcu();
kfree(port);
call_rcu(&port->rcu, macvlan_port_rcu_free);
}

static int macvlan_validate(struct nlattr *tb[], struct nlattr *data[])
Expand Down

0 comments on commit da6a321

Please sign in to comment.