* Fixed some coding style violation introduced in my previous commit. Thanks Axel!

The recognition code is actually working, I was just using the wrong dvd. I'm now
using an iso file created with mkisofs.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27085 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Salvatore Benedetto
2008-08-20 17:04:01 +00:00
parent feea37380d
commit e1d037ce88
@@ -44,17 +44,16 @@ udf_recognize(int device, off_t offset, off_t length, uint32 blockSize,
uint8 &partitionDescriptorCount) uint8 &partitionDescriptorCount)
{ {
TRACE(("udf_recognize: device: = %d, offset = %Ld, length = %Ld, " TRACE(("udf_recognize: device: = %d, offset = %Ld, length = %Ld, "
"blockSize = %ld, [...descriptors, etc...]\n", device, offset, "blockSize = %ld, ", device, offset, length, blockSize));
length, blockSize));
// Check the block size // Check the block size
status_t status = get_block_shift(blockSize, blockShift); status_t status = get_block_shift(blockSize, blockShift);
if (status != B_OK) { if (status != B_OK) {
TRACE_ERROR(("udf_recognize: Block size must be a positive power of " TRACE_ERROR(("\nudf_recognize: Block size must be a positive power of "
"two! (blockSize = %ld)\n", blockSize)); "two! (blockSize = %ld)\n", blockSize));
return status; return status;
} }
TRACE(("udf_recognize: blockShift: %ld\n", blockShift)); TRACE(("blockShift: %ld\n", blockShift));
// Check for a valid volume recognition sequence // Check for a valid volume recognition sequence
status = walk_volume_recognition_sequence(device, offset, blockSize, status = walk_volume_recognition_sequence(device, offset, blockSize,
@@ -92,8 +91,13 @@ udf_recognize(int device, off_t offset, off_t length, uint32 blockSize,
static static
status_t status_t
walk_volume_recognition_sequence(int device, off_t offset, uint32 blockSize, uint32 blockShift) walk_volume_recognition_sequence(int device, off_t offset, uint32 blockSize,
uint32 blockShift)
{ {
TRACE(("walk_volume_recognition_sequence: device = %d, offset = %Ld, "
"blockSize = %ld, blockShift = %d\n", device, offset, blockSize,
blockShift));
// vrs starts at block 16. Each volume structure descriptor (vsd) // vrs starts at block 16. Each volume structure descriptor (vsd)
// should be one block long. We're expecting to find 0 or more iso9660 // should be one block long. We're expecting to find 0 or more iso9660
// vsd's followed by some ECMA-167 vsd's. // vsd's followed by some ECMA-167 vsd's.
@@ -110,11 +114,11 @@ walk_volume_recognition_sequence(int device, off_t offset, uint32 blockSize, uin
bool foundECMA168 = false; bool foundECMA168 = false;
bool foundBoot = false; bool foundBoot = false;
for (uint32 block = 16; true; block++) { for (uint32 block = 16; true; block++) {
TRACE(("walk_volume_recognition_sequence: block %ld: ", block));
off_t address = (offset + block) << blockShift; off_t address = (offset + block) << blockShift;
TRACE(("walk_volume_recognition_sequence: block = %ld, "
"address = %d, ", block, address));
ssize_t bytesRead = read_pos(device, address, chunk.Data(), blockSize); ssize_t bytesRead = read_pos(device, address, chunk.Data(), blockSize);
if (bytesRead == (ssize_t)blockSize) if (bytesRead == (ssize_t)blockSize) {
{
volume_structure_descriptor_header* descriptor volume_structure_descriptor_header* descriptor
= (volume_structure_descriptor_header *)(chunk.Data()); = (volume_structure_descriptor_header *)(chunk.Data());
if (descriptor->id_matches(kVSDID_ISO)) { if (descriptor->id_matches(kVSDID_ISO)) {