From: Erik Andersen <andersen@codepoet.org>
To: Marcelo Tosatti <marcelo@conectiva.com.br>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>,
Andries Brouwer <aebr@win.tue.nl>,
Bartlomiej Zolnierkiewicz <B.Zolnierkiewicz@elka.pw.edu.pl>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: [PATCH] 9/8 Backport recent 2.6 IDE updates to 2.4.x
Date: Sun, 17 Aug 2003 13:17:02 -0600 [thread overview]
Message-ID: <20030817191701.GA23859@codepoet.org> (raw)
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--
--- linux/drivers/ide/raid/hptraid.c.orig 2003-08-17 12:45:01.000000000 -0600
+++ linux/drivers/ide/raid/hptraid.c 2003-08-17 12:45:17.000000000 -0600
@@ -594,7 +594,7 @@
return 0;
if (ideinfo->sect==0)
return 0;
- lba = (ideinfo->capacity);
+ lba = (ideinfo->capacity64);
return lba;
}
--- linux/drivers/ide/raid/pdcraid.c.orig 2003-08-17 11:04:31.000000000 -0600
+++ linux/drivers/ide/raid/pdcraid.c 2003-08-17 13:04:50.000000000 -0600
@@ -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;
}
--- linux/drivers/ide/raid/silraid.c.orig 2003-08-17 12:45:31.000000000 -0600
+++ linux/drivers/ide/raid/silraid.c 2003-08-17 13:09:12.000000000 -0600
@@ -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;
}
next reply other threads:[~2003-08-17 19:17 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-08-17 19:17 Erik Andersen [this message]
2003-08-17 19:20 ` [PATCH] 9/8 Backport recent 2.6 IDE updates to 2.4.x Alan Cox
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20030817191701.GA23859@codepoet.org \
--to=andersen@codepoet.org \
--cc=B.Zolnierkiewicz@elka.pw.edu.pl \
--cc=aebr@win.tue.nl \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=marcelo@conectiva.com.br \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox