Skip to content

Commit

Permalink
net: core: add __netdev_upper_dev_unlink()
Browse files Browse the repository at this point in the history
The netdev_upper_dev_unlink() has to work differently according to flags.
This idea is the same with __netdev_upper_dev_link().

In the following patches, new flags will be added.

Signed-off-by: Taehee Yoo <ap420073@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Taehee Yoo authored and David S. Miller committed Sep 28, 2020
1 parent 1aad804 commit fe8300f
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions net/core/dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -7762,16 +7762,8 @@ int netdev_master_upper_dev_link(struct net_device *dev,
}
EXPORT_SYMBOL(netdev_master_upper_dev_link);

/**
* netdev_upper_dev_unlink - Removes a link to upper device
* @dev: device
* @upper_dev: new upper device
*
* Removes a link to device which is upper to this one. The caller must hold
* the RTNL lock.
*/
void netdev_upper_dev_unlink(struct net_device *dev,
struct net_device *upper_dev)
static void __netdev_upper_dev_unlink(struct net_device *dev,
struct net_device *upper_dev)
{
struct netdev_notifier_changeupper_info changeupper_info = {
.info = {
Expand Down Expand Up @@ -7800,6 +7792,20 @@ void netdev_upper_dev_unlink(struct net_device *dev,
__netdev_walk_all_upper_dev(upper_dev, __netdev_update_lower_level,
NULL);
}

/**
* netdev_upper_dev_unlink - Removes a link to upper device
* @dev: device
* @upper_dev: new upper device
*
* Removes a link to device which is upper to this one. The caller must hold
* the RTNL lock.
*/
void netdev_upper_dev_unlink(struct net_device *dev,
struct net_device *upper_dev)
{
__netdev_upper_dev_unlink(dev, upper_dev);
}
EXPORT_SYMBOL(netdev_upper_dev_unlink);

static void __netdev_adjacent_dev_set(struct net_device *upper_dev,
Expand Down

0 comments on commit fe8300f

Please sign in to comment.