Skip to contentSkip to conversation

Remove unneded lock_kernel() in drivers/block/loop.c

PATCH Diego Woitasen 1 participant 1 message Jul 8, 2007 Block layer

lore
Share & tools
lore
#0 lore raw

This patch remove the unneeded lock_kernel() in drivers/block/loop.c. I read the code and this lock_kernel() doesn't protect anything. Loopback code use lo_ctl_mutex for syncronization.

drivers/block/loop.c +0 -2
index 0ed5470..1cc004e 100644
@@ -1286,7 +1286,6 @@ static long lo_compat_ioctl(struct file *file, unsigned int cmd, unsigned long a
 	struct loop_device *lo = inode->i_bdev->bd_disk->private_data;
 	int err;
 
-	lock_kernel();
 	switch(cmd) {
 	case LOOP_SET_STATUS:
 		mutex_lock(&lo->lo_ctl_mutex);
@@ -1312,7 +1311,6 @@ static long lo_compat_ioctl(struct file *file, unsigned int cmd, unsigned long a
 		err = -ENOIOCTLCMD;
 		break;
 	}
-	unlock_kernel();
 	return err;
 }
 #endif
Signature · 2 lines
--------------
Diego Woitasen