reading 1 hardsector size, not one block size

From: Matt_Domsch@Dell.com
Date: Thu Sep 28 2000 - 18:40:18 EST


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/



This archive was generated by hypermail 2b29 : Sat Sep 30 2000 - 21:00:23 EST