* Fixed typo that prevented udf from being picked up: it's "modules", not
"module" - hope that helps, Salvatore :-) * Fixed warnings. * Fixed udf_identify_partition() not to crash the system when a UDF partition is available, and also fixed it to actually not claim non-UDF partitions. * Moved partition naming (that shouldn't be done in identify!) to udf_scan_partition(), and corrected it (ie. use strdup(), don't copy into a NULL pointer...), but also disabled it for now, as it needs some more work to pass a cookie from identify now. * Whitespace cleanup. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27048 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -39,21 +39,20 @@ extern fs_vnode_ops gUDFVnodeOps;
|
||||
|
||||
// #pragma mark - fs_volume_ops fuctions
|
||||
|
||||
|
||||
static float
|
||||
udf_identify_partition(int fd, partition_data *partition, void **_cookie)
|
||||
{
|
||||
TRACE(("udf_identify_partition: fd = %d\n", fd));
|
||||
logical_volume_descriptor logicalVolumeDescriptor;
|
||||
partition_descriptor partitionDescriptors[kMaxPartitionDescriptors];
|
||||
uint8 partitionDescriptorCount;
|
||||
uint8 descriptorCount = kMaxPartitionDescriptors;
|
||||
uint32 blockShift;
|
||||
status_t error = udf_recognize(fd, partition->offset, partition->size, 2048, blockShift,
|
||||
logicalVolumeDescriptor, partitionDescriptors, partitionDescriptorCount);
|
||||
logicalVolumeDescriptor, partitionDescriptors, descriptorCount);
|
||||
if (error != B_OK)
|
||||
return -1;
|
||||
|
||||
if (!error) {
|
||||
UdfString name(logicalVolumeDescriptor.logical_volume_identifier());
|
||||
strcpy(partition->name, name.Utf8());
|
||||
}
|
||||
return 0.8f;
|
||||
}
|
||||
|
||||
@@ -63,6 +62,10 @@ udf_scan_partition(int fd, partition_data *partition, void *_cookie)
|
||||
{
|
||||
TRACE(("udf_scan_partition: fd = %d\n", fd));
|
||||
|
||||
#if 0
|
||||
UdfString name(logicalVolumeDescriptor.logical_volume_identifier());
|
||||
partition->content_name = strdup(name.Utf8());
|
||||
#endif
|
||||
return B_ERROR;
|
||||
}
|
||||
|
||||
@@ -229,8 +232,8 @@ static status_t
|
||||
udf_read(fs_volume *volume, fs_vnode *vnode, void *cookie, off_t pos,
|
||||
void *buffer, size_t *length)
|
||||
{
|
||||
TRACE(("udf_read: ID = %d, pos = %d, length = %d\n",
|
||||
((Volume *)volume->private_volume)->ID(), pos, length));
|
||||
TRACE(("udf_read: ID = %ld, pos = %lld, length = %lu\n",
|
||||
((Volume *)volume->private_volume)->ID(), pos, *length));
|
||||
|
||||
Icb *icb = (Icb *)vnode->private_node;
|
||||
|
||||
@@ -578,7 +581,7 @@ static file_system_module_info sUDFFileSystem = {
|
||||
NULL,
|
||||
};
|
||||
|
||||
module_info *module[] = {
|
||||
module_info *modules[] = {
|
||||
(module_info *)&sUDFFileSystem,
|
||||
NULL,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user