64-bit compilation fixes for write_overlay and intel partitioning system modules.

This commit is contained in:
Alex Smith
2012-07-20 17:53:59 +01:00
parent 0063d2ba51
commit 7f7e76e461
4 changed files with 55 additions and 45 deletions
@@ -265,7 +265,7 @@ OverlayInode::OverlayInode(OverlayVolume *volume, fs_vnode *superVnode,
fIsDataModified(false),
fFileCache(NULL)
{
TRACE("inode created %lld\n", fInodeNumber);
TRACE("inode created %" B_PRIdINO "\n", fInodeNumber);
recursive_lock_init(&fLock, "write overlay inode lock");
if (superVnode != NULL)
@@ -290,7 +290,7 @@ OverlayInode::OverlayInode(OverlayVolume *volume, fs_vnode *superVnode,
OverlayInode::~OverlayInode()
{
TRACE("inode destroyed %lld\n", fInodeNumber);
TRACE("inode destroyed %" B_PRIdINO "\n", fInodeNumber);
if (fFileCache != NULL)
file_cache_delete(fFileCache);
@@ -73,29 +73,30 @@ check_logical_location(const LogicalPartition* child,
const PrimaryPartition* parent)
{
if (child->PartitionTableOffset() % child->BlockSize() != 0) {
TRACE(("check_logical_location() - PartitionTableOffset: %lld not a "
"multiple of media's block size: %ld\n",
TRACE(("check_logical_location() - PartitionTableOffset: %" B_PRId64 " "
"not a multiple of media's block size: %" B_PRId32 "\n",
child->PartitionTableOffset(), child->BlockSize()));
return false;
}
if (child->Offset() % child->BlockSize() != 0) {
TRACE(("check_logical_location() - Parition offset: %lld "
"is not a multiple of block size: %ld\n", child->Offset(),
TRACE(("check_logical_location() - Parition offset: %" B_PRId64 " "
"is not a multiple of block size: %" B_PRId32 "\n", child->Offset(),
child->BlockSize()));
return false;
}
if (child->Size() % child->BlockSize() != 0) {
TRACE(("check_logical_location() - Size: (%lld) is not a multiple of"
" block size: (%ld)\n", child->Size(), child->BlockSize()));
TRACE(("check_logical_location() - Size: (%" B_PRId64 ") is not a "
"multiple of block size: (%" B_PRId32 ")\n", child->Size(),
child->BlockSize()));
return false;
}
if (child->PartitionTableOffset() < parent->Offset()
|| child->PartitionTableOffset() >= parent->Offset()
+ parent->Size()) {
TRACE(("check_logical_location() - Partition table: (%lld) not within "
"extended partition (start: %lld), (end: %lld)\n",
child->PartitionTableOffset(), parent->Offset(), parent->Offset()
+ parent->Size()));
TRACE(("check_logical_location() - Partition table: (%" B_PRId64 ") not"
" within extended partition (start: %" B_PRId64 "), (end: "
"%" B_PRId64 ")\n", child->PartitionTableOffset(), parent->Offset(),
parent->Offset() + parent->Size()));
return false;
}
if (child->Offset() + child->Size() > parent->Offset() + parent->Size()) {
@@ -99,7 +99,7 @@ get_type_for_content_type(const char* contentType, char* type)
static status_t
pm_std_ops(int32 op, ...)
{
TRACE(("intel: pm_std_ops(0x%lx)\n", op));
TRACE(("intel: pm_std_ops(0x%" B_PRIx32 ")\n", op));
switch(op) {
case B_MODULE_INIT:
case B_MODULE_UNINIT:
@@ -117,9 +117,9 @@ pm_identify_partition(int fd, partition_data* partition, void** cookie)
if (fd < 0 || !partition || !cookie)
return -1;
TRACE(("intel: pm_identify_partition(%d, %ld: %lld, %lld, %ld)\n", fd,
partition->id, partition->offset, partition->size,
partition->block_size));
TRACE(("intel: pm_identify_partition(%d, %" B_PRId32 ": %" B_PRId64 ", "
"%" B_PRId64 ", %" B_PRId32 ")\n", fd, partition->id, partition->offset,
partition->size, partition->block_size));
// reject extended partitions
if (partition->type
&& !strcmp(partition->type, kPartitionTypeIntelExtended)) {
@@ -182,9 +182,9 @@ pm_scan_partition(int fd, partition_data* partition, void* cookie)
if (fd < 0 || !partition || !cookie)
return B_ERROR;
TRACE(("intel: pm_scan_partition(%d, %ld: %lld, %lld, %ld)\n", fd,
partition->id, partition->offset, partition->size,
partition->block_size));
TRACE(("intel: pm_scan_partition(%d, %" B_PRId32 ": %" B_PRId64 ", "
"%" B_PRId64 ", %" B_PRId32 ")\n", fd, partition->id, partition->offset,
partition->size, partition->block_size));
PartitionMapCookie* map = (PartitionMapCookie*)cookie;
// fill in the partition_data structure
@@ -287,7 +287,7 @@ pm_free_partition_content_cookie(partition_data* partition)
static status_t
ep_std_ops(int32 op, ...)
{
TRACE(("intel: ep_std_ops(0x%lx)\n", op));
TRACE(("intel: ep_std_ops(0x%" B_PRIx32 ")\n", op));
switch(op) {
case B_MODULE_INIT:
case B_MODULE_UNINIT:
@@ -305,8 +305,9 @@ ep_identify_partition(int fd, partition_data* partition, void** cookie)
if (fd < 0 || !partition || !cookie || !partition->cookie)
return -1;
TRACE(("intel: ep_identify_partition(%d, %lld, %lld, %ld)\n", fd,
partition->offset, partition->size, partition->block_size));
TRACE(("intel: ep_identify_partition(%d, %" B_PRId64 ", %" B_PRId64 ", "
"%" B_PRId32 ")\n", fd, partition->offset, partition->size,
partition->block_size));
// our parent must be a intel partition map partition and we must have
// extended partition type
@@ -333,8 +334,9 @@ ep_scan_partition(int fd, partition_data* partition, void* cookie)
if (fd < 0 || !partition || !partition->cookie)
return B_ERROR;
TRACE(("intel: ep_scan_partition(%d, %lld, %lld, %ld)\n", fd,
partition->offset, partition->size, partition->block_size));
TRACE(("intel: ep_scan_partition(%d, %" B_PRId64 ", %" B_PRId64 ", "
"%" B_PRId32 ")\n", fd, partition->offset, partition->size,
partition->block_size));
partition_data* parent = get_parent_partition(partition->id);
if (!parent)
@@ -373,7 +375,7 @@ ep_scan_partition(int fd, partition_data* partition, void* cookie)
// parameters
char buffer[128];
sprintf(buffer, "active %s ;\npartition_table_offset %lld ;\n",
sprintf(buffer, "active %s ;\npartition_table_offset %" B_PRId64 " ;\n",
logical->Active() ? "true" : "false",
logical->PartitionTableOffset());
child->parameters = strdup(buffer);
@@ -679,7 +679,8 @@ get_partitionable_spaces(partition_data* partition,
if (positions)
delete[] positions;
TRACE(("intel: get_partitionable_spaces - found: %ld\n", actualCount));
TRACE(("intel: get_partitionable_spaces - found: %" B_PRId32 "\n",
actualCount));
*_actualCount = actualCount;
@@ -752,8 +753,8 @@ status_t
pm_shadow_changed(partition_data* partition, partition_data* child,
uint32 operation)
{
TRACE(("intel: pm_shadow_changed(%p, %p, %lu)\n", partition, child,
operation));
TRACE(("intel: pm_shadow_changed(%p, %p, %" B_PRIu32 ")\n", partition,
child, operation));
switch (operation) {
case B_PARTITION_SHADOW:
@@ -763,14 +764,16 @@ pm_shadow_changed(partition_data* partition, partition_data* child,
partition->id);
if (!physicalPartition) {
dprintf("intel: pm_shadow_changed(B_PARTITION_SHADOW): no "
"physical partition with ID %ld\n", partition->id);
"physical partition with ID %" B_PRId32 "\n",
partition->id);
return B_ERROR;
}
// clone the map
if (!physicalPartition->content_cookie) {
dprintf("intel: pm_shadow_changed(B_PARTITION_SHADOW): no "
"content cookie, physical partition: %ld\n", partition->id);
"content cookie, physical partition: %" B_PRId32 "\n",
partition->id);
return B_ERROR;
}
@@ -796,13 +799,14 @@ pm_shadow_changed(partition_data* partition, partition_data* child,
partition_data* physical = get_partition(child->id);
if (!physical) {
dprintf("intel: pm_shadow_changed(B_PARTITION_SHADOW_CHILD): "
"no physical partition with ID %ld\n", child->id);
"no physical partition with ID %" B_PRId32 "\n", child->id);
return B_ERROR;
}
if (!physical->cookie) {
dprintf("intel: pm_shadow_changed(B_PARTITION_SHADOW_CHILD): "
"no cookie, physical partition: %ld\n", child->id);
"no cookie, physical partition: %" B_PRId32 "\n",
child->id);
return B_ERROR;
}
@@ -811,7 +815,7 @@ pm_shadow_changed(partition_data* partition, partition_data* child,
if (!partition->content_cookie) {
dprintf("intel: pm_shadow_changed(B_PARTITION_SHADOW_CHILD): "
"no content cookie, physical partition: %ld\n",
"no content cookie, physical partition: %" B_PRId32 "\n",
partition->id);
return B_ERROR;
}
@@ -823,8 +827,8 @@ pm_shadow_changed(partition_data* partition, partition_data* child,
if (!primary || primary->IsEmpty()) {
dprintf("intel: pm_shadow_changed(B_PARTITION_SHADOW_CHILD): "
"partition %ld is empty, primary index: %ld\n", child->id,
index);
"partition %" B_PRId32 " is empty, primary index: "
"%" B_PRId32 "\n", child->id, index);
return B_BAD_VALUE;
}
@@ -849,7 +853,8 @@ pm_shadow_changed(partition_data* partition, partition_data* child,
{
if (!partition->content_cookie) {
dprintf("intel: pm_shadow_changed(B_PARTITION_CREATE_CHILD): "
"no content cookie, partition: %ld\n", partition->id);
"no content cookie, partition: %" B_PRId32 "\n",
partition->id);
return B_ERROR;
}
@@ -867,7 +872,8 @@ pm_shadow_changed(partition_data* partition, partition_data* child,
if (!primary) {
dprintf("intel: pm_shadow_changed(B_PARTITION_CREATE_CHILD): "
"no empty primary slot, partition: %ld\n", partition->id);
"no empty primary slot, partition: %" B_PRId32 "\n",
partition->id);
return B_ERROR;
}
@@ -876,7 +882,8 @@ pm_shadow_changed(partition_data* partition, partition_data* child,
type.SetType(child->type);
if (!type.IsValid()) {
dprintf("intel: pm_shadow_changed(B_PARTITION_CREATE_CHILD): "
"invalid partition type, partition: %ld\n", partition->id);
"invalid partition type, partition: %" B_PRId32 "\n",
partition->id);
return B_ERROR;
}
@@ -1065,7 +1072,7 @@ move_block(int fd, off_t fromOffset, off_t toOffset, uint8* buffer, int32 size)
error = errno;
if (error == B_OK)
error = B_IO_ERROR;
TRACE(("intel: move_block(): reading failed: %lx\n", error));
TRACE(("intel: move_block(): reading failed: %" B_PRIx32 "\n", error));
return error;
}
@@ -1074,7 +1081,7 @@ move_block(int fd, off_t fromOffset, off_t toOffset, uint8* buffer, int32 size)
error = errno;
if (error == B_OK)
error = B_IO_ERROR;
TRACE(("intel: move_block(): writing failed: %lx\n", error));
TRACE(("intel: move_block(): writing failed: %" B_PRIx32 "\n", error));
}
return error;
@@ -1520,9 +1527,9 @@ ep_is_sub_system_for(partition_data* partition)
if (partition == NULL)
return false;
TRACE(("intel: ep_is_sub_system_for(%ld: %lld, %lld, %ld, %s)\n",
partition->id, partition->offset, partition->size,
partition->block_size, partition->content_type));
TRACE(("intel: ep_is_sub_system_for(%" B_PRId32 ": %" B_PRId64 ", "
"%" B_PRId64 ", %" B_PRId32 ", %s)\n", partition->id, partition->offset,
partition->size, partition->block_size, partition->content_type));
// Intel Extended Partition can live in child partition of Intel Partition
// Map
@@ -2280,8 +2287,8 @@ ep_delete_child(int fd, partition_id partitionID, partition_id childID,
if (get_partition_from_offset_ep(partition, next->Offset(),
&nextSibling)) {
char buffer[128];
sprintf(buffer, "active %s ;\npartition_table_offset %lld ;\n",
next->Active() ? "true" : "false",
sprintf(buffer, "active %s ;\npartition_table_offset %" B_PRId64
" ;\n", next->Active() ? "true" : "false",
next->PartitionTableOffset());
nextSibling->parameters = strdup(buffer);
}