9/8 Backport recent 2.6 IDE updates to 2.4.x
PATCH 1/1 9/8 Backport recent 2.6 IDE updates to 2.4.x
I was doing a bit of additional testing and I noticed that I had neglected to fixup the various ide raid drivers. This was mainly since linux/drivers/ide/raid went missing in 2.5.32 when the 2.5 IDE layer was reverted to a "late 2.4.19-pre-acX version" and has been gone ever since... Any particular reason the baby was tossed out with the proverbial bathwater?
Anyway, this patch fixes up the 2.4.x ide raid drivers so they compile up with the latest and greatest. I will leave it to others to decide if the pdcraid and silraid superblocks might be located somewhere past the capacity of an unsigned long...
-Erik
--
Erik B. Andersen http://codepoet-consulting.com/
--This message was written using 73% post-consumer electrons--
drivers/ide/raid/hptraid.c renamed from drivers/ide/raid/hptraid.c.orig +1 -1
@@ -594,7 +594,7 @@return 0 ;if (ideinfo->sect==0 )return 0 ; - lba = (ideinfo->capacity); + lba = (ideinfo->capacity64);return lba; }
drivers/ide/raid/pdcraid.c renamed from drivers/ide/raid/pdcraid.c.orig +6 -3
@@ -28,6 +28,7 @@#include <linux/ide.h> #include <asm/uaccess.h> +#include <asm/div64.h> #include "ataraid.h"
@@ -345,7 +346,7 @@static unsigned long calc_pdcblock_offset (int major,int minor) { -unsigned long lba =0 ; +u64 lba =0 ;kdev_t dev;ide_drive_t *ideinfo;
@@ -360,11 +361,13 @@return 0 ;if (ideinfo->sect==0 )return 0 ; - lba = (ideinfo->capacity / (ideinfo->head*ideinfo->sect)); + lba = ideinfo->capacity64; +do_div (lba, ideinfo->head*ideinfo->sect);/* macro warning, cannot combine steps */ lba = lba * (ideinfo->head*ideinfo->sect); lba = lba - ideinfo->sect; -return lba; +/* I guess pdc raids do not get especially large... */ +return (unsigned long )lba; }
drivers/ide/raid/silraid.c renamed from drivers/ide/raid/silraid.c.orig +7 -4
@@ -34,6 +34,7 @@#include <linux/ide.h> #include <asm/uaccess.h> +#include <asm/div64.h> #include "ataraid.h"
@@ -248,7 +249,7 @@static unsigned long calc_silblock_offset (int major,int minor) { -unsigned long lba =0 , cylinders; +u64 lba =0 , cylinders;kdev_t dev;ide_drive_t *ideinfo;
@@ -263,13 +264,15 @@return 0 ;if (ideinfo->sect==0 )return 0 ; - cylinders = (ideinfo->capacity / (ideinfo->head*ideinfo->sect)); + cylinders = ideinfo->capacity64; +do_div (cylinders, ideinfo->head*ideinfo->sect);/* macro warning, cannot combine steps */ lba = (cylinders -1 ) * (ideinfo->head*ideinfo->sect); lba = lba - ideinfo->head -1 ;// return 80417215; -printk ("Guestimating sector %li for superblock\n" ,lba); -return lba; +printk ("Guestimating sector %llu for superblock\n" ,lba); +/* I guess sil raids do not get especially large... */ +return (unsigned long )lba; }
Quoted 3 lines · Erik Andersen
IDE layer was reverted to a "late 2.4.19-pre-acX version" and has been gone ever since... Any particular reason the baby was tossed out with the proverbial bathwater?
In theory the device mapper can do the work ide-raid is doing and do it better. That was the plan anyway
Quoted 4 lines
Anyway, this patch fixes up the 2.4.x ide raid drivers so they compile up with the latest and greatest. I will leave it to others to decide if the pdcraid and silraid superblocks might be located somewhere past the capacity of an unsigned long...
The 2.4 block layer has a 32bit block limit so if it does they'll have to use 2.6 anyway. Looks fine