"Fossies" - the Fresh Open Source Software archive

Member "aoe6-83/conf/35-patches/old-new.diff" of archive aoe6-83.tar.gz:


--- aoe6-78pre1/linux/drivers/block/aoe/aoechr.c.20111206	2011-12-06 21:29:47.000000000 -0500
+++ aoe6-78pre1/linux/drivers/block/aoe/aoechr.c	2011-12-06 21:45:50.000000000 -0500
@@ -8,7 +8,7 @@
 #include <linux/blkdev.h>
 #include <linux/init.h>
 #include <linux/delay.h>
-#include <linux/smp_lock.h>
+#include <linux/mutex.h>
 #include <linux/slab.h>
 #include "aoe.h"
 
@@ -53,6 +53,7 @@
 	{ MINOR_REVALIDATE, "revalidate" },
 	{ MINOR_FLUSH, "flush" },
 };
+static DEFINE_MUTEX(aoechr_mutex);
 
 static int
 discover(void)
@@ -182,16 +183,16 @@
 {
 	int n, i;
 
-	lock_kernel();
+	mutex_lock(&aoechr_mutex);
 	n = MINOR(inode->i_rdev);
 	filp->private_data = (void *) (unsigned long) n;
 
 	for (i = 0; i < ARRAY_SIZE(chardevs); ++i)
 		if (chardevs[i].minor == n) {
-			unlock_kernel();
+			mutex_unlock(&aoechr_mutex);
 			return 0;
 		}
-	unlock_kernel();
+	mutex_unlock(&aoechr_mutex);
 	return -EINVAL;
 }