From 7868a011b865447e04d6cdc0db21d3a18ab5ab12 Mon Sep 17 00:00:00 2001 From: brjhaiku Date: Sat, 29 Jun 2019 03:03:18 +0530 Subject: [PATCH] fixed btrfs_shell Change-Id: I792661b62d896f105690500403650b174a649de6 --- headers/private/file_systems/DebugSupport.h | 2 +- headers/private/fs_shell/fssh_api_wrapper.h | 3 +++ headers/private/fs_shell/fssh_time.h | 9 +++---- .../file_systems/btrfs/system_dependencies.h | 3 ++- .../file_systems/shared/DebugSupport.cpp | 26 +++++++++++++++++++ .../file_systems/btrfs/btrfs_shell/Jamfile | 11 +++++++- 6 files changed, 46 insertions(+), 8 deletions(-) diff --git a/headers/private/file_systems/DebugSupport.h b/headers/private/file_systems/DebugSupport.h index 8e7626e681..c59c6650d4 100644 --- a/headers/private/file_systems/DebugSupport.h +++ b/headers/private/file_systems/DebugSupport.h @@ -12,8 +12,8 @@ #if !USER # include +# include #endif -#include #include diff --git a/headers/private/fs_shell/fssh_api_wrapper.h b/headers/private/fs_shell/fssh_api_wrapper.h index bbe883ca34..d0feed5bdc 100644 --- a/headers/private/fs_shell/fssh_api_wrapper.h +++ b/headers/private/fs_shell/fssh_api_wrapper.h @@ -12,6 +12,9 @@ #endif #include +#undef __THROW +#define __THROW + #include "fssh_dirent.h" #include "fssh_errno.h" #include "fssh_fcntl.h" diff --git a/headers/private/fs_shell/fssh_time.h b/headers/private/fs_shell/fssh_time.h index 9c30386ec1..e1ceeed658 100644 --- a/headers/private/fs_shell/fssh_time.h +++ b/headers/private/fs_shell/fssh_time.h @@ -50,16 +50,15 @@ struct fssh_tm { }; +#ifdef __cplusplus +extern "C" { +#endif + /* special timezone support */ extern char *fssh_tzname[2]; extern int fssh_daylight; extern long fssh_timezone; - -#ifdef __cplusplus -extern "C" { -#endif - extern fssh_clock_t fssh_clock(void); extern double fssh_difftime(fssh_time_t time1, fssh_time_t time2); extern fssh_time_t fssh_mktime(struct fssh_tm *tm); diff --git a/src/add-ons/kernel/file_systems/btrfs/system_dependencies.h b/src/add-ons/kernel/file_systems/btrfs/system_dependencies.h index 2723fdd3c6..826246de27 100644 --- a/src/add-ons/kernel/file_systems/btrfs/system_dependencies.h +++ b/src/add-ons/kernel/file_systems/btrfs/system_dependencies.h @@ -10,8 +10,9 @@ // This needs to be included before the fs_shell wrapper #include -#include + #include +#include #include "fssh_api_wrapper.h" #include "fssh_auto_deleter.h" diff --git a/src/add-ons/kernel/file_systems/shared/DebugSupport.cpp b/src/add-ons/kernel/file_systems/shared/DebugSupport.cpp index 23f683e25e..35dc18b495 100644 --- a/src/add-ons/kernel/file_systems/shared/DebugSupport.cpp +++ b/src/add-ons/kernel/file_systems/shared/DebugSupport.cpp @@ -13,6 +13,8 @@ #include #include +#ifdef __HAIKU__ + #include @@ -110,6 +112,30 @@ dbg_printf_unlock() } } +#else + +status_t +init_debugging() +{ + status_t error = B_OK; + return error; +} +status_t +exit_debugging() +{ + status_t error = B_OK; + return error; +} +static inline bool +dbg_printf_lock() +{ + return true; +} +static inline void +dbg_printf_unlock(){} + +#endif + void dbg_printf_begin() diff --git a/src/tests/add-ons/kernel/file_systems/btrfs/btrfs_shell/Jamfile b/src/tests/add-ons/kernel/file_systems/btrfs/btrfs_shell/Jamfile index 70127cf1e6..12f7642870 100644 --- a/src/tests/add-ons/kernel/file_systems/btrfs/btrfs_shell/Jamfile +++ b/src/tests/add-ons/kernel/file_systems/btrfs/btrfs_shell/Jamfile @@ -10,6 +10,7 @@ DEFINES += HAIKU_BUILD_COMPATIBILITY_H ; local defines = FS_SHELL TRACE_BTRFS # ENABLE DEBUGGING + USER=1 ; defines = [ FDefines $(defines) ] ; @@ -25,14 +26,18 @@ if ! $(HOST_PLATFORM_HAIKU_COMPATIBLE) { fsShellCommandLibs = $(HOST_NETWORK_LIBS) ; } + UseHeaders [ FDirName $(HAIKU_TOP) headers build ] : true ; UseHeaders [ FDirName $(HAIKU_TOP) headers build os ] : true ; UseHeaders [ FDirName $(HAIKU_TOP) headers build os support ] : true ; UsePrivateKernelHeaders ; UsePrivateHeaders shared storage fs_shell ; +UsePrivateHeaders file_systems ; UseHeaders [ FDirName $(HAIKU_TOP) headers private ] : true ; UseHeaders [ FDirName $(HAIKU_TOP) src tools fs_shell ] ; +UseHeaders [ FDirName $(HAIKU_TOP) src libs uuid ] : true ; + local btrfsSources = Attribute.cpp @@ -40,11 +45,13 @@ local btrfsSources = BTree.cpp Chunk.cpp CRCTable.cpp + DebugSupport.cpp DirectoryIterator.cpp ExtentAllocator.cpp Inode.cpp Journal.cpp Volume.cpp + btrfs_disk_system.cpp kernel_interface.cpp ; @@ -60,8 +67,10 @@ BuildPlatformMain btrfs_shell : btrfs.o fs_shell.a $(HOST_LIBSUPC++) $(HOST_LIBSTDC++) - $(HOST_LIBROOT) $(fsShellCommandLibs) + $(HOST_LIBROOT) $(fsShellCommandLibs) uuid ; SEARCH on [ FGristFiles $(utilitySources) ] += [ FDirName $(HAIKU_TOP) src system kernel util ] ; +SEARCH on [ FGristFiles DebugSupport.cpp ] + += [ FDirName $(HAIKU_TOP) src add-ons kernel file_systems shared ] ;