mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: mikem <mikem@beardog.cca.cpqcorp.net>
To: akpm@osdl.org, axboe@suse.de
Cc: linux-kernel@vger.kernel.org
Subject: cciss update [4/8] cylinder calculation fix
Date: Tue, 10 Aug 2004 11:07:50 -0500	[thread overview]
Message-ID: <20040810160750.GD19909@beardog.cca.cpqcorp.net> (raw)


Patch 4 of 8

This patch fixes our cylinder calculations. Without his fix the number
of cylinders maxes out at 65535.
Aplies against 2.6.8-rc4. Please apply patches in order.

Thanks,
mikem
-------------------------------------------------------------------------------
diff -burpN lx268-rc3-p003/drivers/block/cciss.c lx268-rc3/drivers/block/cciss.c
--- lx268-rc3-p003/drivers/block/cciss.c	2004-08-05 10:40:00.865910000 -0500
+++ lx268-rc3/drivers/block/cciss.c	2004-08-05 11:16:03.222182640 -0500
@@ -1470,6 +1470,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];
@@ -1477,6 +1479,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, "

                 reply	other threads:[~2004-08-10 16:26 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20040810160750.GD19909@beardog.cca.cpqcorp.net \
    --to=mikem@beardog.cca.cpqcorp.net \
    --cc=akpm@osdl.org \
    --cc=axboe@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®