]> jspc29.x-matter.uni-frankfurt.de Git - trbnettools.git/commitdiff
mutex update for kernel >3.XX
authorhadaq <hadaq>
Wed, 7 Mar 2012 02:12:50 +0000 (02:12 +0000)
committerhadaq <hadaq>
Wed, 7 Mar 2012 02:12:50 +0000 (02:12 +0000)
pexor/kernel-module/pexor_trb.c

index 8ab5747de1cf0ba682258073abdc8b9279842f2c..607542f3465212a1be6f064aaec6602654b66a89 100644 (file)
@@ -8,7 +8,8 @@
 #include <linux/fs.h>
 #include <linux/delay.h>
 #include <linux/spinlock.h>
-#include <linux/smp_lock.h>
+//#include <linux/smp_lock.h>
+//#include <linux/mutex.h>
 
 #include <linux/mm.h>
 #include <linux/pagemap.h>
@@ -864,15 +865,21 @@ int pexor_ioctl_write_register(struct pexor_privdata *priv, unsigned long arg)
   return retval;
 }
 
+
+DEFINE_MUTEX(fs_mutex);
+
+
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)
 long pexor_unlocked_ioctl(struct file *filp,
                           unsigned int cmd, unsigned long arg)
 {
   long ret;
 
-  lock_kernel();
+  mutex_lock(&fs_mutex);
+
   ret = pexor_ioctl(filp->f_path.dentry->d_inode, filp, cmd, arg);
-  unlock_kernel();
+
+  mutex_unlock(&fs_mutex);
 
   return ret;
 }