UserlandFS: Make 64 bit clean and enable build for x86_64.
I did not bother to fix the BeOS kernel emulation, so this part is still left out of the x86_64 build.
This commit is contained in:
@@ -7,7 +7,7 @@ local packages = [ FFilterByBuildFeatures
|
||||
HaikuWelcome
|
||||
MakefileEngine
|
||||
NetFS@!x86_64
|
||||
UserlandFS@!x86_64
|
||||
UserlandFS
|
||||
]
|
||||
;
|
||||
|
||||
|
||||
@@ -11,11 +11,13 @@ AddFilesToPackage servers : userlandfs_server ;
|
||||
|
||||
|
||||
# libs
|
||||
local userlandfsLibs =
|
||||
libuserlandfs_beos_kernel.so
|
||||
local userlandfsLibs = [ FFilterByBuildFeatures
|
||||
libuserlandfs_beos_kernel.so@!x86_64
|
||||
libuserlandfs_haiku_kernel.so
|
||||
libuserlandfs_fuse.so
|
||||
;
|
||||
]
|
||||
;
|
||||
|
||||
AddLibrariesToPackage lib : $(userlandfsLibs) ;
|
||||
|
||||
# TODO move development stuff to a separate package?
|
||||
|
||||
@@ -16,7 +16,7 @@ local packages = [ FFilterByBuildFeatures
|
||||
haiku_welcome
|
||||
makefile_engine
|
||||
netfs@!x86_64
|
||||
userland_fs@!x86_64
|
||||
userland_fs
|
||||
|
||||
haiku_$(secondaryArchs)
|
||||
haiku_$(secondaryArchs)_devel
|
||||
|
||||
@@ -303,6 +303,44 @@ struct HashKey64 {
|
||||
};
|
||||
|
||||
|
||||
// HashKeyPointer
|
||||
template<typename Value>
|
||||
struct HashKeyPointer {
|
||||
HashKeyPointer() {}
|
||||
HashKeyPointer(const Value& value) : value(value) {}
|
||||
|
||||
uint32 GetHashCode() const
|
||||
{
|
||||
#if __HAIKU_ARCH_BITS == 32
|
||||
return (uint32)(addr_t)value;
|
||||
#elif __HAIKU_ARCH_BITS == 64
|
||||
uint64 v = (uint64)(addr_t)value;
|
||||
return (uint32)(v >> 32) ^ (uint32)v;
|
||||
#else
|
||||
#error unknown bitness
|
||||
#endif
|
||||
}
|
||||
|
||||
HashKeyPointer<Value> operator=(const HashKeyPointer<Value>& other)
|
||||
{
|
||||
value = other.value;
|
||||
return *this;
|
||||
}
|
||||
|
||||
bool operator==(const HashKeyPointer<Value>& other) const
|
||||
{
|
||||
return (value == other.value);
|
||||
}
|
||||
|
||||
bool operator!=(const HashKeyPointer<Value>& other) const
|
||||
{
|
||||
return (value != other.value);
|
||||
}
|
||||
|
||||
Value value;
|
||||
};
|
||||
|
||||
|
||||
// HashMap
|
||||
|
||||
// constructor
|
||||
|
||||
@@ -35,7 +35,7 @@ static const bigtime_t kNotificationRequestTimeout = 50000; // 50 ms
|
||||
|
||||
|
||||
struct FileSystem::SelectSyncMap
|
||||
: public SynchronizedHashMap<HashKey32<selectsync*>, int32*> {
|
||||
: public SynchronizedHashMap<HashKeyPointer<selectsync*>, int32*> {
|
||||
};
|
||||
|
||||
|
||||
@@ -221,7 +221,7 @@ FileSystem::~FileSystem()
|
||||
ops = next;
|
||||
}
|
||||
if (count > 0)
|
||||
WARN(("Deleted %ld vnode ops vectors!\n", count));
|
||||
WARN(("Deleted %" B_PRId32 " vnode ops vectors!\n", count));
|
||||
|
||||
|
||||
mutex_destroy(&fVolumeLock);
|
||||
|
||||
@@ -81,7 +81,7 @@ public:
|
||||
RequestPortPool* GetPortPool();
|
||||
|
||||
status_t Mount(fs_volume* fsVolume, const char* device,
|
||||
ulong flags, const char* parameters,
|
||||
uint32 flags, const char* parameters,
|
||||
Volume** volume);
|
||||
// status_t Initialize(const char* deviceName,
|
||||
// const char* parameters, size_t len);
|
||||
|
||||
@@ -63,7 +63,7 @@ FileSystemInitializer::FirstTimeInit()
|
||||
|
||||
// prepare the command line arguments
|
||||
char portID[16];
|
||||
snprintf(portID, sizeof(portID), "%ld", port);
|
||||
snprintf(portID, sizeof(portID), "%" B_PRId32, port);
|
||||
|
||||
const char* args[4] = {
|
||||
"/system/servers/userlandfs_server",
|
||||
|
||||
@@ -33,7 +33,8 @@ KernelDebug::DebugUFS(int argc, char** argv)
|
||||
int32 volumeCount = fs->fVolumes.Count();
|
||||
for (int32 i = 0; i < volumeCount; i++) {
|
||||
Volume* volume = fs->fVolumes.ElementAt(i);
|
||||
kprintf(" volume %p: %ld\n", volume, volume->GetID());
|
||||
kprintf(" volume %p: %" B_PRId32 "\n", volume,
|
||||
volume->GetID());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -55,8 +56,9 @@ KernelDebug::DebugPortPool(int argc, char** argv)
|
||||
}
|
||||
kprintf("used ports:\n");
|
||||
for (int32 i = portPool->fFreePorts; i < portPool->fPortCount; i++) {
|
||||
kprintf(" port %p, owner: %ld, count: %ld\n", portPool->fPorts[i].port,
|
||||
portPool->fPorts[i].owner, portPool->fPorts[i].count);
|
||||
kprintf(" port %p, owner: %" B_PRId32 ", count: %" B_PRId32 "\n",
|
||||
portPool->fPorts[i].port, portPool->fPorts[i].owner,
|
||||
portPool->fPorts[i].count);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -71,12 +73,12 @@ KernelDebug::DebugPort(int argc, char** argv)
|
||||
}
|
||||
RequestPort *port = (RequestPort*)parse_expression(argv[1]);
|
||||
kprintf("port %p:\n", port);
|
||||
kprintf(" status : %lx\n", port->fPort.fInitStatus);
|
||||
kprintf(" status : %" B_PRIx32 "\n", port->fPort.fInitStatus);
|
||||
kprintf(" is owner : %d\n", port->fPort.fOwner);
|
||||
kprintf(" owner port: %ld\n", port->fPort.fInfo.owner_port);
|
||||
kprintf(" client port: %ld\n", port->fPort.fInfo.client_port);
|
||||
kprintf(" size: %ld\n", port->fPort.fInfo.size);
|
||||
kprintf(" capacity: %ld\n", port->fPort.fCapacity);
|
||||
kprintf(" owner port: %" B_PRId32 "\n", port->fPort.fInfo.owner_port);
|
||||
kprintf(" client port: %" B_PRId32 "\n", port->fPort.fInfo.client_port);
|
||||
kprintf(" size: %" B_PRId32 "\n", port->fPort.fInfo.size);
|
||||
kprintf(" capacity: %" B_PRId32 "\n", port->fPort.fCapacity);
|
||||
kprintf(" buffer: %p\n", port->fPort.fBuffer);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -167,8 +167,8 @@ KernelRequestHandler::_HandleRequest(NotifyListenerRequest* request)
|
||||
case B_ENTRY_REMOVED:
|
||||
case B_ATTR_CHANGED:
|
||||
if (!name) {
|
||||
ERROR(("NotifyListenerRequest: NULL name for opcode: %ld\n",
|
||||
request->operation));
|
||||
ERROR(("NotifyListenerRequest: NULL name for opcode: %"
|
||||
B_PRId32 "\n", request->operation));
|
||||
result = B_BAD_VALUE;
|
||||
}
|
||||
break;
|
||||
@@ -181,22 +181,25 @@ KernelRequestHandler::_HandleRequest(NotifyListenerRequest* request)
|
||||
if (result == B_OK) {
|
||||
switch (request->operation) {
|
||||
case B_ENTRY_CREATED:
|
||||
PRINT(("notify_entry_created(%ld, %lld, \"%s\", %lld)\n",
|
||||
request->device, request->directory, name, request->node));
|
||||
PRINT(("notify_entry_created(%" B_PRId32 ", %" B_PRId64 ", "
|
||||
\"%s\", %" B_PRId64 ")\n", request->device,
|
||||
request->directory, name, request->node));
|
||||
result = notify_entry_created(request->device,
|
||||
request->directory, name, request->node);
|
||||
break;
|
||||
|
||||
case B_ENTRY_REMOVED:
|
||||
PRINT(("notify_entry_removed(%ld, %lld, \"%s\", %lld)\n",
|
||||
request->device, request->directory, name, request->node));
|
||||
PRINT(("notify_entry_removed(%" B_PRId32 ", %" B_PRId64 ", "
|
||||
\"%s\", %" B_PRId64 ")\n", request->device,
|
||||
request->directory, name, request->node));
|
||||
result = notify_entry_removed(request->device,
|
||||
request->directory, name, request->node);
|
||||
break;
|
||||
|
||||
case B_ENTRY_MOVED:
|
||||
PRINT(("notify_entry_moved(%ld, %lld, \"%s\", %lld, \"%s\", "
|
||||
"%lld)\n", request->device, request->oldDirectory, oldName,
|
||||
PRINT(("notify_entry_moved(%" B_PRId32 ", %" B_PRId64 ", "
|
||||
"\"%s\", %" B_PRId64 ", \"%s\", %" B_PRId64 ")\n",
|
||||
request->device, request->oldDirectory, oldName,
|
||||
request->directory, name, request->node));
|
||||
result = notify_entry_moved(request->device,
|
||||
request->oldDirectory, oldName, request->directory, name,
|
||||
@@ -204,23 +207,24 @@ KernelRequestHandler::_HandleRequest(NotifyListenerRequest* request)
|
||||
break;
|
||||
|
||||
case B_STAT_CHANGED:
|
||||
PRINT(("notify_stat_changed(%ld, %lld, 0x%lx)\n",
|
||||
request->device, request->node, request->details));
|
||||
PRINT(("notify_stat_changed(%" B_PRId32 ", %" B_PRId64 ", "
|
||||
"0x%" B_PRIx32 ")\n", request->device, request->node,
|
||||
request->details));
|
||||
result = notify_stat_changed(request->device, request->node,
|
||||
request->details);
|
||||
break;
|
||||
|
||||
case B_ATTR_CHANGED:
|
||||
PRINT(("notify_attribute_changed(%ld, %lld, \"%s\", 0x%lx)\n",
|
||||
request->device, request->node, name,
|
||||
(int32)request->details));
|
||||
PRINT(("notify_attribute_changed(%" B_PRId32 ", %" B_PRId64 ", "
|
||||
"\"%s\", 0x%" B_PRIx32 ")\n", request->device,
|
||||
request->node, name, (int32)request->details));
|
||||
result = notify_attribute_changed(request->device,
|
||||
request->node, name, (int32)request->details);
|
||||
break;
|
||||
|
||||
default:
|
||||
ERROR(("NotifyQueryRequest: unsupported operation: %ld\n",
|
||||
request->operation));
|
||||
ERROR(("NotifyQueryRequest: unsupported operation: %" B_PRId32
|
||||
"\n", request->operation));
|
||||
result = B_BAD_VALUE;
|
||||
break;
|
||||
}
|
||||
@@ -295,18 +299,20 @@ KernelRequestHandler::_HandleRequest(NotifyQueryRequest* request)
|
||||
if (result == B_OK) {
|
||||
switch (request->operation) {
|
||||
case B_ENTRY_CREATED:
|
||||
PRINT(("notify_query_entry_created(%ld, %ld, %ld, %lld,"
|
||||
" \"%s\", %lld)\n", request->port, request->token,
|
||||
request->device, request->directory, name, request->node));
|
||||
PRINT(("notify_query_entry_created(%" B_PRId32 ", %" B_PRId32
|
||||
", %" B_PRId32 ", %" B_PRId64 ", \"%s\", %" B_PRId64 ")\n",
|
||||
request->port, request->token, request->device,
|
||||
request->directory, name, request->node));
|
||||
result = notify_query_entry_created(request->port,
|
||||
request->token, request->device, request->directory, name,
|
||||
request->node);
|
||||
break;
|
||||
|
||||
case B_ENTRY_REMOVED:
|
||||
PRINT(("notify_query_entry_removed(%ld, %ld, %ld, %lld,"
|
||||
" \"%s\", %lld)\n", request->port, request->token,
|
||||
request->device, request->directory, name, request->node));
|
||||
PRINT(("notify_query_entry_removed(%" B_PRId32 ", %" B_PRId32
|
||||
", %" B_PRId32 ", %" B_PRId64 ", \"%s\", %" B_PRId64 ")\n",
|
||||
request->port, request->token, request->device,
|
||||
request->directory, name, request->node));
|
||||
result = notify_query_entry_removed(request->port,
|
||||
request->token, request->device, request->directory, name,
|
||||
request->node);
|
||||
@@ -314,8 +320,8 @@ KernelRequestHandler::_HandleRequest(NotifyQueryRequest* request)
|
||||
|
||||
case B_ENTRY_MOVED:
|
||||
default:
|
||||
ERROR(("NotifyQueryRequest: unsupported operation: %ld\n",
|
||||
request->operation));
|
||||
ERROR(("NotifyQueryRequest: unsupported operation: %" B_PRId32
|
||||
"\n", request->operation));
|
||||
result = B_BAD_VALUE;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ protected: // should be private, but gcc 2.95.3 issues a warning
|
||||
{
|
||||
if (fileCache != NULL)
|
||||
{
|
||||
ERROR(("VNode %lld still has a file cache!\n", id));
|
||||
ERROR(("VNode %" B_PRId64 " still has a file cache!\n", id));
|
||||
file_cache_delete(fileCache);
|
||||
}
|
||||
}
|
||||
@@ -334,7 +334,7 @@ Volume::~Volume()
|
||||
status_t
|
||||
Volume::GetVNode(ino_t vnid, void** _node)
|
||||
{
|
||||
PRINT(("get_vnode(%ld, %lld)\n", GetID(), vnid));
|
||||
PRINT(("get_vnode(%" B_PRId32 ", %" B_PRId64 ")\n", GetID(), vnid));
|
||||
void* vnode;
|
||||
status_t error = get_vnode(fFSVolume, vnid, &vnode);
|
||||
if (error == B_OK) {
|
||||
@@ -349,7 +349,7 @@ PRINT(("get_vnode(%ld, %lld)\n", GetID(), vnid));
|
||||
status_t
|
||||
Volume::PutVNode(ino_t vnid)
|
||||
{
|
||||
PRINT(("put_vnode(%ld, %lld)\n", GetID(), vnid));
|
||||
PRINT(("put_vnode(%" B_PRId32 ", %" B_PRId64 ")\n", GetID(), vnid));
|
||||
// Decrement the count first. We might not have another chance, since
|
||||
// put_vnode() could put the last reference, thus causing the node to be
|
||||
// removed from our map. This is all not very dramatic, but this way we
|
||||
@@ -364,7 +364,7 @@ PRINT(("put_vnode(%ld, %lld)\n", GetID(), vnid));
|
||||
status_t
|
||||
Volume::AcquireVNode(ino_t vnid)
|
||||
{
|
||||
PRINT(("acquire_vnode(%ld, %lld)\n", GetID(), vnid));
|
||||
PRINT(("acquire_vnode(%" B_PRId32 ", %" B_PRId64 ")\n", GetID(), vnid));
|
||||
status_t error = acquire_vnode(fFSVolume, vnid);
|
||||
if (error == B_OK)
|
||||
_IncrementVNodeCount(vnid);
|
||||
@@ -377,7 +377,7 @@ status_t
|
||||
Volume::NewVNode(ino_t vnid, void* clientNode,
|
||||
const FSVNodeCapabilities& capabilities)
|
||||
{
|
||||
PRINT(("new_vnode(%ld, %lld)\n", GetID(), vnid));
|
||||
PRINT(("new_vnode(%" B_PRId32 ", %" B_PRId64 ")\n", GetID(), vnid));
|
||||
// lookup the node
|
||||
MutexLocker locker(fLock);
|
||||
VNode* node = fVNodes->Lookup(vnid);
|
||||
@@ -427,7 +427,9 @@ status_t
|
||||
Volume::PublishVNode(ino_t vnid, void* clientNode, int type, uint32 flags,
|
||||
const FSVNodeCapabilities& capabilities)
|
||||
{
|
||||
PRINT(("publish_vnode(%ld, %lld, %p)\n", GetID(), vnid, clientNode));
|
||||
PRINT(("publish_vnode(%" B_PRId32 ", %" B_PRId64 ", %p)\n", GetID(), vnid,
|
||||
clientNode));
|
||||
|
||||
// lookup the node
|
||||
MutexLocker locker(fLock);
|
||||
VNode* node = fVNodes->Lookup(vnid);
|
||||
@@ -435,8 +437,8 @@ PRINT(("publish_vnode(%ld, %lld, %p)\n", GetID(), vnid, clientNode));
|
||||
|
||||
if (nodeKnown) {
|
||||
if (node->published) {
|
||||
WARN(("publish_vnode(): vnode (%ld, %lld) already published!\n",
|
||||
GetID(), vnid));
|
||||
WARN(("publish_vnode(): vnode (%" B_PRId32 ", %" B_PRId64
|
||||
") already published!\n", GetID(), vnid));
|
||||
RETURN_ERROR(B_BAD_VALUE);
|
||||
}
|
||||
} else if (!nodeKnown) {
|
||||
@@ -492,7 +494,7 @@ PRINT(("publish_vnode(%ld, %lld, %p)\n", GetID(), vnid, clientNode));
|
||||
status_t
|
||||
Volume::RemoveVNode(ino_t vnid)
|
||||
{
|
||||
PRINT(("remove_vnode(%ld, %lld)\n", GetID(), vnid));
|
||||
PRINT(("remove_vnode(%" B_PRId32 ", %" B_PRId64 ")\n", GetID(), vnid));
|
||||
return remove_vnode(fFSVolume, vnid);
|
||||
}
|
||||
|
||||
@@ -500,7 +502,7 @@ PRINT(("remove_vnode(%ld, %lld)\n", GetID(), vnid));
|
||||
status_t
|
||||
Volume::UnremoveVNode(ino_t vnid)
|
||||
{
|
||||
PRINT(("unremove_vnode(%ld, %lld)\n", GetID(), vnid));
|
||||
PRINT(("unremove_vnode(%" B_PRId32 ", %" B_PRId64 ")\n", GetID(), vnid));
|
||||
return unremove_vnode(fFSVolume, vnid);
|
||||
}
|
||||
|
||||
@@ -508,7 +510,8 @@ PRINT(("unremove_vnode(%ld, %lld)\n", GetID(), vnid));
|
||||
status_t
|
||||
Volume::GetVNodeRemoved(ino_t vnid, bool* removed)
|
||||
{
|
||||
PRINT(("get_vnode_removed(%ld, %lld, %p)\n", GetID(), vnid, removed));
|
||||
PRINT(("get_vnode_removed(%" B_PRId32 ", %" B_PRId64 ", %p)\n", GetID(),
|
||||
vnid, removed));
|
||||
return get_vnode_removed(fFSVolume, vnid, removed);
|
||||
}
|
||||
|
||||
@@ -2448,8 +2451,9 @@ Volume::ReadDir(void* _node, void* cookie, void* buffer, size_t bufferSize,
|
||||
return B_BAD_DATA;
|
||||
if ((int32)bufferSize < reply->buffer.GetSize())
|
||||
return B_BAD_DATA;
|
||||
PRINT(("Volume::ReadDir(): buffer returned: %ld bytes\n",
|
||||
reply->buffer.GetSize()));
|
||||
|
||||
PRINT(("Volume::ReadDir(): buffer returned: %" B_PRId32 " bytes\n",
|
||||
reply->buffer.GetSize()));
|
||||
|
||||
*countRead = reply->count;
|
||||
if (*countRead > 0) {
|
||||
@@ -4427,8 +4431,8 @@ Volume::_IncrementVNodeCount(ino_t vnid)
|
||||
|
||||
VNode* vnode = fVNodes->Lookup(vnid);
|
||||
if (vnode == NULL) {
|
||||
ERROR(("Volume::_IncrementVNodeCount(): Node with ID %lld not "
|
||||
"known!\n", vnid));
|
||||
ERROR(("Volume::_IncrementVNodeCount(): Node with ID %" B_PRId64
|
||||
" not known!\n", vnid));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -4448,7 +4452,7 @@ Volume::_DecrementVNodeCount(ino_t vnid)
|
||||
|
||||
VNode* vnode = fVNodes->Lookup(vnid);
|
||||
if (vnode == NULL) {
|
||||
ERROR(("Volume::_DecrementVNodeCount(): Node with ID %lld not "
|
||||
ERROR(("Volume::_DecrementVNodeCount(): Node with ID %" B_PRId64 " not "
|
||||
"known!\n", vnid));
|
||||
return;
|
||||
}
|
||||
@@ -4466,8 +4470,8 @@ Volume::_RemoveInvalidVNode(ino_t vnid)
|
||||
|
||||
VNode* vnode = fVNodes->Lookup(vnid);
|
||||
if (vnode == NULL) {
|
||||
ERROR(("Volume::_RemoveInvalidVNode(): Node with ID %lld not known!\n",
|
||||
vnid));
|
||||
ERROR(("Volume::_RemoveInvalidVNode(): Node with ID %" B_PRId64
|
||||
" not known!\n", vnid));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -4591,8 +4595,8 @@ PRINT(("Volume::_PutAllPendingVNodes()\n"));
|
||||
}
|
||||
} while (nodeFound);
|
||||
|
||||
PRINT(("Volume::_PutAllPendingVNodes() successful: Put %ld vnodes\n",
|
||||
putVNodeCount));
|
||||
PRINT(("Volume::_PutAllPendingVNodes() successful: Put %" B_PRId32
|
||||
" vnodes\n", putVNodeCount));
|
||||
|
||||
return B_OK;
|
||||
}
|
||||
|
||||
@@ -637,7 +637,7 @@ UserlandRequestHandler::_HandleRequest(IterativeIOGetVecsRequest* request)
|
||||
request->offset, request->size, vecs, &vecCount);
|
||||
if (result == B_OK) {
|
||||
vecCount = std::min(vecCount,
|
||||
(uint32)IterativeIOGetVecsReply::MAX_VECS);
|
||||
(size_t)IterativeIOGetVecsReply::MAX_VECS);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -999,8 +999,8 @@ FUSEVolume::CreateSymlink(void* _dir, const char* name, const char* target,
|
||||
int mode)
|
||||
{
|
||||
FUSENode* dir = (FUSENode*)_dir;
|
||||
PRINT(("FUSEVolume::CreateSymlink(%p (%lld), \"%s\" -> \"%s\", %#x)\n", dir,
|
||||
dir->id, name, target, mode));
|
||||
PRINT(("FUSEVolume::CreateSymlink(%p (%" B_PRId64 "), \"%s\" -> \"%s\", "
|
||||
"%#x)\n", dir, dir->id, name, target, mode));
|
||||
|
||||
// lock the directory
|
||||
NodeWriteLocker nodeLocker(this, dir, false);
|
||||
@@ -1046,8 +1046,8 @@ FUSEVolume::Link(void* _dir, const char* name, void* _node)
|
||||
{
|
||||
FUSENode* dir = (FUSENode*)_dir;
|
||||
FUSENode* node = (FUSENode*)_node;
|
||||
PRINT(("FUSEVolume::Link(%p (%lld), \"%s\" -> %p (%lld))\n", dir, dir->id, name,
|
||||
node, node->id));
|
||||
PRINT(("FUSEVolume::Link(%p (%" B_PRId64 "), \"%s\" -> %p (%" B_PRId64
|
||||
"))\n", dir, dir->id, name, node, node->id));
|
||||
|
||||
// lock the directories -- the target directory for writing, the node's
|
||||
// parent for reading
|
||||
@@ -1095,7 +1095,8 @@ status_t
|
||||
FUSEVolume::Unlink(void* _dir, const char* name)
|
||||
{
|
||||
FUSENode* dir = (FUSENode*)_dir;
|
||||
PRINT(("FUSEVolume::Unlink(%p (%lld), \"%s\")\n", dir, dir->id, name));
|
||||
PRINT(("FUSEVolume::Unlink(%p (%" B_PRId64 "), \"%s\")\n", dir, dir->id,
|
||||
name));
|
||||
|
||||
// lock the directory
|
||||
NodeWriteLocker nodeLocker(this, dir, false);
|
||||
@@ -1146,8 +1147,9 @@ FUSEVolume::Rename(void* _oldDir, const char* oldName, void* _newDir,
|
||||
{
|
||||
FUSENode* oldDir = (FUSENode*)_oldDir;
|
||||
FUSENode* newDir = (FUSENode*)_newDir;
|
||||
PRINT(("FUSEVolume::Rename(%p (%lld), \"%s\", %p (%lld), \"%s\")\n", oldDir,
|
||||
oldDir->id, oldName, newDir, newDir->id, newName));
|
||||
PRINT(("FUSEVolume::Rename(%p (%" B_PRId64 "), \"%s\", %p (%" B_PRId64
|
||||
"), \"%s\")\n", oldDir, oldDir->id, oldName, newDir, newDir->id,
|
||||
newName));
|
||||
|
||||
// lock the directories
|
||||
MultiNodeLocker nodeLocker(this, oldDir, false, true, newDir, false, true);
|
||||
@@ -1229,7 +1231,8 @@ status_t
|
||||
FUSEVolume::ReadStat(void* _node, struct stat* st)
|
||||
{
|
||||
FUSENode* node = (FUSENode*)_node;
|
||||
PRINT(("FUSEVolume::ReadStat(%p (%lld), %p)\n", node, node->id, st));
|
||||
PRINT(("FUSEVolume::ReadStat(%p (%" B_PRId64 "), %p)\n", node, node->id,
|
||||
st));
|
||||
|
||||
// lock the directory
|
||||
NodeReadLocker nodeLocker(this, node, true);
|
||||
@@ -1260,8 +1263,8 @@ status_t
|
||||
FUSEVolume::WriteStat(void* _node, const struct stat* st, uint32 mask)
|
||||
{
|
||||
FUSENode* node = (FUSENode*)_node;
|
||||
PRINT(("FUSEVolume::WriteStat(%p (%lld), %p, %#lx)\n", node, node->id, st,
|
||||
mask));
|
||||
PRINT(("FUSEVolume::WriteStat(%p (%" B_PRId64 "), %p, %#lx)\n", node,
|
||||
node->id, st, mask));
|
||||
|
||||
// lock the directory
|
||||
NodeReadLocker nodeLocker(this, node, true);
|
||||
@@ -1356,8 +1359,8 @@ FUSEVolume::Create(void* _dir, const char* name, int openMode, int mode,
|
||||
void** _cookie, ino_t* _vnid)
|
||||
{
|
||||
FUSENode* dir = (FUSENode*)_dir;
|
||||
PRINT(("FUSEVolume::Create(%p (%lld), \"%s\", %#x, %#x)\n", dir, dir->id, name,
|
||||
openMode, mode));
|
||||
PRINT(("FUSEVolume::Create(%p (%" B_PRId64 "), \"%s\", %#x, %#x)\n", dir,
|
||||
dir->id, name, openMode, mode));
|
||||
|
||||
// lock the directory
|
||||
NodeWriteLocker nodeLocker(this, dir, false);
|
||||
@@ -1420,7 +1423,8 @@ status_t
|
||||
FUSEVolume::Open(void* _node, int openMode, void** _cookie)
|
||||
{
|
||||
FUSENode* node = (FUSENode*)_node;
|
||||
PRINT(("FUSEVolume::Open(%p (%lld), %#x)\n", node, node->id, openMode));
|
||||
PRINT(("FUSEVolume::Open(%p (%" B_PRId64 "), %#x)\n", node, node->id,
|
||||
openMode));
|
||||
|
||||
// lock the directory
|
||||
NodeReadLocker nodeLocker(this, node, true);
|
||||
@@ -1641,8 +1645,8 @@ status_t
|
||||
FUSEVolume::CreateDir(void* _dir, const char* name, int mode)
|
||||
{
|
||||
FUSENode* dir = (FUSENode*)_dir;
|
||||
PRINT(("FUSEVolume::CreateDir(%p (%lld), \"%s\", %#x)\n", dir, dir->id, name,
|
||||
mode));
|
||||
PRINT(("FUSEVolume::CreateDir(%p (%" B_PRId64 "), \"%s\", %#x)\n", dir,
|
||||
dir->id, name, mode));
|
||||
|
||||
// lock the directory
|
||||
NodeWriteLocker nodeLocker(this, dir, false);
|
||||
@@ -1684,7 +1688,8 @@ status_t
|
||||
FUSEVolume::RemoveDir(void* _dir, const char* name)
|
||||
{
|
||||
FUSENode* dir = (FUSENode*)_dir;
|
||||
PRINT(("FUSEVolume::RemoveDir(%p (%lld), \"%s\")\n", dir, dir->id, name));
|
||||
PRINT(("FUSEVolume::RemoveDir(%p (%" B_PRId64 "), \"%s\")\n", dir, dir->id,
|
||||
name));
|
||||
|
||||
// lock the directory
|
||||
NodeWriteLocker nodeLocker(this, dir, false);
|
||||
@@ -1732,7 +1737,8 @@ status_t
|
||||
FUSEVolume::OpenDir(void* _node, void** _cookie)
|
||||
{
|
||||
FUSENode* node = (FUSENode*)_node;
|
||||
PRINT(("FUSEVolume::OpenDir(%p (%lld), %p)\n", node, node->id, _cookie));
|
||||
PRINT(("FUSEVolume::OpenDir(%p (%" B_PRId64 "), %p)\n", node, node->id,
|
||||
_cookie));
|
||||
|
||||
// lock the parent directory
|
||||
NodeReadLocker nodeLocker(this, node, true);
|
||||
@@ -1821,8 +1827,8 @@ status_t
|
||||
FUSEVolume::ReadDir(void* _node, void* _cookie, void* buffer, size_t bufferSize,
|
||||
uint32 count, uint32* _countRead)
|
||||
{
|
||||
PRINT(("FUSEVolume::ReadDir(%p, %p, %p, %lu, %ld)\n", _node, _cookie, buffer,
|
||||
bufferSize, count));
|
||||
PRINT(("FUSEVolume::ReadDir(%p, %p, %p, %" B_PRIu32 ", %" B_PRId32 ")\n",
|
||||
_node, _cookie, buffer, bufferSize, count));
|
||||
*_countRead = 0;
|
||||
|
||||
FUSENode* node = (FUSENode*)_node;
|
||||
@@ -2115,8 +2121,9 @@ FUSEVolume::_GetNode(FUSENode* dir, const char* entryName, FUSENode** _node)
|
||||
|
||||
if (privateNode != node) {
|
||||
// weird, the node changed!
|
||||
ERROR(("FUSEVolume::_GetNode(): cookie for node %lld changed: "
|
||||
"expected: %p, got: %p\n", nodeID, node, privateNode));
|
||||
ERROR(("FUSEVolume::_GetNode(): cookie for node %" B_PRId64
|
||||
" changed: expected: %p, got: %p\n", nodeID, node,
|
||||
privateNode));
|
||||
UserlandFS::KernelEmu::put_vnode(fID, nodeID);
|
||||
_PutNode(node);
|
||||
continue;
|
||||
@@ -2753,8 +2760,8 @@ int
|
||||
FUSEVolume::_AddReadDirEntry(ReadDirBuffer* buffer, const char* name, int type,
|
||||
ino_t nodeID, off_t offset)
|
||||
{
|
||||
PRINT(("FUSEVolume::_AddReadDirEntry(%p, \"%s\", %#x, %lld, %lld\n", buffer,
|
||||
name, type, nodeID, offset));
|
||||
PRINT(("FUSEVolume::_AddReadDirEntry(%p, \"%s\", %#x, %" B_PRId64 ", %"
|
||||
B_PRId64 "\n", buffer, name, type, nodeID, offset));
|
||||
|
||||
AutoLocker<Locker> locker(fLock);
|
||||
|
||||
@@ -2781,8 +2788,8 @@ name, type, nodeID, offset));
|
||||
// parent dir entry
|
||||
FUSEEntry* parentEntry = buffer->directory->entries.Head();
|
||||
if (parentEntry == NULL) {
|
||||
ERROR(("FUSEVolume::_AddReadDirEntry(): dir %lld has no entry!\n",
|
||||
dirID));
|
||||
ERROR(("FUSEVolume::_AddReadDirEntry(): dir %" B_PRId64
|
||||
" has no entry!\n", dirID));
|
||||
return 0;
|
||||
}
|
||||
nodeID = parentEntry->parent->id;
|
||||
@@ -2830,7 +2837,7 @@ name, type, nodeID, offset));
|
||||
buffer->error = B_NO_MEMORY;
|
||||
return 1;
|
||||
}
|
||||
PRINT((" -> create node: %p, id: %lld\n", node, nodeID));
|
||||
PRINT((" -> create node: %p, id: %" B_PRId64 "\n", node, nodeID));
|
||||
|
||||
fNodes.Insert(node);
|
||||
} else {
|
||||
|
||||
@@ -320,7 +320,7 @@ do_iterative_fd_io(int fd, io_request *_request, iterative_io_get_vecs getVecs,
|
||||
// get the first vecs already -- this saves a guaranteed trip back from
|
||||
// kernel to userland
|
||||
file_io_vec fileVecs[DoIterativeFDIORequest::MAX_VECS];
|
||||
uint32 fileVecCount = DoIterativeFDIORequest::MAX_VECS;
|
||||
size_t fileVecCount = DoIterativeFDIORequest::MAX_VECS;
|
||||
status_t error = getVecs(_cookie, _request, request->offset,
|
||||
request->length, fileVecs, &fileVecCount);
|
||||
if (error != B_OK && error != B_BUFFER_OVERFLOW)
|
||||
|
||||
@@ -200,7 +200,8 @@ ConditionVariable::_Notify(bool all, status_t result)
|
||||
|
||||
if (!fEntries.IsEmpty()) {
|
||||
if (result > B_OK) {
|
||||
panic("tried to notify with invalid result %ld\n", result);
|
||||
panic("tried to notify with invalid result %" B_PRId32 "\n",
|
||||
result);
|
||||
result = B_ERROR;
|
||||
}
|
||||
|
||||
|
||||
@@ -688,7 +688,7 @@ _mutex_lock_threads_locked(mutex* lock)
|
||||
lock->holder = find_thread(NULL);
|
||||
return B_OK;
|
||||
} else if (lock->holder == find_thread(NULL)) {
|
||||
panic("_mutex_lock(): double lock of %p by thread %ld", lock,
|
||||
panic("_mutex_lock(): double lock of %p by thread %" B_PRId32, lock,
|
||||
lock->holder);
|
||||
} else if (lock->holder == 0)
|
||||
panic("_mutex_lock(): using unitialized lock %p", lock);
|
||||
@@ -743,9 +743,9 @@ _mutex_unlock_threads_locked(mutex* lock)
|
||||
{
|
||||
#if KDEBUG
|
||||
if (find_thread(NULL) != lock->holder) {
|
||||
panic("_mutex_unlock() failure: thread %ld is trying to release "
|
||||
"mutex %p (current holder %ld)\n", find_thread(NULL),
|
||||
lock, lock->holder);
|
||||
panic("_mutex_unlock() failure: thread %" B_PRId32 " is trying to "
|
||||
"release mutex %p (current holder %" B_PRId32 ")\n",
|
||||
find_thread(NULL), lock, lock->holder);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user