lkml.org 
[lkml]   [2000]   [Sep]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: reading 1 hardsector size, not one block size
On Sat, 30 Sep 2000, Alexander Viro wrote:

> <blinks> WTF does FS have to that? But anyway, the most trivial way is
> to have the driver set blk_size[major][minor] to sector size and do
>
> fd = open("your_device_name",O_RDONLY);
> lseek(fd, 25600, 0);
> read(fd, buf, 16384);

Thank you for that answer.

> Driver will get a sequence of requests in its queue. Requests will have
> ->rq_dev set to your device, ->sector from 50 to 81 and ->nr_sectors == 1
> (provided that they will not get merged, indeed). It's up to the driver
> to decide what to do with them. For the rest of kernel device is just a
> linear array of blocks. Where/how do you get the data for block number n
> is entirely up to the driver. You get to decide how to interpret these
> numbers - upper layers simply do not give a damn. If you treat
> req->sector==50 as "access sector with LBA==50" - that's it.

Now how do you access beyond the limits of the FS/Partition?

We are narrowing to point that appears to make zero sense, until you
realize that what is reported to Linux as capacity is less than reality.

You can only make Linux access the stuff that knows about.
Thus, assume single partition and completely used, well all that you know
about and can access because of restrictions not known to you, because
nobody told you they were there.

Recall the 30GB drive de-stroked to 15GB:

Linux can only find the first 15GB, how to you get to the other 15GB if
you can legally get there? Your method above can not do it, can it?

Cheers,

Andre Hedrick
The Linux ATA/IDE guy

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 12:39    [W:0.096 / U:1.896 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site