- Updated short version of udf_recognize() to return volume name in
output parameter. - Forgot to pass out the number of partitions found in udf_walk_vds(). git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5242 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
#include "Recognition.h"
|
#include "Recognition.h"
|
||||||
|
|
||||||
|
#include "CS0String.h"
|
||||||
#include "MemoryChunk.h"
|
#include "MemoryChunk.h"
|
||||||
|
|
||||||
using namespace Udf;
|
using namespace Udf;
|
||||||
@@ -35,7 +36,9 @@ Udf::udf_recognize(int device, off_t offset, off_t length, uint32 blockSize,
|
|||||||
udf_partition_descriptor partitionDescriptors[],
|
udf_partition_descriptor partitionDescriptors[],
|
||||||
uint8 &partitionDescriptorCount)
|
uint8 &partitionDescriptorCount)
|
||||||
{
|
{
|
||||||
DEBUG_INIT(CF_PRIVATE, NULL);
|
DEBUG_INIT_ETC(CF_PRIVATE, NULL, ("device: %d, offset: %Ld, length: %Ld, "
|
||||||
|
"blockSize: %ld, [...descriptors, etc...]", device, offset,
|
||||||
|
length, blockSize));
|
||||||
|
|
||||||
// Check the block size
|
// Check the block size
|
||||||
uint32 bitCount = 0;
|
uint32 bitCount = 0;
|
||||||
@@ -70,14 +73,23 @@ Udf::udf_recognize(int device, off_t offset, off_t length, uint32 blockSize,
|
|||||||
|
|
||||||
status_t
|
status_t
|
||||||
Udf::udf_recognize(int device, off_t offset, off_t length, uint32 blockSize,
|
Udf::udf_recognize(int device, off_t offset, off_t length, uint32 blockSize,
|
||||||
uint32 &blockShift)
|
char *volumeName)
|
||||||
{
|
{
|
||||||
|
DEBUG_INIT_ETC(CF_PRIVATE, NULL, ("device: %d, offset: %Ld, length: %Ld, "
|
||||||
|
"blockSize: %ld, volumeName: %p", device, offset, length,
|
||||||
|
blockSize, volumeName));
|
||||||
udf_logical_descriptor logicalVolumeDescriptor;
|
udf_logical_descriptor logicalVolumeDescriptor;
|
||||||
udf_partition_descriptor partitionDescriptors[Udf::kMaxPartitionDescriptors];
|
udf_partition_descriptor partitionDescriptors[Udf::kMaxPartitionDescriptors];
|
||||||
uint8 partitionDescriptorCount;
|
uint8 partitionDescriptorCount;
|
||||||
return udf_recognize(device, offset, length, blockSize, blockShift,
|
uint32 blockShift;
|
||||||
logicalVolumeDescriptor, partitionDescriptors,
|
status_t error = udf_recognize(device, offset, length, blockSize, blockShift,
|
||||||
partitionDescriptorCount);
|
logicalVolumeDescriptor, partitionDescriptors,
|
||||||
|
partitionDescriptorCount);
|
||||||
|
if (!error && volumeName) {
|
||||||
|
CS0String name(logicalVolumeDescriptor.logical_volume_identifier());
|
||||||
|
strcpy(volumeName, name.String());
|
||||||
|
}
|
||||||
|
RETURN(error);
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
@@ -399,9 +411,17 @@ walk_volume_descriptor_sequence(udf_extent_address descriptorSequence,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PRINT(("found %d unique partition%s\n", uniquePartitions,
|
||||||
|
(uniquePartitions == 1 ? "" : "s")));
|
||||||
|
|
||||||
if (!err)
|
if (!err)
|
||||||
err = foundLogicalVolumeDescriptor ? B_OK : B_ERROR;
|
err = foundLogicalVolumeDescriptor ? B_OK : B_ERROR;
|
||||||
|
if (!err)
|
||||||
|
err = uniquePartitions >= 1 ? B_OK : B_ERROR;
|
||||||
|
if (!err)
|
||||||
|
partitionDescriptorCount = uniquePartitions;
|
||||||
|
|
||||||
RETURN(err);
|
RETURN(err);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ status_t udf_recognize(int device, off_t offset, off_t length,
|
|||||||
udf_partition_descriptor partitionDescriptors[],
|
udf_partition_descriptor partitionDescriptors[],
|
||||||
uint8 &partitionDescriptorCount);
|
uint8 &partitionDescriptorCount);
|
||||||
status_t udf_recognize(int device, off_t offset, off_t length,
|
status_t udf_recognize(int device, off_t offset, off_t length,
|
||||||
uint32 blockSize, uint32 &blockShift);
|
uint32 blockSize, char *volumeName);
|
||||||
|
|
||||||
} // namespace Udf
|
} // namespace Udf
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user