summaryrefslogtreecommitdiff
path: root/datapath/dp_notify.c
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2011-01-26 12:49:06 -0800
committerBen Pfaff <blp@nicira.com>2011-01-27 21:08:42 -0800
commited099e921e30d3720c5ad7d1b4f911bb23911bf3 (patch)
tree461d64f4f9aba073a032f5667e5683c0d9cdfb4f /datapath/dp_notify.c
parent057dd6d279c20e88f98bbe8328383564391bbc8f (diff)
downloadopenvswitch-ed099e921e30d3720c5ad7d1b4f911bb23911bf3.tar.gz
datapath: Adopt Generic Netlink-compatible locking.
The kernel Generic Netlink layer always holds a mutex (genl_lock) when it invokes callbacks, so that means that there is no point in having per-datapath mutexes or a separate vport lock. This commit removes them. This commit breaks support for Linux before 2.6.35 because it calls genl_lock(), which wasn't exported before that version. That problem will be fixed once the whole userspace interface transitions to Generic Netlink a few commits from now. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com>
Diffstat (limited to 'datapath/dp_notify.c')
-rw-r--r--datapath/dp_notify.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/datapath/dp_notify.c b/datapath/dp_notify.c
index 1415833fd..8c54d6831 100644
--- a/datapath/dp_notify.c
+++ b/datapath/dp_notify.c
@@ -1,6 +1,6 @@
/*
* Distributed under the terms of the GNU GPL version 2.
- * Copyright (c) 2007, 2008, 2009, 2010 Nicira Networks.
+ * Copyright (c) 2007, 2008, 2009, 2010, 2011 Nicira Networks.
*
* Significant portions of this file may be copied from parts of the Linux
* kernel, by Linus Torvalds and others.
@@ -33,19 +33,14 @@ static int dp_device_event(struct notifier_block *unused, unsigned long event,
switch (event) {
case NETDEV_UNREGISTER:
- if (!is_internal_dev(dev)) {
- mutex_lock(&dp->mutex);
+ if (!is_internal_dev(dev))
dp_detach_port(vport);
- mutex_unlock(&dp->mutex);
- }
break;
case NETDEV_CHANGENAME:
if (vport->port_no != ODPP_LOCAL) {
- mutex_lock(&dp->mutex);
dp_sysfs_del_if(vport);
dp_sysfs_add_if(vport);
- mutex_unlock(&dp->mutex);
}
break;