olsrd: hotplug: optimize execution-speed and simplify using already existing GLOBAL...
[feed/routing.git] / batmand / patches / 100-2.6.36.patch
1 ---
2 batman/linux/modules/gateway.c | 19 +++++++++++++++++++
3 1 file changed, 19 insertions(+)
4
5 --- batmand-r1439.orig/batman/linux/modules/gateway.c
6 +++ batmand-r1439/batman/linux/modules/gateway.c
7 @@ -29,6 +29,7 @@ static struct class *batman_class;
8 static int batgat_open(struct inode *inode, struct file *filp);
9 static int batgat_release(struct inode *inode, struct file *file);
10 static int batgat_ioctl( struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg );
11 +static long batgat_ioctl_unlocked(struct file *file, unsigned int cmd, unsigned long arg );
12
13
14 static void udp_data_ready(struct sock *sk, int len);
15 @@ -53,7 +54,11 @@ static int proc_clients_read(char *buf,
16 static struct file_operations fops = {
17 .open = batgat_open,
18 .release = batgat_release,
19 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)
20 + .unlocked_ioctl = batgat_ioctl_unlocked,
21 +#else
22 .ioctl = batgat_ioctl,
23 +#endif
24 };
25
26
27 @@ -166,6 +171,20 @@ static int batgat_release(struct inode *
28 }
29
30
31 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)
32 +#include <linux/smp_lock.h>
33 +static long batgat_ioctl_unlocked(struct file *file, unsigned int cmd, unsigned long arg )
34 +{
35 + int ret;
36 +
37 + lock_kernel();
38 + ret = batgat_ioctl(file->f_path.dentry->d_inode, file, cmd, arg);
39 + unlock_kernel();
40 +
41 + return ret;
42 +}
43 +#endif
44 +
45 static int batgat_ioctl( struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg )
46 {
47 uint8_t tmp_ip[4];