patch-2.3.40 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 --recursive --new-file v2.3.39/linux/drivers/block/DAC960.c linux/drivers/block/DAC960.c
@@ -1066,8 +1066,6 @@
   Controller->GenericDiskInfo.major_name = "rd";
   Controller->GenericDiskInfo.minor_shift = DAC960_MaxPartitionsBits;
   Controller->GenericDiskInfo.max_p = DAC960_MaxPartitions;
-  Controller->GenericDiskInfo.max_nr = DAC960_MaxLogicalDrives;
-  Controller->GenericDiskInfo.init = DAC960_InitializeGenericDiskInfo;
   Controller->GenericDiskInfo.nr_real = Controller->LogicalDriveCount;
   Controller->GenericDiskInfo.real_devices = Controller;
   Controller->GenericDiskInfo.next = NULL;
@@ -1166,6 +1164,7 @@
       Controller->MonitoringTimer.function = DAC960_MonitoringTimerFunction;
       add_timer(&Controller->MonitoringTimer);
       Controller->ControllerInitialized = true;
+      DAC960_InitializeGenericDiskInfo(&Controller->GenericDiskInfo);
     }
   else DAC960_FinalizeController(Controller);
 }
@@ -2439,7 +2438,6 @@
       Controller->LogicalDriveInitialState[LogicalDriveNumber] =
 	DAC960_LogicalDrive_Online;
       DAC960_InitializeGenericDiskInfo(&Controller->GenericDiskInfo);
-      resetup_one_dev(&Controller->GenericDiskInfo, LogicalDriveNumber);
     }
   if (Controller->GenericDiskInfo.sizes[MINOR(Inode->i_rdev)] == 0)
     return -ENXIO;
@@ -2573,7 +2571,13 @@
 	  */
 	  set_blocksize(Device, BLOCK_SIZE);
 	}
-      resetup_one_dev(&Controller->GenericDiskInfo, LogicalDriveNumber);
+      /*
+       * Leonard, I'll tie you, draw around you a pentagram
+       * and read this file. Aloud. 
+       */
+      grok_partitions(
+	&Controller->GenericDiskInfo, LogicalDriveNumber, DAC960_MaxPartitions,
+	Controller->LogicalDriveInformation[Controller->LogicalDriveInformationIndex][LogicalDriveNumber].LogicalDriveSize);
       return 0;
     }
   return -EINVAL;
@@ -2895,8 +2899,10 @@
   for (LogicalDriveNumber = 0;
        LogicalDriveNumber < Controller->LogicalDriveCount;
        LogicalDriveNumber++)
-    GenericDiskInfo->part[DAC960_MinorNumber(LogicalDriveNumber, 0)].nr_sects =
-      LogicalDriveInformation[LogicalDriveNumber].LogicalDriveSize;
+	register_disk(GenericDiskInfo, MKDEV(GenericDiskInfo->major,
+				       LogicalDriveNumber*DAC960_MaxPartitions),
+		DAC960_MaxPartitions, &DAC960_FileOperations,
+		LogicalDriveInformation[LogicalDriveNumber].LogicalDriveSize);
 }
 
 
@@ -3518,10 +3524,6 @@
       DAC960_Controller_T *Controller = DAC960_Controllers[ControllerNumber];
       if (Controller == NULL) continue;
       DAC960_InitializeGenericDiskInfo(&Controller->GenericDiskInfo);
-      for (LogicalDriveNumber = 0;
-	   LogicalDriveNumber < Controller->LogicalDriveCount;
-	   LogicalDriveNumber++)
-	resetup_one_dev(&Controller->GenericDiskInfo, LogicalDriveNumber);
     }
   return 0;
 }

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