From: David Woodhouse <dwmw2@infradead.org>
To: linux-kernel@vger.rutgers.edu
Cc: mtd@infradead.org
Subject: HDIO_GETGEO vs. BLKGETSIZE
Date: Mon, 22 May 2000 13:06:17 +0100 [thread overview]
Message-ID: <29342.958997177@devel2.axiom.internal> (raw)
Is it permitted for a driver to returns CHS values for HDIO_GETGEO which,
when multiplied together, don't match the value returned by BLKGETSIZE?
i.e. Is the code in the second 'if' statement below actually necessary?
thisNFTL->cylinders = 1024;
thisNFTL->heads = 16;
temp = thisNFTL->cylinders * thisNFTL->heads;
thisNFTL->sectors = thisNFTL->nr_sects / temp;
if (thisNFTL->nr_sects % temp) {
thisNFTL->sectors++;
temp = thisNFTL->cylinders * thisNFTL->sectors;
thisNFTL->heads = thisNFTL->nr_sects / temp;
if (thisNFTL->nr_sects & temp) {
thisNFTL->heads++;
temp = thisNFTL->heads * thisNFTL->sectors;
thisNFTL->cylinders = thisNFTL->nr_sects / temp;
}
}
/* Do we really need to do this.... ? */
if (thisNFTL->nr_sects != thisNFTL->heads * thisNFTL->cylinders *
thisNFTL->sectors) {
printk("NFTL capacity reduced for geometry reasons from %lx to %x sectors\n", thisNFTL->nr_sects,
thisNFTL->heads * thisNFTL->cylinders * thisNFTL->sectors);
thisNFTL->nr_sects = thisNFTL->heads * thisNFTL->cylinders * thisNFTL->sectors;
}
--
dwmw2
To unsubscribe, send "unsubscribe mtd" to majordomo@infradead.org
next reply other threads:[~2000-05-22 12:06 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-05-22 12:06 David Woodhouse [this message]
2000-05-22 14:17 ` HDIO_GETGEO vs. BLKGETSIZE Andries Brouwer
2000-05-22 14:21 ` David Woodhouse
2000-05-22 14:30 ` Andries Brouwer
2000-05-22 15:47 ` David Woodhouse
2000-05-22 16:05 ` Andries Brouwer
2000-05-22 23:14 ` Andre Hedrick
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=29342.958997177@devel2.axiom.internal \
--to=dwmw2@infradead.org \
--cc=linux-kernel@vger.rutgers.edu \
--cc=mtd@infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.