Replaced "%Ld" and "%lld" in printf()s by the new B_PRI* macros to avoid

warnings when building with a 64 bit compiler.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34216 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2009-11-24 19:48:32 +00:00
parent 1fee9fcf21
commit 8859eeab53
7 changed files with 95 additions and 82 deletions
@@ -110,8 +110,9 @@ CachedNode::SetTo(off_t offset, bool check)
if (InternalSetTo(NULL, offset) != NULL && check) { if (InternalSetTo(NULL, offset) != NULL && check) {
// sanity checks (links, all_key_count) // sanity checks (links, all_key_count)
if (!fTree->fHeader->CheckNode(fNode)) { if (!fTree->fHeader->CheckNode(fNode)) {
FATAL(("invalid node [%p] read from offset %Ld (block %Ld), inode " FATAL(("invalid node [%p] read from offset %" B_PRIdOFF " (block %"
"at %Ld\n", fNode, offset, fBlockNumber, fTree->fStream->ID())); B_PRIdOFF "), inode at %" B_PRIdINO "\n", fNode, offset,
fBlockNumber, fTree->fStream->ID()));
return NULL; return NULL;
} }
} }
@@ -140,8 +141,9 @@ CachedNode::SetToWritable(Transaction& transaction, off_t offset, bool check)
if (InternalSetTo(&transaction, offset) != NULL && check) { if (InternalSetTo(&transaction, offset) != NULL && check) {
// sanity checks (links, all_key_count) // sanity checks (links, all_key_count)
if (!fTree->fHeader->CheckNode(fNode)) { if (!fTree->fHeader->CheckNode(fNode)) {
FATAL(("invalid node [%p] read from offset %Ld (block %Ld), inode " FATAL(("invalid node [%p] read from offset %" B_PRIdOFF " (block %"
"at %Ld\n", fNode, offset, fBlockNumber, fTree->fStream->ID())); B_PRIdOFF "), inode at %" B_PRIdINO "\n", fNode, offset,
fBlockNumber, fTree->fStream->ID()));
return NULL; return NULL;
} }
} }
@@ -455,8 +457,8 @@ BPlusTree::SetTo(Inode* stream)
// is header valid? // is header valid?
if (fHeader->MaximumSize() != stream->Size()) { if (fHeader->MaximumSize() != stream->Size()) {
dprintf("B+tree header size %Ld doesn't fit file size %Ld!\n", dprintf("B+tree header size %" B_PRIdOFF " doesn't fit file size %"
fHeader->MaximumSize(), stream->Size()); B_PRIdOFF "!\n", fHeader->MaximumSize(), stream->Size());
// we can't change the header since we don't have a transaction // we can't change the header since we don't have a transaction
//fHeader->maximum_size = HOST_ENDIAN_TO_BFS_INT64(stream->Size()); //fHeader->maximum_size = HOST_ENDIAN_TO_BFS_INT64(stream->Size());
} }
@@ -727,7 +729,7 @@ BPlusTree::_SeekDown(Stack<node_and_key>& stack, const uint8* key,
nodeAndKey.nodeOffset = nextOffset; nodeAndKey.nodeOffset = nextOffset;
} }
FATAL(("BPlusTree::_SeekDown() could not open node %Ld\n", FATAL(("BPlusTree::_SeekDown() could not open node %" B_PRIdOFF "\n",
nodeAndKey.nodeOffset)); nodeAndKey.nodeOffset));
return B_ERROR; return B_ERROR;
} }
@@ -752,7 +754,8 @@ BPlusTree::_FindFreeDuplicateFragment(Transaction& transaction,
const bplustree_node* fragment = cached.SetTo( const bplustree_node* fragment = cached.SetTo(
bplustree_node::FragmentOffset(value), false); bplustree_node::FragmentOffset(value), false);
if (fragment == NULL) { if (fragment == NULL) {
FATAL(("Could not get duplicate fragment at %Ld\n", value)); FATAL(("Could not get duplicate fragment at %" B_PRIdOFF "\n",
value));
continue; continue;
} }
@@ -804,7 +807,7 @@ BPlusTree::_InsertDuplicate(Transaction& transaction, CachedNode& cached,
if (array->count > NUM_FRAGMENT_VALUES if (array->count > NUM_FRAGMENT_VALUES
|| array->count < 1) { || array->count < 1) {
FATAL(("insertDuplicate: Invalid array[%d] size in fragment " FATAL(("insertDuplicate: Invalid array[%d] size in fragment "
"%Ld == %Ld!\n", "%" B_PRIdOFF " == %" B_PRIdOFF "!\n",
(int)bplustree_node::FragmentIndex(oldValue), (int)bplustree_node::FragmentIndex(oldValue),
bplustree_node::FragmentOffset(oldValue), array->count)); bplustree_node::FragmentOffset(oldValue), array->count));
return B_BAD_DATA; return B_BAD_DATA;
@@ -878,8 +881,9 @@ BPlusTree::_InsertDuplicate(Transaction& transaction, CachedNode& cached,
array = duplicate->DuplicateArray(); array = duplicate->DuplicateArray();
if (array->count > NUM_DUPLICATE_VALUES || array->count < 0) { if (array->count > NUM_DUPLICATE_VALUES || array->count < 0) {
FATAL(("removeDuplicate: Invalid array size in duplicate %Ld " FATAL(("removeDuplicate: Invalid array size in duplicate %"
"== %Ld!\n", duplicateOffset, array->count)); B_PRIdOFF " == %" B_PRIdOFF "!\n", duplicateOffset,
array->count));
return B_BAD_DATA; return B_BAD_DATA;
} }
} while (array->count >= NUM_DUPLICATE_VALUES } while (array->count >= NUM_DUPLICATE_VALUES
@@ -1427,14 +1431,15 @@ BPlusTree::_RemoveDuplicate(Transaction& transaction,
if (array->count > NUM_FRAGMENT_VALUES if (array->count > NUM_FRAGMENT_VALUES
|| array->count < 1) { || array->count < 1) {
FATAL(("removeDuplicate: Invalid array[%d] size in fragment %Ld " FATAL(("removeDuplicate: Invalid array[%d] size in fragment %"
"== %Ld!\n", (int)bplustree_node::FragmentIndex(oldValue), B_PRIdOFF " == %" B_PRIdOFF "!\n",
duplicateOffset, array->count)); (int)bplustree_node::FragmentIndex(oldValue), duplicateOffset,
array->count));
return B_BAD_DATA; return B_BAD_DATA;
} }
if (!array->Remove(value)) { if (!array->Remove(value)) {
FATAL(("Oh no, value %Ld not found in fragments of node %Ld...\n", FATAL(("Oh no, value %" B_PRIdOFF " not found in fragments of node "
value, duplicateOffset)); "%" B_PRIdOFF "...\n", value, duplicateOffset));
return B_ENTRY_NOT_FOUND; return B_ENTRY_NOT_FOUND;
} }
@@ -1464,8 +1469,8 @@ BPlusTree::_RemoveDuplicate(Transaction& transaction,
duplicate_array* array = NULL; duplicate_array* array = NULL;
if (duplicate->LeftLink() != BPLUSTREE_NULL) { if (duplicate->LeftLink() != BPLUSTREE_NULL) {
FATAL(("invalid duplicate node: first left link points to %Ld!\n", FATAL(("invalid duplicate node: first left link points to %" B_PRIdOFF
duplicate->LeftLink())); "!\n", duplicate->LeftLink()));
return B_BAD_DATA; return B_BAD_DATA;
} }
@@ -1474,8 +1479,9 @@ BPlusTree::_RemoveDuplicate(Transaction& transaction,
array = duplicate->DuplicateArray(); array = duplicate->DuplicateArray();
if (array->count > NUM_DUPLICATE_VALUES if (array->count > NUM_DUPLICATE_VALUES
|| array->count < 0) { || array->count < 0) {
FATAL(("removeDuplicate: Invalid array size in duplicate %Ld == " FATAL(("removeDuplicate: Invalid array size in duplicate %"
"%Ld!\n", duplicateOffset, array->count)); B_PRIdOFF " == %" B_PRIdOFF "!\n", duplicateOffset,
array->count));
return B_BAD_DATA; return B_BAD_DATA;
} }
@@ -1886,7 +1892,7 @@ BPlusTree::Find(const uint8* key, uint16 keyLength, off_t* _value)
nodeOffset = nextOffset; nodeOffset = nextOffset;
} }
FATAL(("b+tree node at %Ld could not be loaded\n", nodeOffset)); FATAL(("b+tree node at %" B_PRIdOFF " could not be loaded\n", nodeOffset));
RETURN_ERROR(B_ERROR); RETURN_ERROR(B_ERROR);
} }
@@ -705,8 +705,8 @@ BlockAllocator::_Initialize(BlockAllocator* allocator)
if (volume->UsedBlocks() != usedBlocks) { if (volume->UsedBlocks() != usedBlocks) {
// If the disk in a dirty state at mount time, it's // If the disk in a dirty state at mount time, it's
// normal that the values don't match // normal that the values don't match
INFORM(("volume reports %Ld used blocks, correct is %Ld\n", INFORM(("volume reports %" B_PRIdOFF " used blocks, correct is %"
volume->UsedBlocks(), usedBlocks)); B_PRIdOFF "\n", volume->UsedBlocks(), usedBlocks));
volume->SuperBlock().used_blocks = HOST_ENDIAN_TO_BFS_INT64(usedBlocks); volume->SuperBlock().used_blocks = HOST_ENDIAN_TO_BFS_INT64(usedBlocks);
} }
@@ -1379,7 +1379,7 @@ BlockAllocator::CheckNextNode(check_control* control)
Vnode vnode(fVolume, cookie->current); Vnode vnode(fVolume, cookie->current);
Inode* inode; Inode* inode;
if (vnode.Get(&inode) != B_OK) { if (vnode.Get(&inode) != B_OK) {
FATAL(("check: Could not open inode at %Ld\n", FATAL(("check: Could not open inode at %" B_PRIdOFF "\n",
fVolume->ToBlock(cookie->current))); fVolume->ToBlock(cookie->current)));
continue; continue;
} }
@@ -1402,8 +1402,8 @@ BlockAllocator::CheckNextNode(check_control* control)
BPlusTree* tree = inode->Tree(); BPlusTree* tree = inode->Tree();
if (tree == NULL) { if (tree == NULL) {
FATAL(("check: could not open b+tree from inode at %Ld\n", FATAL(("check: could not open b+tree from inode at %" B_PRIdOFF
fVolume->ToBlock(cookie->current))); "\n", fVolume->ToBlock(cookie->current)));
continue; continue;
} }
@@ -1455,7 +1455,7 @@ BlockAllocator::CheckNextNode(check_control* control)
Vnode vnode(fVolume, id); Vnode vnode(fVolume, id);
Inode* inode; Inode* inode;
if (vnode.Get(&inode) != B_OK) { if (vnode.Get(&inode) != B_OK) {
FATAL(("Could not open inode ID %Ld!\n", id)); FATAL(("Could not open inode ID %" B_PRIdINO "!\n", id));
control->errors |= BFS_COULD_NOT_OPEN; control->errors |= BFS_COULD_NOT_OPEN;
if ((control->flags & BFS_REMOVE_INVALID) != 0) { if ((control->flags & BFS_REMOVE_INVALID) != 0) {
@@ -1506,9 +1506,10 @@ BlockAllocator::CheckNextNode(check_control* control)
&& !inode->IsIndex()) && !inode->IsIndex())
|| (is_directory(cookie->parent_mode) || (is_directory(cookie->parent_mode)
&& !inode->IsRegularNode())) { && !inode->IsRegularNode())) {
FATAL(("inode at %Ld is of wrong type: %o (parent %o at %Ld)!" FATAL(("inode at %" B_PRIdOFF " is of wrong type: %o (parent "
"\n", inode->BlockNumber(), inode->Mode(), "%o at %" B_PRIdOFF ")!\n", inode->BlockNumber(),
cookie->parent_mode, cookie->parent->BlockNumber())); inode->Mode(), cookie->parent_mode,
cookie->parent->BlockNumber()));
// if we are allowed to fix errors, we should remove the file // if we are allowed to fix errors, we should remove the file
if ((control->flags & BFS_REMOVE_WRONG_TYPES) != 0 if ((control->flags & BFS_REMOVE_WRONG_TYPES) != 0
@@ -1701,14 +1702,14 @@ BlockAllocator::CheckBlockRun(block_run run, const char* type,
if (firstSet == -1) { if (firstSet == -1) {
firstSet = firstGroupBlock + offset; firstSet = firstGroupBlock + offset;
control->errors |= BFS_BLOCKS_ALREADY_SET; control->errors |= BFS_BLOCKS_ALREADY_SET;
dprintf("block %lld is already set!!!\n", dprintf("block %" B_PRIdOFF " is already set!!!\n",
firstGroupBlock + offset); firstGroupBlock + offset);
} }
control->stats.already_set++; control->stats.already_set++;
} else { } else {
if (firstSet != -1) { if (firstSet != -1) {
FATAL(("%s: block_run(%d, %u, %u): blocks %Ld - %Ld " FATAL(("%s: block_run(%d, %u, %u): blocks %" B_PRIdOFF
"are already set!\n", type, " - %" B_PRIdOFF " are already set!\n", type,
(int)run.AllocationGroup(), run.Start(), (int)run.AllocationGroup(), run.Start(),
run.Length(), firstSet, run.Length(), firstSet,
firstGroupBlock + offset - 1)); firstGroupBlock + offset - 1));
@@ -1729,9 +1730,10 @@ BlockAllocator::CheckBlockRun(block_run run, const char* type,
firstGroupBlock + pos + block * bitsPerBlock - 1)); firstGroupBlock + pos + block * bitsPerBlock - 1));
} }
if (firstSet != -1) { if (firstSet != -1) {
FATAL(("%s: block_run(%d, %u, %u): blocks %Ld - %Ld are " FATAL(("%s: block_run(%d, %u, %u): blocks %" B_PRIdOFF " - %"
"already set!\n", type, (int)run.AllocationGroup(), B_PRIdOFF " are already set!\n", type,
run.Start(), run.Length(), firstSet, (int)run.AllocationGroup(), run.Start(), run.Length(),
firstSet,
firstGroupBlock + pos + block * bitsPerBlock - 1)); firstGroupBlock + pos + block * bitsPerBlock - 1));
} }
} }
+31 -28
View File
@@ -52,8 +52,8 @@ dump_super_block(const disk_super_block* superBlock)
get_tupel(superBlock->fs_byte_order)); get_tupel(superBlock->fs_byte_order));
kprintf(" block_size = %u\n", (unsigned)superBlock->BlockSize()); kprintf(" block_size = %u\n", (unsigned)superBlock->BlockSize());
kprintf(" block_shift = %u\n", (unsigned)superBlock->BlockShift()); kprintf(" block_shift = %u\n", (unsigned)superBlock->BlockShift());
kprintf(" num_blocks = %Lu\n", superBlock->NumBlocks()); kprintf(" num_blocks = %" B_PRIdOFF "\n", superBlock->NumBlocks());
kprintf(" used_blocks = %Lu\n", superBlock->UsedBlocks()); kprintf(" used_blocks = %" B_PRIdOFF "\n", superBlock->UsedBlocks());
kprintf(" inode_size = %u\n", (unsigned)superBlock->InodeSize()); kprintf(" inode_size = %u\n", (unsigned)superBlock->InodeSize());
kprintf(" magic2 = %#08x (%s) %s\n", (int)superBlock->Magic2(), kprintf(" magic2 = %#08x (%s) %s\n", (int)superBlock->Magic2(),
get_tupel(superBlock->magic2), get_tupel(superBlock->magic2),
@@ -67,8 +67,8 @@ dump_super_block(const disk_super_block* superBlock)
kprintf(" flags = %#08x (%s)\n", (int)superBlock->Flags(), kprintf(" flags = %#08x (%s)\n", (int)superBlock->Flags(),
get_tupel(superBlock->Flags())); get_tupel(superBlock->Flags()));
dump_block_run(" log_blocks = ", superBlock->log_blocks); dump_block_run(" log_blocks = ", superBlock->log_blocks);
kprintf(" log_start = %Lu\n", superBlock->LogStart()); kprintf(" log_start = %" B_PRIdOFF "\n", superBlock->LogStart());
kprintf(" log_end = %Lu\n", superBlock->LogEnd()); kprintf(" log_end = %" B_PRIdOFF "\n", superBlock->LogEnd());
kprintf(" magic3 = %#08x (%s) %s\n", (int)superBlock->Magic3(), kprintf(" magic3 = %#08x (%s) %s\n", (int)superBlock->Magic3(),
get_tupel(superBlock->magic3), get_tupel(superBlock->magic3),
(superBlock->magic3 == SUPER_BLOCK_MAGIC3 ? "valid" : "INVALID")); (superBlock->magic3 == SUPER_BLOCK_MAGIC3 ? "valid" : "INVALID"));
@@ -87,21 +87,23 @@ dump_data_stream(const data_stream* stream)
dump_block_run("", stream->direct[i]); dump_block_run("", stream->direct[i]);
} }
} }
kprintf(" max_direct_range = %Lu\n", stream->MaxDirectRange()); kprintf(" max_direct_range = %" B_PRIdOFF "\n",
stream->MaxDirectRange());
if (!stream->indirect.IsZero()) if (!stream->indirect.IsZero())
dump_block_run(" indirect = ", stream->indirect); dump_block_run(" indirect = ", stream->indirect);
kprintf(" max_indirect_range = %Lu\n", stream->MaxIndirectRange()); kprintf(" max_indirect_range = %" B_PRIdOFF "\n",
stream->MaxIndirectRange());
if (!stream->double_indirect.IsZero()) { if (!stream->double_indirect.IsZero()) {
dump_block_run(" double_indirect = ", dump_block_run(" double_indirect = ",
stream->double_indirect); stream->double_indirect);
} }
kprintf(" max_double_indirect_range = %Lu\n", kprintf(" max_double_indirect_range = %" B_PRIdOFF "\n",
stream->MaxDoubleIndirectRange()); stream->MaxDoubleIndirectRange());
kprintf(" size = %Lu\n", stream->Size()); kprintf(" size = %" B_PRIdOFF "\n", stream->Size());
} }
@@ -117,14 +119,14 @@ dump_inode(const bfs_inode* inode)
kprintf(" gid = %u\n", (unsigned)inode->GroupID()); kprintf(" gid = %u\n", (unsigned)inode->GroupID());
kprintf(" mode = %08x\n", (int)inode->Mode()); kprintf(" mode = %08x\n", (int)inode->Mode());
kprintf(" flags = %08x\n", (int)inode->Flags()); kprintf(" flags = %08x\n", (int)inode->Flags());
kprintf(" create_time = %llx (%ld.%u)\n", inode->CreateTime(), kprintf(" create_time = %" B_PRIx64 " (%ld.%u)\n",
bfs_inode::ToSecs(inode->CreateTime()), inode->CreateTime(), bfs_inode::ToSecs(inode->CreateTime()),
(unsigned)bfs_inode::ToUsecs(inode->CreateTime())); (unsigned)bfs_inode::ToUsecs(inode->CreateTime()));
kprintf(" last_modified_time = %llx (%ld.%u)\n", inode->LastModifiedTime(), kprintf(" last_modified_time = %" B_PRIx64 " (%ld.%u)\n",
bfs_inode::ToSecs(inode->LastModifiedTime()), inode->LastModifiedTime(), bfs_inode::ToSecs(inode->LastModifiedTime()),
(unsigned)bfs_inode::ToUsecs(inode->LastModifiedTime())); (unsigned)bfs_inode::ToUsecs(inode->LastModifiedTime()));
kprintf(" status_change_time = %llx (%ld.%u)\n", inode->StatusChangeTime(), kprintf(" status_change_time = %" B_PRIx64 " (%ld.%u)\n",
bfs_inode::ToSecs(inode->StatusChangeTime()), inode->StatusChangeTime(), bfs_inode::ToSecs(inode->StatusChangeTime()),
(unsigned)bfs_inode::ToUsecs(inode->StatusChangeTime())); (unsigned)bfs_inode::ToUsecs(inode->StatusChangeTime()));
dump_block_run( " parent = ", inode->parent); dump_block_run( " parent = ", inode->parent);
dump_block_run( " attributes = ", inode->attributes); dump_block_run( " attributes = ", inode->attributes);
@@ -150,9 +152,9 @@ dump_bplustree_header(const bplustree_header* header)
kprintf(" max_number_of_levels = %u\n", kprintf(" max_number_of_levels = %u\n",
(unsigned)header->MaxNumberOfLevels()); (unsigned)header->MaxNumberOfLevels());
kprintf(" data_type = %u\n", (unsigned)header->DataType()); kprintf(" data_type = %u\n", (unsigned)header->DataType());
kprintf(" root_node_pointer = %Ld\n", header->RootNode()); kprintf(" root_node_pointer = %" B_PRIdOFF "\n", header->RootNode());
kprintf(" free_node_pointer = %Ld\n", header->FreeNode()); kprintf(" free_node_pointer = %" B_PRIdOFF "\n", header->FreeNode());
kprintf(" maximum_size = %Lu\n", header->MaximumSize()); kprintf(" maximum_size = %" B_PRIdOFF "\n", header->MaximumSize());
} }
@@ -196,9 +198,9 @@ dump_bplustree_node(const bplustree_node* node, const bplustree_header* header,
Volume* volume) Volume* volume)
{ {
kprintf("bplustree_node:\n"); kprintf("bplustree_node:\n");
kprintf(" left_link = %Ld\n", node->left_link); kprintf(" left_link = %" B_PRId64 "\n", node->left_link);
kprintf(" right_link = %Ld\n", node->right_link); kprintf(" right_link = %" B_PRId64 "\n", node->right_link);
kprintf(" overflow_link = %Ld\n", node->overflow_link); kprintf(" overflow_link = %" B_PRId64 "\n", node->overflow_link);
kprintf(" all_key_count = %u\n", node->all_key_count); kprintf(" all_key_count = %u\n", node->all_key_count);
kprintf(" all_key_length = %u\n", node->all_key_length); kprintf(" all_key_length = %u\n", node->all_key_length);
@@ -240,24 +242,25 @@ dump_bplustree_node(const bplustree_node* node, const bplustree_header* header,
kprintf("uint32 = %u (0x%x)", (unsigned)*(uint32 *)&buffer, kprintf("uint32 = %u (0x%x)", (unsigned)*(uint32 *)&buffer,
(unsigned)*(uint32 *)&buffer); (unsigned)*(uint32 *)&buffer);
} else if (header->data_type == BPLUSTREE_INT64_TYPE) { } else if (header->data_type == BPLUSTREE_INT64_TYPE) {
kprintf("int64 = %Ld (0x%Lx)", *(int64 *)&buffer, kprintf("int64 = %" B_PRId64 " (%#" B_PRIx64 ")",
*(int64 *)&buffer); *(int64 *)&buffer, *(int64 *)&buffer);
} else } else
kprintf("???"); kprintf("???");
off_t offset = *value & 0x3fffffffffffffffLL; off_t offset = *value & 0x3fffffffffffffffLL;
kprintf(" (%d bytes) -> %Ld", length, offset); kprintf(" (%d bytes) -> %" B_PRIdOFF, length, offset);
if (volume != NULL) { if (volume != NULL) {
block_run run = volume->ToBlockRun(offset); block_run run = volume->ToBlockRun(offset);
kprintf(" (%d, %d)", (int)run.allocation_group, run.start); kprintf(" (%d, %d)", (int)run.allocation_group, run.start);
} }
if (bplustree_node::LinkType(*value) if (bplustree_node::LinkType(*value)
== BPLUSTREE_DUPLICATE_FRAGMENT) == BPLUSTREE_DUPLICATE_FRAGMENT) {
kprintf(" (duplicate fragment %Ld)\n", *value & 0x3ff); kprintf(" (duplicate fragment %" B_PRIdOFF ")\n",
else if (bplustree_node::LinkType(*value) *value & 0x3ff);
== BPLUSTREE_DUPLICATE_NODE) } else if (bplustree_node::LinkType(*value)
== BPLUSTREE_DUPLICATE_NODE) {
kprintf(" (duplicate node)\n"); kprintf(" (duplicate node)\n");
else } else
kprintf("\n"); kprintf("\n");
} }
} }
@@ -253,7 +253,7 @@ InodeAllocator::Keep(fs_vnode_ops* vnodeOps, uint32 publishFlags)
status_t status = fInode->WriteBack(*fTransaction); status_t status = fInode->WriteBack(*fTransaction);
if (status < B_OK) { if (status < B_OK) {
FATAL(("writing new inode %Ld failed!\n", fInode->ID())); FATAL(("writing new inode %" B_PRIdINO " failed!\n", fInode->ID()));
return status; return status;
} }
@@ -412,7 +412,7 @@ Inode::InitCheck(bool checkNode)
return B_BUSY; return B_BUSY;
if (status != B_OK) { if (status != B_OK) {
FATAL(("inode at block %Ld corrupt!\n", BlockNumber())); FATAL(("inode at block %" B_PRIdOFF " corrupt!\n", BlockNumber()));
RETURN_ERROR(B_BAD_DATA); RETURN_ERROR(B_BAD_DATA);
} }
} }
@@ -424,7 +424,8 @@ Inode::InitCheck(bool checkNode)
status_t status = fTree->InitCheck(); status_t status = fTree->InitCheck();
if (status != B_OK) { if (status != B_OK) {
FATAL(("inode tree at block %Ld corrupt!\n", BlockNumber())); FATAL(("inode tree at block %" B_PRIdOFF " corrupt!\n",
BlockNumber()));
RETURN_ERROR(B_BAD_DATA); RETURN_ERROR(B_BAD_DATA);
} }
} }
@@ -2781,7 +2782,7 @@ AttributeIterator::GetNext(char* name, size_t* _length, uint32* _type,
if (get_vnode(volume->FSVolume(), volume->ToVnode(fInode->Attributes()), if (get_vnode(volume->FSVolume(), volume->ToVnode(fInode->Attributes()),
(void**)&fAttributes) != B_OK) { (void**)&fAttributes) != B_OK) {
FATAL(("get_vnode() failed in AttributeIterator::GetNext(ino_t" FATAL(("get_vnode() failed in AttributeIterator::GetNext(ino_t"
" = %Ld,name = \"%s\")\n", fInode->ID(), name)); " = %" B_PRIdINO ",name = \"%s\")\n", fInode->ID(), name));
return B_ENTRY_NOT_FOUND; return B_ENTRY_NOT_FOUND;
} }
@@ -2789,7 +2790,7 @@ AttributeIterator::GetNext(char* name, size_t* _length, uint32* _type,
if (tree == NULL if (tree == NULL
|| (fIterator = new TreeIterator(tree)) == NULL) { || (fIterator = new TreeIterator(tree)) == NULL) {
FATAL(("could not get tree in AttributeIterator::GetNext(ino_t" FATAL(("could not get tree in AttributeIterator::GetNext(ino_t"
" = %Ld,name = \"%s\")\n", fInode->ID(), name)); " = %" B_PRIdINO ",name = \"%s\")\n", fInode->ID(), name));
return B_ENTRY_NOT_FOUND; return B_ENTRY_NOT_FOUND;
} }
} }
@@ -518,7 +518,7 @@ Journal::_ReplayRunArray(int32* _start)
for (int32 index = 0; index < array->CountRuns(); index++) { for (int32 index = 0; index < array->CountRuns(); index++) {
const block_run& run = array->RunAt(index); const block_run& run = array->RunAt(index);
INFORM(("replay block run %u:%u:%u in log at %Ld!\n", INFORM(("replay block run %u:%u:%u in log at %" B_PRIdOFF "!\n",
(int)run.AllocationGroup(), run.Start(), run.Length(), blockNumber)); (int)run.AllocationGroup(), run.Start(), run.Length(), blockNumber));
off_t offset = fVolume->ToOffset(run); off_t offset = fVolume->ToOffset(run);
@@ -1068,8 +1068,8 @@ Equation::GetNextMatching(Volume* volume, TreeIterator* iterator,
Inode* inode; Inode* inode;
if ((status = vnode.Get(&inode)) != B_OK) { if ((status = vnode.Get(&inode)) != B_OK) {
REPORT_ERROR(status); REPORT_ERROR(status);
FATAL(("could not get inode %Ld in index \"%s\"!\n", offset, FATAL(("could not get inode %" B_PRIdOFF " in index \"%s\"!\n",
fAttribute)); offset, fAttribute));
// try with next // try with next
continue; continue;
} }
@@ -1124,7 +1124,7 @@ Equation::GetNextMatching(Volume* volume, TreeIterator* iterator,
dirent->d_pino = volume->ToVnode(inode->Parent()); dirent->d_pino = volume->ToVnode(inode->Parent());
if (inode->GetName(dirent->d_name) < B_OK) { if (inode->GetName(dirent->d_name) < B_OK) {
FATAL(("inode %Ld in query has no name!\n", FATAL(("inode %" B_PRIdOFF " in query has no name!\n",
inode->BlockNumber())); inode->BlockNumber()));
} }
@@ -175,7 +175,7 @@ bfs_mount(fs_volume* _volume, const char* device, uint32 flags,
_volume->ops = &gBFSVolumeOps; _volume->ops = &gBFSVolumeOps;
*_rootID = volume->ToVnode(volume->Root()); *_rootID = volume->ToVnode(volume->Root());
INFORM(("mounted \"%s\" (root node at %lld, device = %s)\n", INFORM(("mounted \"%s\" (root node at %" B_PRIdINO ", device = %s)\n",
volume->Name(), *_rootID, device)); volume->Name(), *_rootID, device));
return B_OK; return B_OK;
} }
@@ -275,23 +275,23 @@ bfs_get_vnode(fs_volume* _volume, ino_t id, fs_vnode* _node, int* _type,
// the hassle and try to load an earlier block from disk // the hassle and try to load an earlier block from disk
if (id < volume->ToBlock(volume->Log()) + volume->Log().Length() if (id < volume->ToBlock(volume->Log()) + volume->Log().Length()
|| id > volume->NumBlocks()) { || id > volume->NumBlocks()) {
INFORM(("inode at %Ld requested!\n", id)); INFORM(("inode at %" B_PRIdINO " requested!\n", id));
return B_ERROR; return B_ERROR;
} }
CachedBlock cached(volume, id); CachedBlock cached(volume, id);
bfs_inode* node = (bfs_inode*)cached.Block(); bfs_inode* node = (bfs_inode*)cached.Block();
if (node == NULL) { if (node == NULL) {
FATAL(("could not read inode: %Ld\n", id)); FATAL(("could not read inode: %" B_PRIdINO "\n", id));
return B_IO_ERROR; return B_IO_ERROR;
} }
status_t status = node->InitCheck(volume); status_t status = node->InitCheck(volume);
if (status != B_OK) { if (status != B_OK) {
if ((node->Flags() & INODE_DELETED) != 0) { if ((node->Flags() & INODE_DELETED) != 0) {
INFORM(("inode at %Ld is already deleted!\n", id)); INFORM(("inode at %" B_PRIdINO " is already deleted!\n", id));
} else { } else {
FATAL(("inode at %Ld could not be read: %s!\n", id, FATAL(("inode at %" B_PRIdINO " could not be read: %s!\n", id,
strerror(status))); strerror(status)));
} }
return status; return status;
@@ -1393,8 +1393,9 @@ bfs_free_cookie(fs_volume* _volume, fs_vnode* _node, void* _cookie)
if (needsTrimming) { if (needsTrimming) {
status = inode->TrimPreallocation(transaction); status = inode->TrimPreallocation(transaction);
if (status < B_OK) { if (status < B_OK) {
FATAL(("Could not trim preallocated blocks: inode %Ld, transaction %d: %s!\n", FATAL(("Could not trim preallocated blocks: inode %" B_PRIdINO
inode->ID(), (int)transaction.ID(), strerror(status))); ", transaction %d: %s!\n", inode->ID(),
(int)transaction.ID(), strerror(status)));
// we still want this transaction to succeed // we still want this transaction to succeed
status = B_OK; status = B_OK;
@@ -2244,8 +2245,8 @@ bfs_initialize(int fd, partition_id partitionID, const char* name,
INFORM(("Disk was initialized successfully.\n")); INFORM(("Disk was initialized successfully.\n"));
INFORM(("\tname: \"%s\"\n", super.name)); INFORM(("\tname: \"%s\"\n", super.name));
INFORM(("\tnum blocks: %Ld\n", super.NumBlocks())); INFORM(("\tnum blocks: %" B_PRIdOFF "\n", super.NumBlocks()));
INFORM(("\tused blocks: %Ld\n", super.UsedBlocks())); INFORM(("\tused blocks: %" B_PRIdOFF "\n", super.UsedBlocks()));
INFORM(("\tblock size: %u bytes\n", (unsigned)super.BlockSize())); INFORM(("\tblock size: %u bytes\n", (unsigned)super.BlockSize()));
INFORM(("\tnum allocation groups: %d\n", INFORM(("\tnum allocation groups: %d\n",
(int)super.AllocationGroups())); (int)super.AllocationGroups()));