cciss update [4 of 6]

From: Miller, Mike (OS Dev)
Date: Wed Aug 04 2004 - 16:26:30 EST


Patch 4 of 6
Name: p004_cyl_calc_fix_for_268rc2-2.patch

This patch fixes our cylinder calculations so they match fdisk and
other utilities.
Applies to 2.6.8-rc2. Please apply in order.

Thanks,
mikem
------------------------------------------------------------------------------
diff -burpN lx268-rc2-p003/drivers/block/cciss.c lx268-rc2-test/drivers/block/cciss.c
--- lx268-rc2-p003/drivers/block/cciss.c 2004-08-04 15:55:14.612491784 -0500
+++ lx268-rc2-test/drivers/block/cciss.c 2004-08-04 16:08:31.350369216 -0500
@@ -1472,6 +1472,8 @@ static void cciss_geometry_inquiry(int c
drv->sectors = 32; // Sectors per track
drv->cylinders = total_size / 255 / 32;
} else {
+ unsigned int t;
+
drv->block_size = block_size;
drv->nr_blocks = total_size;
drv->heads = inq_buff->data_byte[6];
@@ -1479,6 +1481,10 @@ static void cciss_geometry_inquiry(int c
drv->cylinders = (inq_buff->data_byte[4] & 0xff) << 8;
drv->cylinders += inq_buff->data_byte[5];
drv->raid_level = inq_buff->data_byte[8];
+ t = drv->heads * drv->sectors;
+ if (t > 1) {
+ drv->cylinders = total_size/t;
+ }
}
} else { /* Get geometry failed */
printk(KERN_WARNING "cciss: reading geometry failed, "
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/