netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] kill rtnl_exlock stubs
@ 2004-07-27 16:50 Stephen Hemminger
  2004-07-27 18:38 ` Patrick McHardy
  2004-07-29 13:16 ` Jamal Hadi Salim
  0 siblings, 2 replies; 5+ messages in thread
From: Stephen Hemminger @ 2004-07-27 16:50 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, Jamal Hadi Salim

Rtnetlink has some macro's that are relics from earlier locking.
They are only used a couple of places so are easy to kill.

diff -Nru a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h
--- a/include/linux/rtnetlink.h	2004-07-27 09:40:03 -07:00
+++ b/include/linux/rtnetlink.h	2004-07-27 09:40:03 -07:00
@@ -746,10 +746,6 @@
 
 extern struct semaphore rtnl_sem;
 
-#define rtnl_exlock()		do { } while(0)
-#define rtnl_exunlock()		do { } while(0)
-#define rtnl_exlock_nowait()	(0)
-
 #define rtnl_shlock()		down(&rtnl_sem)
 #define rtnl_shlock_nowait()	down_trylock(&rtnl_sem)
 
diff -Nru a/net/core/dev.c b/net/core/dev.c
--- a/net/core/dev.c	2004-07-27 09:40:03 -07:00
+++ b/net/core/dev.c	2004-07-27 09:40:03 -07:00
@@ -3041,7 +3041,6 @@
 	while (atomic_read(&dev->refcnt) != 0) {
 		if (time_after(jiffies, rebroadcast_time + 1 * HZ)) {
 			rtnl_shlock();
-			rtnl_exlock();
 
 			/* Rebroadcast unregister notification */
 			notifier_call_chain(&netdev_chain,
@@ -3058,7 +3057,6 @@
 				linkwatch_run_queue();
 			}
 
-			rtnl_exunlock();
 			rtnl_shunlock();
 
 			rebroadcast_time = jiffies;
diff -Nru a/net/core/link_watch.c b/net/core/link_watch.c
--- a/net/core/link_watch.c	2004-07-27 09:40:03 -07:00
+++ b/net/core/link_watch.c	2004-07-27 09:40:03 -07:00
@@ -93,9 +93,7 @@
 	clear_bit(LW_RUNNING, &linkwatch_flags);
 
 	rtnl_shlock();
-	rtnl_exlock();
 	linkwatch_run_queue();
-	rtnl_exunlock();
 	rtnl_shunlock();
 }
 
diff -Nru a/net/core/rtnetlink.c b/net/core/rtnetlink.c
--- a/net/core/rtnetlink.c	2004-07-27 09:40:03 -07:00
+++ b/net/core/rtnetlink.c	2004-07-27 09:40:03 -07:00
@@ -56,12 +56,10 @@
 void rtnl_lock(void)
 {
 	rtnl_shlock();
-	rtnl_exlock();
 }
  
 void rtnl_unlock(void)
 {
-	rtnl_exunlock();
 	rtnl_shunlock();
 
 	netdev_run_todo();
@@ -404,13 +402,8 @@
 		return -1;
 	}
 
-	if (kind != 2) {
-		if (rtnl_exlock_nowait()) {
-			*errp = 0;
-			return -1;
-		}
+	if (kind != 2) 
 		exclusive = 1;
-	}
 
 	memset(&rta, 0, sizeof(rta));
 
@@ -439,14 +432,10 @@
 		goto err_inval;
 	err = link->doit(skb, nlh, (void *)&rta);
 
-	if (exclusive)
-		rtnl_exunlock();
 	*errp = err;
 	return err;
 
 err_inval:
-	if (exclusive)
-		rtnl_exunlock();
 	*errp = -EINVAL;
 	return -1;
 }

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2004-07-29 14:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-07-27 16:50 [PATCH] kill rtnl_exlock stubs Stephen Hemminger
2004-07-27 18:38 ` Patrick McHardy
2004-07-29  1:59   ` David S. Miller
2004-07-29 13:16 ` Jamal Hadi Salim
2004-07-29 14:43   ` jamal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).