patch-2.4.27 linux-2.4.27/net/bridge/br_ioctl.c
Next file: linux-2.4.27/net/bridge/br_private.h
Previous file: linux-2.4.27/net/bridge/br_if.c
Back to the patch index
Back to the overall index
- Lines: 60
- Date:
2004-08-07 16:26:06.821435820 -0700
- Orig file:
linux-2.4.26/net/bridge/br_ioctl.c
- Orig date:
2003-06-13 07:51:39.000000000 -0700
diff -urN linux-2.4.26/net/bridge/br_ioctl.c linux-2.4.27/net/bridge/br_ioctl.c
@@ -16,6 +16,7 @@
#include <linux/kernel.h>
#include <linux/if_bridge.h>
#include <linux/inetdevice.h>
+#include <linux/rtnetlink.h>
#include <asm/uaccess.h>
#include "br_private.h"
@@ -230,12 +231,10 @@
return -EOPNOTSUPP;
}
-static DECLARE_MUTEX(ioctl_mutex);
-
int br_ioctl_deviceless_stub(unsigned long arg)
{
- int err;
unsigned long i[3];
+ int err;
if (!capable(CAP_NET_ADMIN))
return -EPERM;
@@ -243,32 +242,17 @@
if (copy_from_user(i, (void *)arg, 3*sizeof(unsigned long)))
return -EFAULT;
- down(&ioctl_mutex);
- err = br_ioctl_deviceless(i[0], i[1], i[2]);
- up(&ioctl_mutex);
-
+ rtnl_lock();
+ err = br_ioctl_deviceless(i[0], i[1], i[2]);
+ rtnl_unlock();
return err;
}
int br_ioctl(struct net_bridge *br, unsigned int cmd, unsigned long arg0, unsigned long arg1, unsigned long arg2)
{
- int err;
-
if (!capable(CAP_NET_ADMIN))
return -EPERM;
- down(&ioctl_mutex);
- err = br_ioctl_deviceless(cmd, arg0, arg1);
- if (err == -EOPNOTSUPP)
- err = br_ioctl_device(br, cmd, arg0, arg1, arg2);
- up(&ioctl_mutex);
-
- return err;
-}
-
-void br_call_ioctl_atomic(void (*fn)(void))
-{
- down(&ioctl_mutex);
- fn();
- up(&ioctl_mutex);
+ ASSERT_RTNL();
+ return br_ioctl_device(br, cmd, arg0, arg1, arg2);
}
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)