PATCH: Alternate pdcraid superblock finder

From: Walt H
Date: Sun Dec 28 2003 - 12:13:16 EST


Hi,

This patch proposes an alternate method of finding the raid superblock on
Promise raid devices. It hasn't received much testing, so I left the old routine
intact and just check for ideinfo->head == 255 to use my method. I'm not aware
of any reasons why my method wouldn't work for all drives, but I thought this
was a safer change.

-Walt Holman

--- /usr/src/temp/linux-2.4.21-xfs/linux/drivers/ide/raid/pdcraid.c 2003-12-22 17:59:09.653139067 -0800
+++ linux/drivers/ide/raid/pdcraid.c 2003-07-21 20:47:14.000000000 -0700
@@ -361,7 +361,11 @@
if (ideinfo->sect==0)
return 0;
- lba = (ideinfo->capacity / (ideinfo->head*ideinfo->sect));
- lba = lba * (ideinfo->head*ideinfo->sect);
- lba = lba - ideinfo->sect;
+ if (ideinfo->head!=255) {
+ lba = (ideinfo->capacity / (ideinfo->head*ideinfo->sect));
+ lba = lba * (ideinfo->head*ideinfo->sect);
+ lba = lba - ideinfo->sect; }
+ else {
+ lba = ideinfo->capacity - ideinfo->sect;
+ }

return lba;