lkml.org 
[lkml]   [2000]   [Sep]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Subjectreading 1 hardsector size, not one block size
Date
I'm writing some code to grok the Intel EFI GUID Partition Table structures.
To to so, my partition reading code (in fs/partitions) needs to be able to
read one physical sector at a time, particularly the first and last sectors
on the disk. The bread() function ultimately calls ll_rw_block(), which
checks that my read size is the same as the block size, which is 1024 for a
SCSI disk, while the physical sector size is 512 bytes. The EFI Spec calls
for reading/writing on the physical block size.

In the case of reading the first sector, I could read 2 sectors and throw
away the bottom half.
In the case of reading the last sector, I have to read the last 2 sectors
and throw away the top half (assuming the disk has an even number of
512-byte sectors).
In the case of reading exactly one sector from the middle of the disk, it's
similar to either the first or second case.
To read say 32 sectors anywhere on the disk, I have to do 1024-byte aligned
bread()s, possibly doing an unaligned first block, aligned middle, and
unaligned last block.

Is there an easier method?

Thanks,
Matt




-
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:38    [W:0.034 / U:3.728 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site