mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* hd_geometry question.
@ 2002-07-01 16:02 Martin Schwidefsky
  2002-07-01 19:19 ` Andre Hedrick
  2002-07-01 19:58 ` Andries Brouwer
  0 siblings, 2 replies; 12+ messages in thread
From: Martin Schwidefsky @ 2002-07-01 16:02 UTC (permalink / raw)
  To: linux-kernel

Hi,
I have a question about the start field in the hd_geometry structure. We used

	geo->start = device->major_info->gendisk.part[MINOR(kdev)].start_sect
		>> device->sizes.s2b_shift;

in the old dasd driver but now we use

	geo.start = get_start_sect(kdev);

to set the start field. One variant is wrong because the start sector differ if
the block size is not 512 byte. The first variant calculates the start sector
based on physical blocks (e.g. with 4096 bytes instead of 512 bytes). The
second variant calulcates a "soft" start sector based on logical 512 byte
blocks. Whats correct, first or second variant ?? I tend to favor the first
variant because struct hd_geometry describes the physical geometry
(number of heads, sectors, cylinders and start sector) but I am not 100%
sure about it.

blue skies,
  Martin.


^ permalink raw reply	[flat|nested] 12+ messages in thread
* Re: hd_geometry question.
@ 2002-07-02  9:16 Martin Schwidefsky
  2002-07-02 10:50 ` jw schultz
  2002-07-03  0:20 ` Andries Brouwer
  0 siblings, 2 replies; 12+ messages in thread
From: Martin Schwidefsky @ 2002-07-02  9:16 UTC (permalink / raw)
  To: Andries Brouwer; +Cc: linux-kernel


>About a partition one wants to know start and length.
>About a full disk one wants to know size, and perhaps a (fake) geometry.
>
>The vital partition data cannot depend on obscure hardware info.
>So, the units used must be well-known. Earlier, everything was in
>512-byte sectors, but there are a few places where that is inconvenient
>or unnatural, and now that one has more than 2^32 sectors and 64 bits
>are needed anyway, things are measured in bytes.
>
>That the start field comes with the HDIO_GETGEO ioctl and the size with
>the BLKGETSIZE ioctl is due to history. Both are given in 512-byte sectors.
>BLKGETSIZE64 gives bytes.

Just to make sure I got that right, HDIO_GETGEO delivers a FAKE geometry
based on the assumption that the sector size is 512 bytes ?

blue skies,
   Martin



^ permalink raw reply	[flat|nested] 12+ messages in thread
* Re: hd_geometry question.
@ 2002-07-03  8:13 Martin Schwidefsky
  2002-07-03  9:37 ` Andries Brouwer
  0 siblings, 1 reply; 12+ messages in thread
From: Martin Schwidefsky @ 2002-07-03  8:13 UTC (permalink / raw)
  To: Andries Brouwer; +Cc: linux-kernel


>> Just to make sure I got that right, HDIO_GETGEO delivers a FAKE geometry
>> based on the assumption that the sector size is 512 bytes ?
>
>I am tempted to just answer "yes".
>You capitalize FAKE, as if that is an interesting and important part.
>But non-fake geometries do not exist. Let me give a somewhat more
>explicit answer.

Thanks for the long answer, it helped me to understand the situation.
Our problem is that we do have a REAL geometry for the dasd disks on
a s/390. And for the old dasd driver in the 2.4 series HDIO_GETGEO
delivers the real geometry of the disk measured in physical blocks
which is not necessarily 512 bytes. Most often it is 4096 bytes.
The problem now is that if geo.start is REQUIRED to be measured in
512 byte blocks we have to incompatibly change the HDIO_GETGEO ioctl.
Not nice.

blue skies,
   Martin

Linux/390 Design & Development, IBM Deutschland Entwicklung GmbH
Schönaicherstr. 220, D-71032 Böblingen, Telefon: 49 - (0)7031 - 16-2247
E-Mail: schwidefsky@de.ibm.com



^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2002-07-08 18:30 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-07-01 16:02 hd_geometry question Martin Schwidefsky
2002-07-01 19:19 ` Andre Hedrick
2002-07-01 19:58 ` Andries Brouwer
2002-07-02  9:16 Martin Schwidefsky
2002-07-02 10:50 ` jw schultz
2002-07-03  0:20 ` Andries Brouwer
2002-07-03 23:48   ` Roman Zippel
2002-07-04  9:09     ` Andries Brouwer
2002-07-04 22:15       ` Andre Hedrick
2002-07-08 18:55     ` Alan Cox
2002-07-03  8:13 Martin Schwidefsky
2002-07-03  9:37 ` Andries Brouwer

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®