patch-2.2.19 linux/drivers/s390/block/dasd_fba.c

Next file: linux/drivers/s390/block/dasd_fba.h
Previous file: linux/drivers/s390/block/dasd_eckd.h
Back to the patch index
Back to the overall index

diff -u --new-file --recursive --exclude-from /usr/src/exclude v2.2.18/drivers/s390/block/dasd_fba.c linux/drivers/s390/block/dasd_fba.c
@@ -117,13 +117,14 @@
                          "Null device pointer passed to characteristics checker\n");
                 return -ENODEV;
         }
+        if ( device->private != NULL ) {
+                kfree(device->private);
+        }
+        device->private = kmalloc(sizeof(dasd_fba_private_t),GFP_KERNEL);
         if ( device->private == NULL ) {
-		device->private = kmalloc(sizeof(dasd_fba_private_t),GFP_KERNEL);
-		if ( device->private == NULL ) {
-			printk ( KERN_WARNING PRINTK_HEADER
-				 "memory allocation failed for private data\n");
-			return -ENOMEM;
-		}
+                printk ( KERN_WARNING PRINTK_HEADER
+                         "memory allocation failed for private data\n");
+                return -ENOMEM;
         }
         private = (dasd_fba_private_t *)device->private;
         rdc_data = (void *)&(private->rdc_data);
@@ -181,9 +182,7 @@
         int rc = 0;
 	unsigned long sectors = device->sizes.blocks << device->sizes.s2b_shift;
 	unsigned long tracks = sectors >> 6;
-	unsigned long trk_rem = sectors & ((1<<6)-1);
 	unsigned long cyls = tracks >> 4;
-	unsigned long cyls_rem = tracks & ((1<<4)-1);
 
         switch(device->sizes.bp_block) {
         case 512:
@@ -308,7 +307,7 @@
 					ccw->flags = CCW_FLAG_DC;
 				} else {
 					PRINT_WARN ("Cannot chain chunks smaller than one block\n");
-					ccw_free_request (rw_cp);
+					dasd_free_request (rw_cp);
 					return NULL;
 				}
 				ccw->cmd_code = rw_cmd;
@@ -320,7 +319,7 @@
 			ccw->flags = CCW_FLAG_CC;
 			if (size != byt_per_blk) {
 				PRINT_WARN ("Cannot fulfill request smaller than block\n");
-				ccw_free_request (rw_cp);
+				dasd_free_request (rw_cp);
 				return NULL;
 			}
 		}
@@ -354,6 +353,7 @@
 dasd_discipline_t dasd_fba_discipline = {
 	name :                          "FBA ",
 	ebcname :                       "FBA ",
+	max_blocks:			PAGE_SIZE/sizeof(ccw1_t),
         id_check:                       dasd_fba_id_check,          
         check_characteristics:          dasd_fba_check_characteristics,
         do_analysis:                    dasd_fba_do_analysis,          
@@ -371,7 +371,9 @@
 int
 dasd_fba_init( void ) {
         int rc = 0;
+#ifdef	CONFIG_DASD_DYNAMIC
 	int i;
+#endif
         printk ( KERN_INFO PRINTK_HEADER
                  "%s discipline initializing\n", dasd_fba_discipline.name);
         ASCEBC(dasd_fba_discipline.ebcname,4);
@@ -392,8 +394,9 @@
 
 void
 dasd_fba_cleanup( void ) {
-        int rc = 0;
+#ifdef	CONFIG_DASD_DYNAMIC
 	int i;
+#endif
         printk ( KERN_INFO PRINTK_HEADER
                  "%s discipline cleaning up\n", dasd_fba_discipline.name);
 #ifdef CONFIG_DASD_DYNAMIC
@@ -408,7 +411,7 @@
         }
 #endif /* CONFIG_DASD_DYNAMIC */
         dasd_discipline_deq(&dasd_fba_discipline);
-        return rc;
+        return;
 }
 /*
  * Overrides for Emacs so that we follow Linus's tabbing style.

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