From 9906039303161e30ce7382c8fc92490546c723a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Thu, 6 Mar 2008 09:33:09 +0000 Subject: [PATCH] Fixed building the R5 version of BFS on BeOS. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24263 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../add-ons/kernel/file_systems/bfs/Jamfile | 1 + .../add-ons/kernel/file_systems/bfs/r5/Debug.h | 12 +++++++----- .../kernel/file_systems/bfs/r5/Inode.cpp | 3 +-- .../add-ons/kernel/file_systems/bfs/r5/Inode.h | 3 ++- .../add-ons/kernel/file_systems/bfs/r5/Jamfile | 2 ++ .../kernel/file_systems/bfs/r5/Journal.cpp | 7 +++---- .../kernel/file_systems/bfs/r5/Journal.h | 18 +++++++++--------- .../kernel/file_systems/bfs/r5/Query.cpp | 4 ++-- .../kernel/file_systems/bfs/r5/Volume.cpp | 5 ++--- .../kernel/file_systems/bfs/r5/Volume.h | 13 ++++++------- .../kernel/file_systems/bfs/r5/bfs_control.h | 2 +- .../kernel/file_systems/bfs/r5/fsproto.h | 18 ++++++++++++------ 12 files changed, 48 insertions(+), 40 deletions(-) diff --git a/src/tests/add-ons/kernel/file_systems/bfs/Jamfile b/src/tests/add-ons/kernel/file_systems/bfs/Jamfile index e988e28b49..fe4d543076 100644 --- a/src/tests/add-ons/kernel/file_systems/bfs/Jamfile +++ b/src/tests/add-ons/kernel/file_systems/bfs/Jamfile @@ -8,6 +8,7 @@ SubInclude HAIKU_TOP src tests add-ons kernel file_systems bfs dump_log ; SubInclude HAIKU_TOP src tests add-ons kernel file_systems bfs fragmenter ; SubInclude HAIKU_TOP src tests add-ons kernel file_systems bfs mkbfs ; SubInclude HAIKU_TOP src tests add-ons kernel file_systems bfs queries ; +SubInclude HAIKU_TOP src tests add-ons kernel file_systems bfs r5 ; SubInclude HAIKU_TOP src tests add-ons kernel file_systems bfs randomread ; SubInclude HAIKU_TOP src tests add-ons kernel file_systems bfs rename ; SubInclude HAIKU_TOP src tests add-ons kernel file_systems bfs structureSizes ; diff --git a/src/tests/add-ons/kernel/file_systems/bfs/r5/Debug.h b/src/tests/add-ons/kernel/file_systems/bfs/r5/Debug.h index 15f47bbcd7..6cb2d5fbf5 100644 --- a/src/tests/add-ons/kernel/file_systems/bfs/r5/Debug.h +++ b/src/tests/add-ons/kernel/file_systems/bfs/r5/Debug.h @@ -1,10 +1,9 @@ +/* + * Copyright 2001-2008, Axel Dörfler, axeld@pinc-software.de. All Rights Reserved. + * This file may be used under the terms of the MIT License. + */ #ifndef DEBUG_H #define DEBUG_H -/* Debug - debug stuff -** -** Initial version by Axel Dörfler, axeld@pinc-software.de -** This file may be used under the terms of the OpenBeOS License. -*/ #include @@ -21,6 +20,9 @@ # define __out dprintf #endif +#define _KERNEL_DEBUG_H + // to work around problems with private/kernel/debug.h + // Which debugger should be used when? // The DEBUGGER() macro actually has no effect if DEBUG is not defined, // use the DIE() macro if you really want to die. diff --git a/src/tests/add-ons/kernel/file_systems/bfs/r5/Inode.cpp b/src/tests/add-ons/kernel/file_systems/bfs/r5/Inode.cpp index fcbb50ee11..93460d90c2 100644 --- a/src/tests/add-ons/kernel/file_systems/bfs/r5/Inode.cpp +++ b/src/tests/add-ons/kernel/file_systems/bfs/r5/Inode.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2007, Axel Dörfler, axeld@pinc-software.de + * Copyright 2001-2008, Axel Dörfler, axeld@pinc-software.de * This file may be used under the terms of the MIT License. */ @@ -12,7 +12,6 @@ #include "Stream.h" #include "Index.h" -#include #include #include diff --git a/src/tests/add-ons/kernel/file_systems/bfs/r5/Inode.h b/src/tests/add-ons/kernel/file_systems/bfs/r5/Inode.h index f9cef977fa..6633596638 100644 --- a/src/tests/add-ons/kernel/file_systems/bfs/r5/Inode.h +++ b/src/tests/add-ons/kernel/file_systems/bfs/r5/Inode.h @@ -1,6 +1,6 @@ /* Inode - inode access functions * - * Copyright 2001-2006, Axel Dörfler, axeld@pinc-software.de + * Copyright 2001-2008, Axel Dörfler, axeld@pinc-software.de * This file may be used under the terms of the MIT License. */ #ifndef INODE_H @@ -13,6 +13,7 @@ #endif #include "cache.h" +#include "fsproto.h" #include #include diff --git a/src/tests/add-ons/kernel/file_systems/bfs/r5/Jamfile b/src/tests/add-ons/kernel/file_systems/bfs/r5/Jamfile index bb43973dae..629c1bf213 100644 --- a/src/tests/add-ons/kernel/file_systems/bfs/r5/Jamfile +++ b/src/tests/add-ons/kernel/file_systems/bfs/r5/Jamfile @@ -1,5 +1,7 @@ SubDir HAIKU_TOP src tests add-ons kernel file_systems bfs r5 ; +SetSubDirSupportedPlatformsBeOSCompatible ; + # save original optimization level oldOPTIM = $(OPTIM) ; diff --git a/src/tests/add-ons/kernel/file_systems/bfs/r5/Journal.cpp b/src/tests/add-ons/kernel/file_systems/bfs/r5/Journal.cpp index d984f1084f..b5cadf57e0 100644 --- a/src/tests/add-ons/kernel/file_systems/bfs/r5/Journal.cpp +++ b/src/tests/add-ons/kernel/file_systems/bfs/r5/Journal.cpp @@ -1,13 +1,12 @@ -/* Journal - transaction and logging - * - * Copyright 2001-2006, Axel Dörfler, axeld@pinc-software.de +/* + * Copyright 2001-2008, Axel Dörfler, axeld@pinc-software.de * This file may be used under the terms of the MIT License. */ +//! Transaction and logging #include "Journal.h" #include "Inode.h" -#include "Debug.h" #include #include diff --git a/src/tests/add-ons/kernel/file_systems/bfs/r5/Journal.h b/src/tests/add-ons/kernel/file_systems/bfs/r5/Journal.h index 03a14d0361..2edb4dc9ee 100644 --- a/src/tests/add-ons/kernel/file_systems/bfs/r5/Journal.h +++ b/src/tests/add-ons/kernel/file_systems/bfs/r5/Journal.h @@ -1,12 +1,18 @@ -/* Journal - transaction and logging - * - * Copyright 2001-2005, Axel Dörfler, axeld@pinc-software.de +/* + * Copyright 2001-2008, Axel Dörfler, axeld@pinc-software.de * This file may be used under the terms of the MIT License. */ #ifndef JOURNAL_H #define JOURNAL_H +#include "Debug.h" +#include "Volume.h" +#include "Chain.h" +#include "Utility.h" + +#include "cache.h" + #include #include @@ -14,12 +20,6 @@ # include #endif -#include "cache.h" - -#include "Volume.h" -#include "Chain.h" -#include "Utility.h" - struct run_array; class LogEntry; diff --git a/src/tests/add-ons/kernel/file_systems/bfs/r5/Query.cpp b/src/tests/add-ons/kernel/file_systems/bfs/r5/Query.cpp index 89a0de0ad1..6f3c6b1f1f 100644 --- a/src/tests/add-ons/kernel/file_systems/bfs/r5/Query.cpp +++ b/src/tests/add-ons/kernel/file_systems/bfs/r5/Query.cpp @@ -4,7 +4,7 @@ * by J. Kercheval, and on code written by Kenneth Almquist, though * it shares no code. * - * Copyright 2001-2007, Axel Dörfler, axeld@pinc-software.de. + * Copyright 2001-2008, Axel Dörfler, axeld@pinc-software.de. * This file may be used under the terms of the MIT License. */ @@ -1504,7 +1504,7 @@ Query::GetNextEntry(struct dirent *dirent, size_t size) if (!fStack.Pop(&fCurrent) || fCurrent == NULL || fCurrent->PrepareQuery(fVolume, fIndex, &fIterator, - fFlags & B_QUERY_NON_INDEXED) < B_OK) + false/*fFlags & B_QUERY_NON_INDEXED*/) < B_OK) return B_ENTRY_NOT_FOUND; } if (fCurrent == NULL) diff --git a/src/tests/add-ons/kernel/file_systems/bfs/r5/Volume.cpp b/src/tests/add-ons/kernel/file_systems/bfs/r5/Volume.cpp index c59efc9e22..3eb82e2c04 100644 --- a/src/tests/add-ons/kernel/file_systems/bfs/r5/Volume.cpp +++ b/src/tests/add-ons/kernel/file_systems/bfs/r5/Volume.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2007, Axel Dörfler, axeld@pinc-software.de. All Rights Reserved. + * Copyright 2001-2008, Axel Dörfler, axeld@pinc-software.de. All Rights Reserved. * This file may be used under the terms of the MIT License. */ @@ -15,7 +15,6 @@ #include #include #include -#include #include #include @@ -232,7 +231,7 @@ disk_super_block::Initialize(const char *diskName, off_t numBlocks, uint32 block // #pragma mark - -Volume::Volume(mount_id id) +Volume::Volume(dev_t id) : fID(id), fBlockAllocator(this), diff --git a/src/tests/add-ons/kernel/file_systems/bfs/r5/Volume.h b/src/tests/add-ons/kernel/file_systems/bfs/r5/Volume.h index 207deac9a2..e98f986af4 100644 --- a/src/tests/add-ons/kernel/file_systems/bfs/r5/Volume.h +++ b/src/tests/add-ons/kernel/file_systems/bfs/r5/Volume.h @@ -1,6 +1,5 @@ -/* Volume - BFS super block, mounting, etc. - * - * Initial version by Axel Dörfler, axeld@pinc-software.de +/* + * Copyright 2001-2008, Axel Dörfler, axeld@pinc-software.de. All Rights Reserved. * This file may be used under the terms of the MIT License. */ #ifndef VOLUME_H @@ -8,7 +7,7 @@ #include -#include +#include "fsproto.h" #include "cache.h" @@ -31,7 +30,7 @@ enum volume_initialize_flags { class Volume { public: - Volume(mount_id id); + Volume(dev_t id); ~Volume(); status_t Mount(const char *device, uint32 flags); @@ -53,7 +52,7 @@ class Volume { vint32 &LogEnd() { return fLogEnd; } int Device() const { return fDevice; } - mount_id ID() const { return fID; } + dev_t ID() const { return fID; } const char *Name() const { return fSuperBlock.name; } off_t NumBlocks() const { return fSuperBlock.NumBlocks(); } @@ -112,7 +111,7 @@ class Volume { static status_t Identify(int fd, disk_super_block *superBlock); protected: - mount_id fID; + dev_t fID; int fDevice; disk_super_block fSuperBlock; diff --git a/src/tests/add-ons/kernel/file_systems/bfs/r5/bfs_control.h b/src/tests/add-ons/kernel/file_systems/bfs/r5/bfs_control.h index 02db3b1cef..088d6559f5 100644 --- a/src/tests/add-ons/kernel/file_systems/bfs/r5/bfs_control.h +++ b/src/tests/add-ons/kernel/file_systems/bfs/r5/bfs_control.h @@ -7,7 +7,7 @@ */ -#include +#include "fsproto.h" /* ioctl to check the version of BFS used - parameter is a uint32 * diff --git a/src/tests/add-ons/kernel/file_systems/bfs/r5/fsproto.h b/src/tests/add-ons/kernel/file_systems/bfs/r5/fsproto.h index 091b9c56c6..1b1e3e03fc 100644 --- a/src/tests/add-ons/kernel/file_systems/bfs/r5/fsproto.h +++ b/src/tests/add-ons/kernel/file_systems/bfs/r5/fsproto.h @@ -238,19 +238,25 @@ typedef struct vnode_ops { extern "C" { #endif -extern _IMPEXP_KERNEL int new_path(const char *path, char **copy); -extern _IMPEXP_KERNEL void free_path(char *p); +extern _IMPEXP_KERNEL int new_path(const char *path, char **copy); +extern _IMPEXP_KERNEL void free_path(char *p); -extern _IMPEXP_KERNEL void notify_select_event(selectsync *sync, uint32 ref); -extern _IMPEXP_KERNEL status_t is_vnode_removed(nspace_id nsid, vnode_id vnid); +extern _IMPEXP_KERNEL void notify_select_event(selectsync *sync, uint32 ref); +extern _IMPEXP_KERNEL int notify_listener(int op, nspace_id nsid, + vnode_id vnida, vnode_id vnidb, + vnode_id vnidc, const char *name); extern _IMPEXP_KERNEL status_t send_notification(port_id port, long token, ulong what, long op, nspace_id device, nspace_id toDevice, vnode_id parentNode, vnode_id toParentNode, vnode_id node, const char *name); -// The missing prototypes can be found in the fs_interface.h file. -// That part of the VFS is still compatible with BeOS :) +extern _IMPEXP_KERNEL int get_vnode(nspace_id nsid, vnode_id vnid, void **data); +extern _IMPEXP_KERNEL int put_vnode(nspace_id nsid, vnode_id vnid); +extern _IMPEXP_KERNEL int new_vnode(nspace_id nsid, vnode_id vnid, void *data); +extern _IMPEXP_KERNEL int remove_vnode(nspace_id nsid, vnode_id vnid); +extern _IMPEXP_KERNEL int unremove_vnode(nspace_id nsid, vnode_id vnid); +extern _IMPEXP_KERNEL int is_vnode_removed(nspace_id nsid, vnode_id vnid); #ifdef __cplusplus }