patch-2.2.18 linux/drivers/block/DAC960.c

Next file: linux/drivers/block/Makefile
Previous file: linux/drivers/block/Config.in
Back to the patch index
Back to the overall index

diff -u --new-file --recursive --exclude-from /usr/src/exclude v2.2.17/drivers/block/DAC960.c linux/drivers/block/DAC960.c
@@ -19,8 +19,8 @@
 */
 
 
-#define DAC960_DriverVersion			"2.2.8"
-#define DAC960_DriverDate			"19 August 2000"
+#define DAC960_DriverVersion			"2.2.9"
+#define DAC960_DriverDate			"7 September 2000"
 
 
 #include <linux/version.h>
@@ -310,13 +310,8 @@
 
 static void DAC960_WaitForCommand(DAC960_Controller_T *Controller)
 {
-  WaitQueue_T WaitQueueEntry = { current, NULL };
-  add_wait_queue(&Controller->CommandWaitQueue, &WaitQueueEntry);
-  current->state = TASK_UNINTERRUPTIBLE;
-  spin_unlock(&io_request_lock);
-  schedule();
-  current->state = TASK_RUNNING;
-  remove_wait_queue(&Controller->CommandWaitQueue, &WaitQueueEntry);
+  spin_unlock_irq(&io_request_lock);
+  __wait_event(Controller->CommandWaitQueue, Controller->FreeCommands);
   spin_lock_irq(&io_request_lock);
 }
 
@@ -5053,7 +5048,8 @@
 	}
       Geometry.start =
 	Controller->GenericDiskInfo.part[MINOR(Inode->i_rdev)].start_sect;
-      return copy_to_user(UserGeometry, &Geometry, sizeof(DiskGeometry_T));
+      return (copy_to_user(UserGeometry, &Geometry,
+			   sizeof(DiskGeometry_T)) ? -EFAULT : 0);
     case BLKGETSIZE:
       /* Get Device Size. */
       if ((long *) Argument == NULL) return -EINVAL;
@@ -5161,8 +5157,8 @@
 	ControllerInfo.PCI_Address = Controller->PCI_Address;
 	strcpy(ControllerInfo.ModelName, Controller->ModelName);
 	strcpy(ControllerInfo.FirmwareVersion, Controller->FirmwareVersion);
-	return copy_to_user(UserSpaceControllerInfo, &ControllerInfo,
-			    sizeof(DAC960_ControllerInfo_T));
+	return (copy_to_user(UserSpaceControllerInfo, &ControllerInfo,
+			     sizeof(DAC960_ControllerInfo_T)) ? -EFAULT : 0);
       }
     case DAC960_IOCTL_V1_EXECUTE_COMMAND:
       {
@@ -6484,7 +6480,7 @@
   unsigned char CommandBuffer[80];
   int Length;
   if (Count > sizeof(CommandBuffer)-1) return -EINVAL;
-  copy_from_user(CommandBuffer, Buffer, Count);
+  if (copy_from_user(CommandBuffer, Buffer, Count)) return -EFAULT;
   CommandBuffer[Count] = '\0';
   Length = strlen(CommandBuffer);
   if (CommandBuffer[Length-1] == '\n')

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)