* Prepared the BFS sources to be used with the new FS shell:
- Moved all inclusions of system headers into a new system_dependencies.h header, which conditionally either includes these or the FS shell headers. - Fixed compiler warnings related to printf-like functions (int32 is int, not long on non-BeOS platforms). * Build a new bfs_shell. Compiles and links, but does nothing ATM. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20860 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
a38a92c955
commit
c391f84b2c
|
@ -6,7 +6,6 @@
|
|||
|
||||
|
||||
#include "Attribute.h"
|
||||
#include <stdlib.h>
|
||||
|
||||
|
||||
// ToDo: clean this up, find a better separation between Inode and this class
|
||||
|
|
|
@ -13,14 +13,6 @@
|
|||
#include "Inode.h"
|
||||
#include "Utility.h"
|
||||
|
||||
#include <util/kernel_cpp.h>
|
||||
#include <util/Stack.h>
|
||||
#include <TypeConstants.h>
|
||||
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
#ifdef DEBUG
|
||||
class NodeChecker {
|
||||
|
@ -795,8 +787,8 @@ BPlusTree::InsertDuplicate(Transaction &transaction, CachedNode &cached,
|
|||
duplicate_array *array = duplicate->FragmentAt(bplustree_node::FragmentIndex(oldValue));
|
||||
if (array->count > NUM_FRAGMENT_VALUES
|
||||
|| array->count < 1) {
|
||||
FATAL(("insertDuplicate: Invalid array[%ld] size in fragment %Ld == %Ld!\n",
|
||||
bplustree_node::FragmentIndex(oldValue),
|
||||
FATAL(("insertDuplicate: Invalid array[%d] size in fragment %Ld == %Ld!\n",
|
||||
(int)bplustree_node::FragmentIndex(oldValue),
|
||||
bplustree_node::FragmentOffset(oldValue),
|
||||
array->count));
|
||||
return B_BAD_DATA;
|
||||
|
@ -1365,8 +1357,8 @@ BPlusTree::RemoveDuplicate(Transaction &transaction, const bplustree_node *node,
|
|||
|
||||
if (array->count > NUM_FRAGMENT_VALUES
|
||||
|| array->count < 1) {
|
||||
FATAL(("removeDuplicate: Invalid array[%ld] size in fragment %Ld == %Ld!\n",
|
||||
bplustree_node::FragmentIndex(oldValue), duplicateOffset, array->count));
|
||||
FATAL(("removeDuplicate: Invalid array[%d] size in fragment %Ld == %Ld!\n",
|
||||
(int)bplustree_node::FragmentIndex(oldValue), duplicateOffset, array->count));
|
||||
return B_BAD_DATA;
|
||||
}
|
||||
if (!array->Remove(value)) {
|
||||
|
@ -1549,8 +1541,8 @@ BPlusTree::RemoveKey(bplustree_node *node, uint16 index)
|
|||
uint8 *key = node->KeyAt(index, &length);
|
||||
if (key + length + sizeof(off_t) + sizeof(uint16) > (uint8 *)node + fNodeSize
|
||||
|| length > BPLUSTREE_MAX_KEY_LENGTH) {
|
||||
FATAL(("Key length to long: %s, %u (inode at %ld,%u)\n", key, length,
|
||||
fStream->BlockRun().allocation_group, fStream->BlockRun().start));
|
||||
FATAL(("Key length to long: %s, %u (inode at %d,%u)\n", key, length,
|
||||
(int)fStream->BlockRun().allocation_group, fStream->BlockRun().start));
|
||||
fStream->GetVolume()->Panic();
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -14,8 +14,6 @@
|
|||
#include "Journal.h"
|
||||
#include "Chain.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
|
||||
//****************** on-disk structures ********************
|
||||
|
||||
|
|
|
@ -12,9 +12,7 @@
|
|||
#include "BPlusTree.h"
|
||||
#include "bfs_control.h"
|
||||
|
||||
#include <util/Stack.h>
|
||||
#include <util/kernel_cpp.h>
|
||||
#include <stdlib.h>
|
||||
#include "system_dependencies.h"
|
||||
|
||||
#ifdef USER
|
||||
# define spawn_kernel_thread spawn_thread
|
||||
|
@ -161,7 +159,7 @@ AllocationBlock::Allocate(uint16 start, uint16 numBlocks)
|
|||
#endif
|
||||
|
||||
if (uint32(start + numBlocks) > fNumBits) {
|
||||
FATAL(("Allocation::Allocate(): tried to allocate too many blocks: %u (numBlocks = %lu)!\n", numBlocks, fNumBits));
|
||||
FATAL(("Allocation::Allocate(): tried to allocate too many blocks: %u (numBlocks = %u)!\n", numBlocks, (unsigned)fNumBits));
|
||||
DIE(("Allocation::Allocate(): tried to allocate too many blocks"));
|
||||
}
|
||||
|
||||
|
@ -195,7 +193,7 @@ AllocationBlock::Free(uint16 start, uint16 numBlocks)
|
|||
#endif
|
||||
|
||||
if (uint32(start + numBlocks) > fNumBits) {
|
||||
FATAL(("Allocation::Free(): tried to free too many blocks: %u (numBlocks = %lu)!\n", numBlocks, fNumBits));
|
||||
FATAL(("Allocation::Free(): tried to free too many blocks: %u (numBlocks = %u)!\n", numBlocks, (unsigned)fNumBits));
|
||||
DIE(("Allocation::Free(): tried to free too many blocks"));
|
||||
}
|
||||
|
||||
|
@ -736,13 +734,13 @@ BlockAllocator::Free(Transaction &transaction, block_run run)
|
|||
|| start > fGroups[group].NumBits()
|
||||
|| uint32(start + length) > fGroups[group].NumBits()
|
||||
|| length == 0) {
|
||||
FATAL(("tried to free an invalid block_run (%ld, %u, %u)\n", group, start, length));
|
||||
FATAL(("tried to free an invalid block_run (%d, %u, %u)\n", (int)group, start, length));
|
||||
DEBUGGER(("tried to free invalid block_run"));
|
||||
return B_BAD_VALUE;
|
||||
}
|
||||
// check if someone tries to free reserved areas at the beginning of the drive
|
||||
if (group == 0 && start < uint32(fVolume->Log().Start() + fVolume->Log().Length())) {
|
||||
FATAL(("tried to free a reserved block_run (%ld, %u, %u)\n", group, start, length));
|
||||
FATAL(("tried to free a reserved block_run (%d, %u, %u)\n", (int)group, start, length));
|
||||
DEBUGGER(("tried to free reserved block"));
|
||||
return B_BAD_VALUE;
|
||||
}
|
||||
|
@ -1161,8 +1159,8 @@ BlockAllocator::CheckBlockRun(block_run run, const char *type, check_control *co
|
|||
control->stats.already_set++;
|
||||
} else {
|
||||
if (firstSet != -1) {
|
||||
FATAL(("%s: block_run(%ld, %u, %u): blocks %Ld - %Ld are already set!\n",
|
||||
type, run.AllocationGroup(), run.Start(), run.Length(), firstSet, firstGroupBlock + offset - 1));
|
||||
FATAL(("%s: block_run(%d, %u, %u): blocks %Ld - %Ld are already set!\n",
|
||||
type, (int)run.AllocationGroup(), run.Start(), run.Length(), firstSet, firstGroupBlock + offset - 1));
|
||||
firstSet = -1;
|
||||
}
|
||||
_SetCheckBitmapAt(firstGroupBlock + offset);
|
||||
|
@ -1176,7 +1174,7 @@ BlockAllocator::CheckBlockRun(block_run run, const char *type, check_control *co
|
|||
if (firstMissing != -1)
|
||||
PRINT(("%s: block_run(%ld, %u, %u): blocks %Ld - %Ld are not allocated!\n", type, run.AllocationGroup(), run.Start(), run.Length(), firstMissing, firstGroupBlock + pos + block * bitsPerBlock - 1));
|
||||
if (firstSet != -1)
|
||||
FATAL(("%s: block_run(%ld, %u, %u): blocks %Ld - %Ld are already set!\n", type, run.AllocationGroup(), run.Start(), run.Length(), firstSet, firstGroupBlock + pos + block * bitsPerBlock - 1));
|
||||
FATAL(("%s: block_run(%d, %u, %u): blocks %Ld - %Ld are already set!\n", type, (int)run.AllocationGroup(), run.Start(), run.Length(), firstSet, firstGroupBlock + pos + block * bitsPerBlock - 1));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -7,14 +7,7 @@
|
|||
#define CACHED_BLOCK_H
|
||||
|
||||
|
||||
#include <KernelExport.h>
|
||||
#ifdef USER
|
||||
//# include "myfs.h"
|
||||
# include <stdio.h>
|
||||
#endif
|
||||
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include "system_dependencies.h"
|
||||
|
||||
#include "Volume.h"
|
||||
#include "Journal.h"
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
** This file may be used under the terms of the OpenBeOS License.
|
||||
*/
|
||||
|
||||
#include <null.h>
|
||||
#include "system_dependencies.h"
|
||||
|
||||
/** The Link class you want to use with the Chain class needs to have
|
||||
* a "fNext" member which is accessable from within the Chain class.
|
||||
|
|
|
@ -11,10 +11,6 @@
|
|||
#include "BPlusTree.h"
|
||||
#include "Inode.h"
|
||||
|
||||
#include <KernelExport.h>
|
||||
|
||||
#include <time.h>
|
||||
|
||||
#define Print __out
|
||||
|
||||
|
||||
|
@ -40,7 +36,7 @@ get_tupel(uint32 id)
|
|||
void
|
||||
dump_block_run(const char *prefix, const block_run &run)
|
||||
{
|
||||
Print("%s(%ld, %d, %d)\n", prefix, run.allocation_group, run.start, run.length);
|
||||
Print("%s(%d, %d, %d)\n", prefix, (int)run.allocation_group, run.start, run.length);
|
||||
}
|
||||
|
||||
|
||||
|
@ -49,22 +45,22 @@ dump_super_block(const disk_super_block *superBlock)
|
|||
{
|
||||
Print("disk_super_block:\n");
|
||||
Print(" name = %s\n", superBlock->name);
|
||||
Print(" magic1 = %#08lx (%s) %s\n", superBlock->magic1, get_tupel(superBlock->magic1), (superBlock->magic1 == SUPER_BLOCK_MAGIC1 ? "valid" : "INVALID"));
|
||||
Print(" fs_byte_order = %#08lx (%s)\n", superBlock->fs_byte_order, get_tupel(superBlock->fs_byte_order));
|
||||
Print(" block_size = %lu\n", superBlock->block_size);
|
||||
Print(" block_shift = %lu\n", superBlock->block_shift);
|
||||
Print(" magic1 = %#08x (%s) %s\n", (int)superBlock->magic1, get_tupel(superBlock->magic1), (superBlock->magic1 == SUPER_BLOCK_MAGIC1 ? "valid" : "INVALID"));
|
||||
Print(" fs_byte_order = %#08x (%s)\n", (int)superBlock->fs_byte_order, get_tupel(superBlock->fs_byte_order));
|
||||
Print(" block_size = %u\n", (unsigned)superBlock->block_size);
|
||||
Print(" block_shift = %u\n", (unsigned)superBlock->block_shift);
|
||||
Print(" num_blocks = %Lu\n", superBlock->num_blocks);
|
||||
Print(" used_blocks = %Lu\n", superBlock->used_blocks);
|
||||
Print(" inode_size = %lu\n", superBlock->inode_size);
|
||||
Print(" magic2 = %#08lx (%s) %s\n", superBlock->magic2, get_tupel(superBlock->magic2), (superBlock->magic2 == (int)SUPER_BLOCK_MAGIC2 ? "valid" : "INVALID"));
|
||||
Print(" blocks_per_ag = %lu\n", superBlock->blocks_per_ag);
|
||||
Print(" ag_shift = %lu (%ld bytes)\n", superBlock->ag_shift, 1L << superBlock->ag_shift);
|
||||
Print(" num_ags = %lu\n", superBlock->num_ags);
|
||||
Print(" flags = %#08lx (%s)\n", superBlock->flags, get_tupel(superBlock->flags));
|
||||
Print(" inode_size = %u\n", (unsigned)superBlock->inode_size);
|
||||
Print(" magic2 = %#08x (%s) %s\n", (int)superBlock->magic2, get_tupel(superBlock->magic2), (superBlock->magic2 == (int)SUPER_BLOCK_MAGIC2 ? "valid" : "INVALID"));
|
||||
Print(" blocks_per_ag = %u\n", (unsigned)superBlock->blocks_per_ag);
|
||||
Print(" ag_shift = %u (%ld bytes)\n", (unsigned)superBlock->ag_shift, 1L << superBlock->ag_shift);
|
||||
Print(" num_ags = %u\n", (unsigned)superBlock->num_ags);
|
||||
Print(" flags = %#08x (%s)\n", (int)superBlock->flags, get_tupel(superBlock->flags));
|
||||
dump_block_run(" log_blocks = ", superBlock->log_blocks);
|
||||
Print(" log_start = %Lu\n", superBlock->log_start);
|
||||
Print(" log_end = %Lu\n", superBlock->log_end);
|
||||
Print(" magic3 = %#08lx (%s) %s\n", superBlock->magic3, get_tupel(superBlock->magic3), (superBlock->magic3 == SUPER_BLOCK_MAGIC3 ? "valid" : "INVALID"));
|
||||
Print(" magic3 = %#08x (%s) %s\n", (int)superBlock->magic3, get_tupel(superBlock->magic3), (superBlock->magic3 == SUPER_BLOCK_MAGIC3 ? "valid" : "INVALID"));
|
||||
dump_block_run(" root_dir = ", superBlock->root_dir);
|
||||
dump_block_run(" indices = ", superBlock->indices);
|
||||
}
|
||||
|
@ -99,30 +95,30 @@ void
|
|||
dump_inode(const bfs_inode *inode)
|
||||
{
|
||||
Print("inode:\n");
|
||||
Print(" magic1 = %08lx (%s) %s\n", inode->magic1,
|
||||
Print(" magic1 = %08x (%s) %s\n", (int)inode->magic1,
|
||||
get_tupel(inode->magic1), (inode->magic1 == INODE_MAGIC1 ? "valid" : "INVALID"));
|
||||
dump_block_run( " inode_num = ", inode->inode_num);
|
||||
Print(" uid = %lu\n", inode->uid);
|
||||
Print(" gid = %lu\n", inode->gid);
|
||||
Print(" mode = %08lx\n", inode->mode);
|
||||
Print(" flags = %08lx\n", inode->flags);
|
||||
Print(" uid = %u\n", (unsigned)inode->uid);
|
||||
Print(" gid = %u\n", (unsigned)inode->gid);
|
||||
Print(" mode = %08x\n", (int)inode->mode);
|
||||
Print(" flags = %08x\n", (int)inode->flags);
|
||||
Print(" create_time = %Ld (%Ld)\n", inode->create_time,
|
||||
inode->create_time >> INODE_TIME_SHIFT);
|
||||
Print(" last_modified_time = %Ld (%Ld)\n", inode->last_modified_time,
|
||||
inode->last_modified_time >> INODE_TIME_SHIFT);
|
||||
dump_block_run( " parent = ", inode->parent);
|
||||
dump_block_run( " attributes = ", inode->attributes);
|
||||
Print(" type = %lu\n", inode->type);
|
||||
Print(" inode_size = %lu\n", inode->inode_size);
|
||||
Print(" etc = %#08lx\n", inode->etc);
|
||||
Print(" type = %u\n", (unsigned)inode->type);
|
||||
Print(" inode_size = %u\n", (unsigned)inode->inode_size);
|
||||
Print(" etc = %#08x\n", (int)inode->etc);
|
||||
Print(" short_symlink = %s\n",
|
||||
S_ISLNK(inode->mode) && (inode->flags & INODE_LONG_SYMLINK) == 0 ?
|
||||
inode->short_symlink : "-");
|
||||
dump_data_stream(&(inode->data));
|
||||
Print(" --\n pad[0] = %08lx\n", inode->pad[0]);
|
||||
Print(" pad[1] = %08lx\n", inode->pad[1]);
|
||||
Print(" pad[2] = %08lx\n", inode->pad[2]);
|
||||
Print(" pad[3] = %08lx\n", inode->pad[3]);
|
||||
Print(" --\n pad[0] = %08x\n", (int)inode->pad[0]);
|
||||
Print(" pad[1] = %08x\n", (int)inode->pad[1]);
|
||||
Print(" pad[2] = %08x\n", (int)inode->pad[2]);
|
||||
Print(" pad[3] = %08x\n", (int)inode->pad[3]);
|
||||
}
|
||||
|
||||
|
||||
|
@ -130,11 +126,11 @@ void
|
|||
dump_bplustree_header(const bplustree_header *header)
|
||||
{
|
||||
Print("bplustree_header:\n");
|
||||
Print(" magic = %#08lx (%s) %s\n", header->magic,
|
||||
Print(" magic = %#08x (%s) %s\n", (int)header->magic,
|
||||
get_tupel(header->magic), (header->magic == BPLUSTREE_MAGIC ? "valid" : "INVALID"));
|
||||
Print(" node_size = %lu\n", header->node_size);
|
||||
Print(" max_number_of_levels = %lu\n", header->max_number_of_levels);
|
||||
Print(" data_type = %lu\n", header->data_type);
|
||||
Print(" node_size = %u\n", (unsigned)header->node_size);
|
||||
Print(" max_number_of_levels = %u\n", (unsigned)header->max_number_of_levels);
|
||||
Print(" data_type = %u\n", (unsigned)header->data_type);
|
||||
Print(" root_node_pointer = %Ld\n", header->root_node_pointer);
|
||||
Print(" free_node_pointer = %Ld\n", header->free_node_pointer);
|
||||
Print(" maximum_size = %Lu\n", header->maximum_size);
|
||||
|
@ -203,7 +199,7 @@ dump_bplustree_node(const bplustree_node *node, const bplustree_header *header,
|
|||
uint16 length;
|
||||
char buffer[256], *key = (char *)node->KeyAt(i, &length);
|
||||
if (length > 255 || length == 0) {
|
||||
Print(" %2ld. Invalid length (%u)!!\n", i, length);
|
||||
Print(" %2d. Invalid length (%u)!!\n", (int)i, length);
|
||||
dump_block((char *)node, header->node_size/*, sizeof(off_t)*/);
|
||||
break;
|
||||
}
|
||||
|
@ -212,15 +208,15 @@ dump_bplustree_node(const bplustree_node *node, const bplustree_header *header,
|
|||
|
||||
off_t *value = node->Values() + i;
|
||||
if ((uint32)value < (uint32)node || (uint32)value > (uint32)node + header->node_size)
|
||||
Print(" %2ld. Invalid Offset!!\n", i);
|
||||
Print(" %2d. Invalid Offset!!\n", (int)i);
|
||||
else {
|
||||
Print(" %2ld. ", i);
|
||||
Print(" %2d. ", (int)i);
|
||||
if (header->data_type == BPLUSTREE_STRING_TYPE)
|
||||
Print("\"%s\"", buffer);
|
||||
else if (header->data_type == BPLUSTREE_INT32_TYPE)
|
||||
Print("int32 = %ld (0x%lx)", *(int32 *)&buffer, *(int32 *)&buffer);
|
||||
Print("int32 = %d (0x%x)", (int)*(int32 *)&buffer, (int)*(int32 *)&buffer);
|
||||
else if (header->data_type == BPLUSTREE_UINT32_TYPE)
|
||||
Print("uint32 = %lu (0x%lx)", *(uint32 *)&buffer, *(uint32 *)&buffer);
|
||||
Print("uint32 = %u (0x%x)", (unsigned)*(uint32 *)&buffer, (unsigned)*(uint32 *)&buffer);
|
||||
else if (header->data_type == BPLUSTREE_INT64_TYPE)
|
||||
Print("int64 = %Ld (0x%Lx)", *(int64 *)&buffer, *(int64 *)&buffer);
|
||||
else
|
||||
|
@ -230,7 +226,7 @@ dump_bplustree_node(const bplustree_node *node, const bplustree_header *header,
|
|||
Print(" (%d bytes) -> %Ld", length, offset);
|
||||
if (volume != NULL) {
|
||||
block_run run = volume->ToBlockRun(offset);
|
||||
Print(" (%ld, %d)", run.allocation_group, run.start);
|
||||
Print(" (%d, %d)", (int)run.allocation_group, run.start);
|
||||
}
|
||||
if (bplustree_node::LinkType(*value) == BPLUSTREE_DUPLICATE_FRAGMENT)
|
||||
Print(" (duplicate fragment %Ld)\n", *value & 0x3ff);
|
||||
|
|
|
@ -7,17 +7,11 @@
|
|||
#define DEBUG_H
|
||||
|
||||
|
||||
#include <KernelExport.h>
|
||||
|
||||
#ifdef DEBUG
|
||||
# include <string.h>
|
||||
#endif
|
||||
#include "system_dependencies.h"
|
||||
|
||||
#ifdef USER
|
||||
# include <stdio.h>
|
||||
# define __out printf
|
||||
#else
|
||||
# include <null.h>
|
||||
# define __out dprintf
|
||||
#endif
|
||||
|
||||
|
|
|
@ -12,8 +12,6 @@
|
|||
#include "Inode.h"
|
||||
#include "BPlusTree.h"
|
||||
|
||||
#include <util/kernel_cpp.h>
|
||||
#include <TypeConstants.h>
|
||||
|
||||
// B_MIME_STRING_TYPE is defined in storage/Mime.h, but we
|
||||
// don't need the whole file here; the type can't change anyway
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
#define INDEX_H
|
||||
|
||||
|
||||
#include <KernelExport.h>
|
||||
#include "system_dependencies.h"
|
||||
|
||||
class Transaction;
|
||||
class Volume;
|
||||
|
|
|
@ -11,12 +11,6 @@
|
|||
#include "BPlusTree.h"
|
||||
#include "Index.h"
|
||||
|
||||
#include <fs_cache.h>
|
||||
#include <util/kernel_cpp.h>
|
||||
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
class InodeAllocator {
|
||||
public:
|
||||
|
@ -183,8 +177,8 @@ Inode::Inode(Volume *volume, vnode_id id)
|
|||
memcpy(&fNode, node.Node(), sizeof(bfs_inode));
|
||||
|
||||
char lockName[B_OS_NAME_LENGTH];
|
||||
snprintf(lockName, sizeof(lockName), "bfs inode %ld.%d",
|
||||
BlockRun().AllocationGroup(), BlockRun().Start());
|
||||
snprintf(lockName, sizeof(lockName), "bfs inode %d.%d",
|
||||
(int)BlockRun().AllocationGroup(), BlockRun().Start());
|
||||
fLock.Initialize(lockName);
|
||||
|
||||
// these two will help to maintain the indices
|
||||
|
@ -210,8 +204,8 @@ Inode::Inode(Volume *volume, Transaction &transaction, vnode_id id, mode_t mode,
|
|||
volume, &transaction, id, this));
|
||||
|
||||
char lockName[B_OS_NAME_LENGTH];
|
||||
snprintf(lockName, sizeof(lockName), "bfs inode+%ld.%d",
|
||||
run.AllocationGroup(), run.Start());
|
||||
snprintf(lockName, sizeof(lockName), "bfs inode+%d.%d",
|
||||
(int)run.AllocationGroup(), run.Start());
|
||||
fLock.Initialize(lockName);
|
||||
|
||||
NodeGetter node(volume, transaction, this, true);
|
||||
|
|
|
@ -6,19 +6,12 @@
|
|||
#define INODE_H
|
||||
|
||||
|
||||
#include <KernelExport.h>
|
||||
#ifdef USER
|
||||
//# include "myfs.h"
|
||||
# include <stdio.h>
|
||||
#endif
|
||||
#include "system_dependencies.h"
|
||||
|
||||
#ifndef _IMPEXP_KERNEL
|
||||
# define _IMPEXP_KERNEL
|
||||
#endif
|
||||
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "Volume.h"
|
||||
#include "Journal.h"
|
||||
#include "Lock.h"
|
||||
|
|
|
@ -9,11 +9,6 @@
|
|||
#include "Inode.h"
|
||||
#include "Debug.h"
|
||||
|
||||
#include <Drivers.h>
|
||||
#include <util/kernel_cpp.h>
|
||||
#include <util/Stack.h>
|
||||
#include <errno.h>
|
||||
|
||||
|
||||
struct run_array {
|
||||
int32 count;
|
||||
|
@ -337,8 +332,8 @@ Journal::_CheckRunArray(const run_array *array)
|
|||
if (array->MaxRuns() != maxRuns
|
||||
|| array->CountRuns() > maxRuns
|
||||
|| array->CountRuns() <= 0) {
|
||||
dprintf("run count: %ld, array max: %ld, max runs: %ld\n",
|
||||
array->CountRuns(), array->MaxRuns(), maxRuns);
|
||||
dprintf("run count: %d, array max: %d, max runs: %d\n",
|
||||
(int)array->CountRuns(), (int)array->MaxRuns(), (int)maxRuns);
|
||||
FATAL(("Log entry has broken header!\n"));
|
||||
return B_ERROR;
|
||||
}
|
||||
|
@ -433,7 +428,7 @@ Journal::ReplayLog()
|
|||
|
||||
status_t status = _ReplayRunArray(&start);
|
||||
if (status < B_OK) {
|
||||
FATAL(("replaying log entry from %ld failed: %s\n", start, strerror(status)));
|
||||
FATAL(("replaying log entry from %d failed: %s\n", (int)start, strerror(status)));
|
||||
return B_ERROR;
|
||||
}
|
||||
start = start % fLogSize;
|
||||
|
|
|
@ -7,13 +7,7 @@
|
|||
#define JOURNAL_H
|
||||
|
||||
|
||||
#include <KernelExport.h>
|
||||
#include <util/DoublyLinkedList.h>
|
||||
|
||||
#ifdef USER
|
||||
//# include "myfs.h"
|
||||
# include <stdio.h>
|
||||
#endif
|
||||
#include "system_dependencies.h"
|
||||
|
||||
#ifndef _IMPEXP_KERNEL
|
||||
# define _IMPEXP_KERNEL
|
||||
|
|
|
@ -7,9 +7,8 @@
|
|||
#ifndef LOCK_H
|
||||
#define LOCK_H
|
||||
|
||||
#include "system_dependencies.h"
|
||||
|
||||
#include <KernelExport.h>
|
||||
#include <stdio.h>
|
||||
#include "Utility.h"
|
||||
#include "Debug.h"
|
||||
|
||||
|
@ -165,7 +164,7 @@ class RecursiveLock {
|
|||
{
|
||||
thread_id thread = find_thread(NULL);
|
||||
if (thread != fOwner) {
|
||||
panic("RecursiveLock unlocked by %ld, owned by %ld\n", thread, fOwner);
|
||||
panic("RecursiveLock unlocked by %d, owned by %d\n", (int)thread, (int)fOwner);
|
||||
}
|
||||
|
||||
if (--fOwnerCount == 0) {
|
||||
|
|
|
@ -17,17 +17,6 @@
|
|||
#include "BPlusTree.h"
|
||||
#include "Index.h"
|
||||
|
||||
#include <util/kernel_cpp.h>
|
||||
#include <SupportDefs.h>
|
||||
#include <NodeMonitor.h>
|
||||
#include <TypeConstants.h>
|
||||
#include <AppDefs.h>
|
||||
#include <fs_query.h>
|
||||
|
||||
#include <malloc.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
|
||||
// The parser has a very static design, but it will do what is required.
|
||||
//
|
||||
|
@ -698,7 +687,7 @@ Equation::ConvertValue(type_code type)
|
|||
fSize = sizeof(double);
|
||||
break;
|
||||
default:
|
||||
FATAL(("query value conversion to 0x%lx requested!\n", type));
|
||||
FATAL(("query value conversion to 0x%x requested!\n", (int)type));
|
||||
// should we fail here or just do a safety int32 conversion?
|
||||
return B_ERROR;
|
||||
}
|
||||
|
|
|
@ -6,13 +6,11 @@
|
|||
#ifndef QUERY_H
|
||||
#define QUERY_H
|
||||
|
||||
#include "system_dependencies.h"
|
||||
|
||||
#include "Chain.h"
|
||||
#include "Index.h"
|
||||
|
||||
#include <util/Stack.h>
|
||||
#include <SupportDefs.h>
|
||||
|
||||
class Volume;
|
||||
class Term;
|
||||
class Equation;
|
||||
|
|
|
@ -8,11 +8,6 @@
|
|||
#include "Utility.h"
|
||||
#include "Debug.h"
|
||||
|
||||
#include <util/kernel_cpp.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
|
||||
bool
|
||||
sorted_array::FindInternal(off_t value, int32 &index) const
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
#define UTILITY_H
|
||||
|
||||
|
||||
#include <SupportDefs.h>
|
||||
#include "system_dependencies.h"
|
||||
|
||||
|
||||
// Simple array, used for the duplicate handling in the B+Tree,
|
||||
|
|
|
@ -11,17 +11,6 @@
|
|||
#include "Inode.h"
|
||||
#include "Query.h"
|
||||
|
||||
#include <util/kernel_cpp.h>
|
||||
#include <KernelExport.h>
|
||||
#include <Drivers.h>
|
||||
#include <fs_volume.h>
|
||||
|
||||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
|
||||
static const int32 kDesiredAllocationGroups = 56;
|
||||
// This is the number of allocation groups that will be tried
|
||||
|
@ -444,7 +433,7 @@ Volume::ValidateBlockRun(block_run run)
|
|||
|| run.length == 0
|
||||
|| uint32(run.Length() + run.Start()) > (1UL << AllocationGroupShift())) {
|
||||
Panic();
|
||||
FATAL(("*** invalid run(%ld,%d,%d)\n", run.AllocationGroup(), run.Start(), run.Length()));
|
||||
FATAL(("*** invalid run(%d,%d,%d)\n", (int)run.AllocationGroup(), run.Start(), run.Length()));
|
||||
return B_BAD_DATA;
|
||||
}
|
||||
return B_OK;
|
||||
|
|
|
@ -7,9 +7,7 @@
|
|||
#define VOLUME_H
|
||||
|
||||
|
||||
#include <KernelExport.h>
|
||||
#include <fs_interface.h>
|
||||
#include <fs_cache.h>
|
||||
#include "system_dependencies.h"
|
||||
|
||||
#include "bfs.h"
|
||||
#include "BlockAllocator.h"
|
||||
|
|
|
@ -9,15 +9,10 @@
|
|||
#define BFS_H
|
||||
|
||||
|
||||
#include <SupportDefs.h>
|
||||
|
||||
#include "bfs_endian.h"
|
||||
#include "system_dependencies.h"
|
||||
|
||||
|
||||
#ifndef B_BEOS_VERSION_DANO
|
||||
# define B_BAD_DATA B_ERROR
|
||||
#endif
|
||||
|
||||
// ToDo: temporary fix! (missing but public ioctls)
|
||||
#define IOCTL_FILE_UNCACHED_IO 10000
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
*/
|
||||
|
||||
|
||||
#include <fs_interface.h>
|
||||
#include "system_dependencies.h"
|
||||
|
||||
|
||||
/* ioctl to check the version of BFS used - parameter is a uint32 *
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#define BFS_ENDIAN_H
|
||||
|
||||
|
||||
#include <ByteOrder.h>
|
||||
#include "system_dependencies.h"
|
||||
|
||||
|
||||
#if !defined(BFS_LITTLE_ENDIAN_ONLY) && !defined(BFS_BIG_ENDIAN_ONLY)
|
||||
|
|
|
@ -14,21 +14,6 @@
|
|||
#include "Attribute.h"
|
||||
#include "bfs_control.h"
|
||||
|
||||
#include <util/kernel_cpp.h>
|
||||
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include <KernelExport.h>
|
||||
#include <NodeMonitor.h>
|
||||
#include <fs_interface.h>
|
||||
#include <fs_cache.h>
|
||||
|
||||
#include <fs_attr.h>
|
||||
#include <fs_info.h>
|
||||
#include <fs_index.h>
|
||||
#include <fs_query.h>
|
||||
#include <fs_volume.h>
|
||||
|
||||
#define BFS_IO_SIZE 65536
|
||||
|
||||
|
@ -1265,8 +1250,8 @@ bfs_free_cookie(void *_ns, void *_node, void *_cookie)
|
|||
if (needsTrimming) {
|
||||
status = inode->TrimPreallocation(transaction);
|
||||
if (status < B_OK) {
|
||||
FATAL(("Could not trim preallocated blocks: inode %Ld, transaction %ld: %s!\n",
|
||||
inode->ID(), transaction.ID(), strerror(status)));
|
||||
FATAL(("Could not trim preallocated blocks: inode %Ld, transaction %d: %s!\n",
|
||||
inode->ID(), (int)transaction.ID(), strerror(status)));
|
||||
|
||||
// we still want this transaction to succeed
|
||||
status = B_OK;
|
||||
|
|
|
@ -0,0 +1,46 @@
|
|||
/*
|
||||
* Copyright 2007, Ingo Weinhold, bonefish@cs.tu-berlin.de.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
|
||||
#ifndef _SYSTEM_DEPENDENCIES_H
|
||||
#define _SYSTEM_DEPENDENCIES_H
|
||||
|
||||
|
||||
#ifdef BFS_SHELL
|
||||
|
||||
#include "fssh_api_wrapper.h"
|
||||
|
||||
#else // !BFS_SHELL
|
||||
|
||||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
#include <null.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <fs_attr.h>
|
||||
#include <fs_cache.h>
|
||||
#include <fs_index.h>
|
||||
#include <fs_info.h>
|
||||
#include <fs_interface.h>
|
||||
#include <fs_query.h>
|
||||
#include <fs_volume.h>
|
||||
#include <ByteOrder.h>
|
||||
#include <Drivers.h>
|
||||
#include <KernelExport.h>
|
||||
#include <NodeMonitor.h>
|
||||
#include <SupportDefs.h>
|
||||
#include <TypeConstants.h>
|
||||
|
||||
#include <util/DoublyLinkedList.h>
|
||||
#include <util/kernel_cpp.h>
|
||||
#include <util/Stack.h>
|
||||
|
||||
#endif // !BFS_SHELL
|
||||
|
||||
|
||||
#endif // _SYSTEM_DEPENDENCIES_H
|
|
@ -59,6 +59,7 @@ SEARCH on [ FGristFiles
|
|||
UpdateMimeInfoThread.cpp MimeUpdateThread.cpp database_support.cpp
|
||||
] = [ FDirName $(HAIKU_TOP) src build libbe storage mime ] ;
|
||||
|
||||
SubInclude HAIKU_TOP src tools bfs_shell ;
|
||||
SubInclude HAIKU_TOP src tools copy_to_bfs_image ;
|
||||
SubInclude HAIKU_TOP src tools cppunit ;
|
||||
SubInclude HAIKU_TOP src tools docbook ;
|
||||
|
|
|
@ -0,0 +1,40 @@
|
|||
SubDir HAIKU_TOP src tools bfs_shell ;
|
||||
|
||||
SEARCH_SOURCE += [ FDirName $(HAIKU_TOP) src add-ons kernel file_systems bfs ] ;
|
||||
|
||||
# set some additional defines
|
||||
{
|
||||
local defines =
|
||||
#BFS_BIG_ENDIAN_ONLY
|
||||
BFS_SHELL
|
||||
;
|
||||
|
||||
if $(DEBUG) = 0 {
|
||||
# the gcc on BeOS doesn't compile BFS correctly with -O2 or more
|
||||
OPTIM = -O1 ;
|
||||
}
|
||||
|
||||
defines = [ FDefines $(defines) ] ;
|
||||
SubDirCcFlags $(defines) -Wall -Wno-multichar ;
|
||||
SubDirC++Flags $(defines) -Wall -Wno-multichar -fno-rtti ;
|
||||
}
|
||||
|
||||
UsePrivateHeaders fs_shell ;
|
||||
|
||||
BuildPlatformMain <build2>bfs_shell
|
||||
:
|
||||
BlockAllocator.cpp
|
||||
BPlusTree.cpp
|
||||
Attribute.cpp
|
||||
Debug.cpp
|
||||
Index.cpp
|
||||
Inode.cpp
|
||||
Journal.cpp
|
||||
Query.cpp
|
||||
Utility.cpp
|
||||
Volume.cpp
|
||||
|
||||
kernel_interface.cpp
|
||||
|
||||
: <build2>fs_shell.a $(HOST_LIBSUPC++) $(HOST_LIBROOT)
|
||||
;
|
Loading…
Reference in New Issue