Messages in this thread |  | | From | Matt_Domsch@Dell ... | Subject | reading 1 hardsector size, not one block size | Date | Thu, 28 Sep 2000 18:40:18 -0500 |
| |
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/
|  |