Various changes to get this mostly compiling, with the exception of a template issue I don't yet completely understand.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33213 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -146,7 +146,7 @@ AllocationDescriptorList<Accessor>::FindExtent(off_t start,
|
|||||||
|
|
||||||
|
|
||||||
template<class Accessor>
|
template<class Accessor>
|
||||||
AllocationDescriptorList<Accessor>::Descriptor*
|
AllocationDescriptorList<class Accessor>::Descriptor*
|
||||||
AllocationDescriptorList<Accessor>::_CurrentDescriptor() const
|
AllocationDescriptorList<Accessor>::_CurrentDescriptor() const
|
||||||
{
|
{
|
||||||
TRACE(("AllocationDescriptorList<>::_CurrentDescriptor:\n"
|
TRACE(("AllocationDescriptorList<>::_CurrentDescriptor:\n"
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ DirectoryIterator::GetNextEntry(char *name, uint32 *length, ino_t *id)
|
|||||||
} else {
|
} else {
|
||||||
UdfString string(entry->id(), entry->id_length());
|
UdfString string(entry->id(), entry->id_length());
|
||||||
TRACE(("DirectoryIterator::GetNextEntry: UfdString id == `%s', "
|
TRACE(("DirectoryIterator::GetNextEntry: UfdString id == `%s', "
|
||||||
"length = %d\n", string.Utf8(), string.Utf8Length()));
|
"length = %lu\n", string.Utf8(), string.Utf8Length()));
|
||||||
DUMP(entry->icb());
|
DUMP(entry->icb());
|
||||||
sprintf(name, "%s", string.Utf8());
|
sprintf(name, "%s", string.Utf8());
|
||||||
*length = string.Utf8Length();
|
*length = string.Utf8Length();
|
||||||
|
|||||||
@@ -114,7 +114,8 @@ public:
|
|||||||
private:
|
private:
|
||||||
AbstractFileEntry *_AbstractEntry() { return (_Tag().id()
|
AbstractFileEntry *_AbstractEntry() { return (_Tag().id()
|
||||||
== TAGID_EXTENDED_FILE_ENTRY)
|
== TAGID_EXTENDED_FILE_ENTRY)
|
||||||
? &fExtendedEntry : &fFileEntry; }
|
? (AbstractFileEntry *)&fExtendedEntry
|
||||||
|
: (AbstractFileEntry *)&fFileEntry; }
|
||||||
|
|
||||||
descriptor_tag &_Tag() { return ((icb_header *)fData.Block())->tag(); }
|
descriptor_tag &_Tag() { return ((icb_header *)fData.Block())->tag(); }
|
||||||
icb_entry_tag &_IcbTag() { return ((icb_header *)fData.Block())->icb_tag(); }
|
icb_entry_tag &_IcbTag() { return ((icb_header *)fData.Block())->icb_tag(); }
|
||||||
|
|||||||
@@ -11,8 +11,8 @@ PhysicalPartition::PhysicalPartition(uint16 number, uint32 start, uint32 length)
|
|||||||
fStart(start),
|
fStart(start),
|
||||||
fLength(length)
|
fLength(length)
|
||||||
{
|
{
|
||||||
TRACE(("PhysicalPartition::PhysicalPartition: number = %d, start = %d,
|
TRACE(("PhysicalPartition::PhysicalPartition: number = %d, start = %lu,"
|
||||||
length = %d\n", number, start, length));
|
"length = %lu\n", number, start, length));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -33,8 +33,8 @@ PhysicalPartition::MapBlock(uint32 logicalBlock, off_t &physicalBlock)
|
|||||||
{
|
{
|
||||||
TRACE(("PhysicalPartition::MapBlock: %ld\n", logicalBlock));
|
TRACE(("PhysicalPartition::MapBlock: %ld\n", logicalBlock));
|
||||||
if (logicalBlock >= fLength) {
|
if (logicalBlock >= fLength) {
|
||||||
TRACE_ERROR(("PhysicalPartition::MapBlock: block %ld invalid,
|
TRACE_ERROR(("PhysicalPartition::MapBlock: block %ld invalid,"
|
||||||
length = %ld\n", logicalBlock, fLength));
|
"length = %ld\n", logicalBlock, fLength));
|
||||||
return B_BAD_ADDRESS;
|
return B_BAD_ADDRESS;
|
||||||
} else {
|
} else {
|
||||||
physicalBlock = fStart + logicalBlock;
|
physicalBlock = fStart + logicalBlock;
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ udf_recognize(int device, off_t offset, off_t length, uint32 blockSize,
|
|||||||
status = walk_volume_recognition_sequence(device, offset, blockSize,
|
status = walk_volume_recognition_sequence(device, offset, blockSize,
|
||||||
blockShift);
|
blockShift);
|
||||||
if (status != B_OK) {
|
if (status != B_OK) {
|
||||||
TRACE_ERROR(("udf_recognize: Invalid sequence. status = %d\n", status));
|
TRACE_ERROR(("udf_recognize: Invalid sequence. status = %ld\n", status));
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
// Now hunt down a volume descriptor sequence from one of
|
// Now hunt down a volume descriptor sequence from one of
|
||||||
@@ -69,7 +69,7 @@ udf_recognize(int device, off_t offset, off_t length, uint32 blockSize,
|
|||||||
blockSize, blockShift, logicalVolumeDescriptor, partitionDescriptors,
|
blockSize, blockShift, logicalVolumeDescriptor, partitionDescriptors,
|
||||||
partitionDescriptorCount);
|
partitionDescriptorCount);
|
||||||
if (status != B_OK) {
|
if (status != B_OK) {
|
||||||
TRACE_ERROR(("udf_recognize: cannot find volume descriptor. status = %d\n",
|
TRACE_ERROR(("udf_recognize: cannot find volume descriptor. status = %ld\n",
|
||||||
status));
|
status));
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
@@ -79,7 +79,7 @@ udf_recognize(int device, off_t offset, off_t length, uint32 blockSize,
|
|||||||
logicalVolumeDescriptor.integrity_sequence_extent());
|
logicalVolumeDescriptor.integrity_sequence_extent());
|
||||||
if (status != B_OK) {
|
if (status != B_OK) {
|
||||||
TRACE_ERROR(("udf_recognize: last integrity descriptor not closed. "
|
TRACE_ERROR(("udf_recognize: last integrity descriptor not closed. "
|
||||||
"status = %d\n", status));
|
"status = %ld\n", status));
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -96,7 +96,7 @@ walk_volume_recognition_sequence(int device, off_t offset, uint32 blockSize,
|
|||||||
uint32 blockShift)
|
uint32 blockShift)
|
||||||
{
|
{
|
||||||
TRACE(("walk_volume_recognition_sequence: device = %d, offset = %Ld, "
|
TRACE(("walk_volume_recognition_sequence: device = %d, offset = %Ld, "
|
||||||
"blockSize = %ld, blockShift = %d\n", device, offset, blockSize,
|
"blockSize = %ld, blockShift = %lu\n", device, offset, blockSize,
|
||||||
blockShift));
|
blockShift));
|
||||||
|
|
||||||
// vrs starts at block 16. Each volume structure descriptor (vsd)
|
// vrs starts at block 16. Each volume structure descriptor (vsd)
|
||||||
@@ -117,7 +117,7 @@ walk_volume_recognition_sequence(int device, off_t offset, uint32 blockSize,
|
|||||||
for (uint32 block = 16; true; block++) {
|
for (uint32 block = 16; true; block++) {
|
||||||
off_t address = (offset + block) << blockShift;
|
off_t address = (offset + block) << blockShift;
|
||||||
TRACE(("walk_volume_recognition_sequence: block = %ld, "
|
TRACE(("walk_volume_recognition_sequence: block = %ld, "
|
||||||
"address = %d, ", block, address));
|
"address = %Ld, ", 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
|
||||||
|
|||||||
@@ -19,8 +19,8 @@ SparablePartition::SparablePartition(uint16 number, uint32 start, uint32 length,
|
|||||||
fTableCount(tableCount),
|
fTableCount(tableCount),
|
||||||
fInitStatus(B_NO_INIT)
|
fInitStatus(B_NO_INIT)
|
||||||
{
|
{
|
||||||
TRACE(("SparablePartition::SparablePartition: number = %d, start = %d,
|
TRACE(("SparablePartition::SparablePartition: number = %d, start = %lu,"
|
||||||
length = %d, packetLength = %d\n", number, start, length, packetLength));
|
"length = %lu, packetLength = %d\n", number, start, length, packetLength));
|
||||||
|
|
||||||
status_t status = (0 < TableCount() && TableCount() <= kMaxSparingTableCount)
|
status_t status = (0 < TableCount() && TableCount() <= kMaxSparingTableCount)
|
||||||
? B_OK : B_BAD_VALUE;
|
? B_OK : B_BAD_VALUE;
|
||||||
|
|||||||
@@ -226,7 +226,6 @@ private:
|
|||||||
#define RETURN(status) return status;
|
#define RETURN(status) return status;
|
||||||
#define FATAL(x) { __out("udf: fatal error: "); __out x; }
|
#define FATAL(x) { __out("udf: fatal error: "); __out x; }
|
||||||
#define DBG(x) ;
|
#define DBG(x) ;
|
||||||
#define DUMP(x) ;
|
|
||||||
#endif // ifdef DEBUG else
|
#endif // ifdef DEBUG else
|
||||||
|
|
||||||
#define TRACE(x) dprintf x
|
#define TRACE(x) dprintf x
|
||||||
|
|||||||
@@ -359,7 +359,7 @@ domain_id_suffix::domain_id_suffix(uint16 udfRevision, uint8 domainFlags)
|
|||||||
// entity_id
|
// entity_id
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
|
||||||
entity_id::entity_id(uint8 flags, char *identifier, uint8 *identifier_suffix)
|
entity_id::entity_id(uint8 flags, const char *identifier, uint8 *identifier_suffix)
|
||||||
: _flags(flags)
|
: _flags(flags)
|
||||||
{
|
{
|
||||||
memset(_identifier, 0, kIdentifierLength);
|
memset(_identifier, 0, kIdentifierLength);
|
||||||
@@ -371,7 +371,7 @@ entity_id::entity_id(uint8 flags, char *identifier, uint8 *identifier_suffix)
|
|||||||
memset(_identifier_suffix.data, 0, kIdentifierSuffixLength);
|
memset(_identifier_suffix.data, 0, kIdentifierSuffixLength);
|
||||||
}
|
}
|
||||||
|
|
||||||
entity_id::entity_id(uint8 flags, char *identifier,
|
entity_id::entity_id(uint8 flags, const char *identifier,
|
||||||
const udf_id_suffix &suffix)
|
const udf_id_suffix &suffix)
|
||||||
: _flags(flags)
|
: _flags(flags)
|
||||||
{
|
{
|
||||||
@@ -381,7 +381,7 @@ entity_id::entity_id(uint8 flags, char *identifier,
|
|||||||
memcpy(_identifier_suffix.data, &suffix, kIdentifierSuffixLength);
|
memcpy(_identifier_suffix.data, &suffix, kIdentifierSuffixLength);
|
||||||
}
|
}
|
||||||
|
|
||||||
entity_id::entity_id(uint8 flags, char *identifier,
|
entity_id::entity_id(uint8 flags, const char *identifier,
|
||||||
const implementation_id_suffix &suffix)
|
const implementation_id_suffix &suffix)
|
||||||
: _flags(flags)
|
: _flags(flags)
|
||||||
{
|
{
|
||||||
@@ -391,7 +391,7 @@ entity_id::entity_id(uint8 flags, char *identifier,
|
|||||||
memcpy(_identifier_suffix.data, &suffix, kIdentifierSuffixLength);
|
memcpy(_identifier_suffix.data, &suffix, kIdentifierSuffixLength);
|
||||||
}
|
}
|
||||||
|
|
||||||
entity_id::entity_id(uint8 flags, char *identifier,
|
entity_id::entity_id(uint8 flags, const char *identifier,
|
||||||
const domain_id_suffix &suffix)
|
const domain_id_suffix &suffix)
|
||||||
: _flags(flags)
|
: _flags(flags)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
#include <SupportDefs.h>
|
#include <SupportDefs.h>
|
||||||
|
|
||||||
#include "UdfDebug.h"
|
#include "UdfDebug.h"
|
||||||
|
#include "Utils.h"
|
||||||
|
|
||||||
#include "Array.h"
|
#include "Array.h"
|
||||||
|
|
||||||
@@ -265,13 +266,13 @@ public:
|
|||||||
static const int kIdentifierLength = 23;
|
static const int kIdentifierLength = 23;
|
||||||
static const int kIdentifierSuffixLength = 8;
|
static const int kIdentifierSuffixLength = 8;
|
||||||
|
|
||||||
entity_id(uint8 flags = 0, char *identifier = NULL,
|
entity_id(uint8 flags = 0, const char *identifier = NULL,
|
||||||
uint8 *identifier_suffix = NULL);
|
uint8 *identifier_suffix = NULL);
|
||||||
entity_id(uint8 flags, char *identifier,
|
entity_id(uint8 flags, const char *identifier,
|
||||||
const udf_id_suffix &suffix);
|
const udf_id_suffix &suffix);
|
||||||
entity_id(uint8 flags, char *identifier,
|
entity_id(uint8 flags, const char *identifier,
|
||||||
const implementation_id_suffix &suffix);
|
const implementation_id_suffix &suffix);
|
||||||
entity_id(uint8 flags, char *identifier,
|
entity_id(uint8 flags, const char *identifier,
|
||||||
const domain_id_suffix &suffix);
|
const domain_id_suffix &suffix);
|
||||||
|
|
||||||
void dump() const;
|
void dump() const;
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
/*! \file Utils.cpp - Miscellaneous Udf utility functions. */
|
/*! \file Utils.cpp - Miscellaneous Udf utility functions. */
|
||||||
|
|
||||||
|
#include "UdfStructures.h"
|
||||||
#include "Utils.h"
|
#include "Utils.h"
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
|||||||
@@ -5,9 +5,12 @@
|
|||||||
#ifndef _UDF_UTILS_H
|
#ifndef _UDF_UTILS_H
|
||||||
#define _UDF_UTILS_H
|
#define _UDF_UTILS_H
|
||||||
|
|
||||||
|
#include <SupportDefs.h>
|
||||||
|
|
||||||
/*! \file Utils.h - Miscellaneous Udf utility functions. */
|
/*! \file Utils.h - Miscellaneous Udf utility functions. */
|
||||||
|
|
||||||
#include "UdfStructures.h"
|
class timestamp;
|
||||||
|
struct long_address;
|
||||||
|
|
||||||
const char *bool_to_string(bool value);
|
const char *bool_to_string(bool value);
|
||||||
uint16 calculate_crc(uint8 *data, uint16 length);
|
uint16 calculate_crc(uint8 *data, uint16 length);
|
||||||
|
|||||||
@@ -203,8 +203,8 @@ Volume::Mount(const char *deviceName, off_t offset, off_t length,
|
|||||||
fBlockSize = blockSize;
|
fBlockSize = blockSize;
|
||||||
fBlockShift = blockShift;
|
fBlockShift = blockShift;
|
||||||
}
|
}
|
||||||
TRACE(("Volume::Mount: device = %d, offset = %d, length = %ld, "
|
TRACE(("Volume::Mount: device = %d, offset = %Ld, length = %Ld, "
|
||||||
"blockSize = %d, blockShift = %d\n", device, offset, length,
|
"blockSize = %ld, blockShift = %ld\n", device, offset, length,
|
||||||
blockSize, blockShift));
|
blockSize, blockShift));
|
||||||
// At this point we've found a valid set of volume descriptors and
|
// At this point we've found a valid set of volume descriptors and
|
||||||
// our partitions are all set up. We now need to investigate the file
|
// our partitions are all set up. We now need to investigate the file
|
||||||
@@ -248,7 +248,7 @@ Volume::Mount(const char *deviceName, off_t offset, off_t length,
|
|||||||
return B_NO_MEMORY;
|
return B_NO_MEMORY;
|
||||||
}
|
}
|
||||||
|
|
||||||
TRACE(("Volume::Mount: Root Node id = %d\n", fRootIcb->Id()));
|
TRACE(("Volume::Mount: Root Node id = %Ld\n", fRootIcb->Id()));
|
||||||
if (!status) {
|
if (!status) {
|
||||||
status = publish_vnode(fFSVolume, fRootIcb->Id(), fRootIcb,
|
status = publish_vnode(fFSVolume, fRootIcb->Id(), fRootIcb,
|
||||||
&gUDFVnodeOps, fRootIcb->Mode(), 0);
|
&gUDFVnodeOps, fRootIcb->Mode(), 0);
|
||||||
@@ -261,7 +261,7 @@ Volume::Mount(const char *deviceName, off_t offset, off_t length,
|
|||||||
delete fRootIcb;
|
delete fRootIcb;
|
||||||
fRootIcb = NULL;
|
fRootIcb = NULL;
|
||||||
}
|
}
|
||||||
TRACE(("Volume::Mount: Root vnode published. Id = %d\n",
|
TRACE(("Volume::Mount: Root vnode published. Id = %Ld\n",
|
||||||
fRootIcb->Id()));
|
fRootIcb->Id()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,8 +43,8 @@ extern fs_vnode_ops gUDFVnodeOps;
|
|||||||
static float
|
static float
|
||||||
udf_identify_partition(int fd, partition_data *partition, void **_cookie)
|
udf_identify_partition(int fd, partition_data *partition, void **_cookie)
|
||||||
{
|
{
|
||||||
TRACE(("udf_identify_partition: fd = %d, id = %d, offset = %d, size = %d "
|
TRACE(("udf_identify_partition: fd = %d, id = %ld, offset = %Ld, size = %Ld "
|
||||||
"content_size = %d, block_size = %d\n", fd, partition->id,
|
"content_size = %Ld, block_size = %lu\n", fd, partition->id,
|
||||||
partition->offset, partition->size, partition->content_size,
|
partition->offset, partition->size, partition->content_size,
|
||||||
partition->block_size));
|
partition->block_size));
|
||||||
|
|
||||||
@@ -123,7 +123,7 @@ udf_get_vnode(fs_volume *_volume, ino_t id, fs_vnode *_node, int *_type,
|
|||||||
|
|
||||||
// Convert the given vnode id to an address, and create
|
// Convert the given vnode id to an address, and create
|
||||||
// and return a corresponding Icb object for it.
|
// and return a corresponding Icb object for it.
|
||||||
TRACE(("udf_get_vnode: id = %d, blockSize = %d\n", id, volume->BlockSize()));
|
TRACE(("udf_get_vnode: id = %Ld, blockSize = %lu\n", id, volume->BlockSize()));
|
||||||
Icb *icb = new(std::nothrow) Icb(volume,
|
Icb *icb = new(std::nothrow) Icb(volume,
|
||||||
to_long_address(id, volume->BlockSize()));
|
to_long_address(id, volume->BlockSize()));
|
||||||
if (icb) {
|
if (icb) {
|
||||||
@@ -224,7 +224,7 @@ udf_read_stat(fs_volume *_volume, fs_vnode *node, struct stat *stat)
|
|||||||
stat->st_nlink = icb->FileLinkCount();
|
stat->st_nlink = icb->FileLinkCount();
|
||||||
stat->st_blksize = volume->BlockSize();
|
stat->st_blksize = volume->BlockSize();
|
||||||
|
|
||||||
TRACE(("udf_read_stat: st_dev = %d, st_ino = %d, st_blksize = %d\n",
|
TRACE(("udf_read_stat: st_dev = %ld, st_ino = %Ld, st_blksize = %d\n",
|
||||||
stat->st_dev, stat->st_ino, stat->st_blksize));
|
stat->st_dev, stat->st_ino, stat->st_blksize));
|
||||||
|
|
||||||
stat->st_uid = icb->Uid();
|
stat->st_uid = icb->Uid();
|
||||||
@@ -240,7 +240,7 @@ udf_read_stat(fs_volume *_volume, fs_vnode *node, struct stat *stat)
|
|||||||
stat->st_atime = icb->AccessTime();
|
stat->st_atime = icb->AccessTime();
|
||||||
stat->st_mtime = stat->st_ctime = stat->st_crtime = icb->ModificationTime();
|
stat->st_mtime = stat->st_ctime = stat->st_crtime = icb->ModificationTime();
|
||||||
|
|
||||||
TRACE(("udf_read_stat: mode = 0x%lx, st_ino: %Ld\n", stat->st_mode,
|
TRACE(("udf_read_stat: mode = 0x%x, st_ino: %Ld\n", stat->st_mode,
|
||||||
stat->st_ino));
|
stat->st_ino));
|
||||||
|
|
||||||
return B_OK;
|
return B_OK;
|
||||||
|
|||||||
Reference in New Issue
Block a user