From 3594d63b342ee2592a094107f4aeb2e4872f2d2d Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Fri, 27 Feb 2009 11:38:26 +0000 Subject: [PATCH] Got the kernel interface compiling. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29333 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../userlandfs/server/haiku_kernel_emu.cpp | 16 +++++++++------- .../userlandfs/server/kernel_emu.cpp | 8 ++++++++ .../file_systems/userlandfs/server/kernel_emu.h | 1 + 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/src/add-ons/kernel/file_systems/userlandfs/server/haiku_kernel_emu.cpp b/src/add-ons/kernel/file_systems/userlandfs/server/haiku_kernel_emu.cpp index d6e3366a12..644a232aaa 100644 --- a/src/add-ons/kernel/file_systems/userlandfs/server/haiku_kernel_emu.cpp +++ b/src/add-ons/kernel/file_systems/userlandfs/server/haiku_kernel_emu.cpp @@ -11,6 +11,8 @@ #include "Debug.h" #include "haiku_fs_cache.h" +#include "HaikuKernelNode.h" +#include "HaikuKernelVolume.h" #include "kernel_emu.h" @@ -145,8 +147,8 @@ publish_vnode(fs_volume *_volume, ino_t vnodeID, void *privateNode, return error; // publish the new node - error = UserlandFS::KernelEmu::publish_vnode(volume, vnodeID, node, type, - flags); + error = UserlandFS::KernelEmu::publish_vnode(volume->GetID(), vnodeID, node, + type, flags); if (error != B_OK) volume->UndoPublishVNode(node); @@ -155,18 +157,18 @@ publish_vnode(fs_volume *_volume, ino_t vnodeID, void *privateNode, // get_vnode status_t -get_vnode(defs_volume *_volume, ino_t vnodeID, fs_vnode *privateNode) +get_vnode(fs_volume *_volume, ino_t vnodeID, fs_vnode *privateNode) { HaikuKernelVolume* volume = HaikuKernelVolume::GetVolume(_volume); // get the node void* foundNode; - status_t error = UserlandFS::KernelEmu::get_vnode(volume, vnodeID, + status_t error = UserlandFS::KernelEmu::get_vnode(volume->GetID(), vnodeID, &foundNode); if (error != B_OK) return error; - ((HaikuKernelNode*)foundNode)->GetFSNode(privateNode); + *privateNode = *(HaikuKernelNode*)foundNode; return B_OK; } @@ -221,7 +223,7 @@ get_vnode_removed(fs_volume *_volume, ino_t vnodeID, bool* removed) fs_volume* volume_for_vnode(fs_vnode *vnode) { - return HaikuKernelNode::GetNode(vnode)->GetVolume(); + return HaikuKernelNode::GetNode(vnode)->GetVolume()->GetFSVolume(); } @@ -520,7 +522,7 @@ remove_debugger_command(char *name, debugger_command_hook hook) } // parse_expression -uint32 +uint64 parse_expression(const char *string) { return UserlandFS::KernelEmu::parse_expression(string); diff --git a/src/add-ons/kernel/file_systems/userlandfs/server/kernel_emu.cpp b/src/add-ons/kernel/file_systems/userlandfs/server/kernel_emu.cpp index adc20e6e07..042443663c 100644 --- a/src/add-ons/kernel/file_systems/userlandfs/server/kernel_emu.cpp +++ b/src/add-ons/kernel/file_systems/userlandfs/server/kernel_emu.cpp @@ -324,6 +324,14 @@ UserlandFS::KernelEmu::put_vnode(dev_t nsid, ino_t vnid) return error; } +// acquire_vnode +status_t +UserlandFS::KernelEmu::acquire_vnode(dev_t nsid, ino_t vnodeID) +{ + // TODO: Implement! + return B_BAD_VALUE; +} + // new_vnode status_t UserlandFS::KernelEmu::new_vnode(dev_t nsid, ino_t vnid, void* data) diff --git a/src/add-ons/kernel/file_systems/userlandfs/server/kernel_emu.h b/src/add-ons/kernel/file_systems/userlandfs/server/kernel_emu.h index 797cc7aa1b..13cfdbc76c 100644 --- a/src/add-ons/kernel/file_systems/userlandfs/server/kernel_emu.h +++ b/src/add-ons/kernel/file_systems/userlandfs/server/kernel_emu.h @@ -22,6 +22,7 @@ status_t notify_query(port_id port, int32 token, int32 operation, status_t get_vnode(dev_t nsid, ino_t vnid, void** node); status_t put_vnode(dev_t nsid, ino_t vnid); +status_t acquire_vnode(dev_t nsid, ino_t vnodeID); status_t new_vnode(dev_t nsid, ino_t vnid, void* data); status_t publish_vnode(dev_t nsid, ino_t vnid, void* data, int type, uint32 flags);