Commit c2c00073 authored by Stephen Hemminger's avatar Stephen Hemminger Committed by David S. Miller

[NET]: Kill rtnl_exlock stubs.

Rtnetlink has some macro's that are relics from earlier locking.
They are only used a couple of places so are easy to kill.
Signed-off-by: default avatarStephen Hemminger <shemminger@osdl.org>
Signed-off-by: default avatarDavid S. Miller <davem@redhat.com>
parent 27f9a00a
...@@ -746,10 +746,6 @@ extern void rtmsg_ifinfo(int type, struct net_device *dev, unsigned change); ...@@ -746,10 +746,6 @@ extern void rtmsg_ifinfo(int type, struct net_device *dev, unsigned change);
extern struct semaphore rtnl_sem; 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() down(&rtnl_sem)
#define rtnl_shlock_nowait() down_trylock(&rtnl_sem) #define rtnl_shlock_nowait() down_trylock(&rtnl_sem)
......
...@@ -3041,7 +3041,6 @@ static void netdev_wait_allrefs(struct net_device *dev) ...@@ -3041,7 +3041,6 @@ static void netdev_wait_allrefs(struct net_device *dev)
while (atomic_read(&dev->refcnt) != 0) { while (atomic_read(&dev->refcnt) != 0) {
if (time_after(jiffies, rebroadcast_time + 1 * HZ)) { if (time_after(jiffies, rebroadcast_time + 1 * HZ)) {
rtnl_shlock(); rtnl_shlock();
rtnl_exlock();
/* Rebroadcast unregister notification */ /* Rebroadcast unregister notification */
notifier_call_chain(&netdev_chain, notifier_call_chain(&netdev_chain,
...@@ -3058,7 +3057,6 @@ static void netdev_wait_allrefs(struct net_device *dev) ...@@ -3058,7 +3057,6 @@ static void netdev_wait_allrefs(struct net_device *dev)
linkwatch_run_queue(); linkwatch_run_queue();
} }
rtnl_exunlock();
rtnl_shunlock(); rtnl_shunlock();
rebroadcast_time = jiffies; rebroadcast_time = jiffies;
......
...@@ -93,9 +93,7 @@ static void linkwatch_event(void *dummy) ...@@ -93,9 +93,7 @@ static void linkwatch_event(void *dummy)
clear_bit(LW_RUNNING, &linkwatch_flags); clear_bit(LW_RUNNING, &linkwatch_flags);
rtnl_shlock(); rtnl_shlock();
rtnl_exlock();
linkwatch_run_queue(); linkwatch_run_queue();
rtnl_exunlock();
rtnl_shunlock(); rtnl_shunlock();
} }
......
...@@ -56,12 +56,10 @@ DECLARE_MUTEX(rtnl_sem); ...@@ -56,12 +56,10 @@ DECLARE_MUTEX(rtnl_sem);
void rtnl_lock(void) void rtnl_lock(void)
{ {
rtnl_shlock(); rtnl_shlock();
rtnl_exlock();
} }
void rtnl_unlock(void) void rtnl_unlock(void)
{ {
rtnl_exunlock();
rtnl_shunlock(); rtnl_shunlock();
netdev_run_todo(); netdev_run_todo();
...@@ -404,13 +402,8 @@ rtnetlink_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh, int *errp) ...@@ -404,13 +402,8 @@ rtnetlink_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh, int *errp)
return -1; return -1;
} }
if (kind != 2) { if (kind != 2)
if (rtnl_exlock_nowait()) {
*errp = 0;
return -1;
}
exclusive = 1; exclusive = 1;
}
memset(&rta, 0, sizeof(rta)); memset(&rta, 0, sizeof(rta));
...@@ -439,14 +432,10 @@ rtnetlink_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh, int *errp) ...@@ -439,14 +432,10 @@ rtnetlink_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh, int *errp)
goto err_inval; goto err_inval;
err = link->doit(skb, nlh, (void *)&rta); err = link->doit(skb, nlh, (void *)&rta);
if (exclusive)
rtnl_exunlock();
*errp = err; *errp = err;
return err; return err;
err_inval: err_inval:
if (exclusive)
rtnl_exunlock();
*errp = -EINVAL; *errp = -EINVAL;
return -1; return -1;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment