소스 검색

osst: cdev lock_kernel() pushdown.

Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Jonathan Corbet 17 년 전
부모
커밋
647d87bd1b
1개의 변경된 파일14개의 추가작업 그리고 1개의 파일을 삭제
  1. 14 1
      drivers/scsi/osst.c

+ 14 - 1
drivers/scsi/osst.c

@@ -50,6 +50,7 @@ static const char * osst_version = "0.99.4";
 #include <linux/moduleparam.h>
 #include <linux/moduleparam.h>
 #include <linux/delay.h>
 #include <linux/delay.h>
 #include <linux/jiffies.h>
 #include <linux/jiffies.h>
+#include <linux/smp_lock.h>
 #include <asm/uaccess.h>
 #include <asm/uaccess.h>
 #include <asm/dma.h>
 #include <asm/dma.h>
 #include <asm/system.h>
 #include <asm/system.h>
@@ -4359,7 +4360,7 @@ os_bypass:
 
 
 
 
 /* Open the device */
 /* Open the device */
-static int os_scsi_tape_open(struct inode * inode, struct file * filp)
+static int __os_scsi_tape_open(struct inode * inode, struct file * filp)
 {
 {
 	unsigned short	      flags;
 	unsigned short	      flags;
 	int		      i, b_size, new_session = 0, retval = 0;
 	int		      i, b_size, new_session = 0, retval = 0;
@@ -4725,6 +4726,18 @@ err_out:
 	return retval;
 	return retval;
 }
 }
 
 
+/* BKL pushdown: spaghetti avoidance wrapper */
+static int os_scsi_tape_open(struct inode * inode, struct file * filp)
+{
+	int ret;
+
+	lock_kernel();
+	ret = __os_scsi_tape_open(inode, filp);
+	unlock_kernel();
+	return ret;
+}
+
+
 
 
 /* Flush the tape buffer before close */
 /* Flush the tape buffer before close */
 static int os_scsi_tape_flush(struct file * filp, fl_owner_t id)
 static int os_scsi_tape_flush(struct file * filp, fl_owner_t id)