From 074ebdda4ae9932b3bd3af85261a63e4db689bb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Fri, 5 May 2006 11:21:00 +0000 Subject: [PATCH] * When mounting an image, BFS no longer tries to set the file into uncached mode - this will waste some memory (as the data will be cached twice), but unlike BeOS, it cannot deadlock the cache, so it's safe to be used. In other words, mounting images is now working as expected. * a BFS FATAL() condition no longer results in a KDL; this seemed to confuse anybody :) git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17336 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/add-ons/kernel/file_systems/bfs/Debug.h | 3 ++- src/add-ons/kernel/file_systems/bfs/Inode.cpp | 2 +- src/add-ons/kernel/file_systems/bfs/Volume.cpp | 5 ++++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/add-ons/kernel/file_systems/bfs/Debug.h b/src/add-ons/kernel/file_systems/bfs/Debug.h index d3f14afc7b..3d0a523311 100644 --- a/src/add-ons/kernel/file_systems/bfs/Debug.h +++ b/src/add-ons/kernel/file_systems/bfs/Debug.h @@ -72,7 +72,8 @@ #define REPORT_ERROR(status) \ __out("bfs: %s:%d: %s\n", __FUNCTION__, __LINE__, strerror(status)); #define RETURN_ERROR(err) { status_t _status = err; if (_status < B_OK) REPORT_ERROR(_status); return _status;} - #define FATAL(x) { __out("bfs: "); __out x; sync(); panic("BFS!\n"); } +// #define FATAL(x) { __out("bfs: "); __out x; sync(); panic("BFS!\n"); } + #define FATAL(x) { __out("bfs: "); __out x; } #define INFORM(x) { __out("bfs: "); __out x; } #define FUNCTION() ; #define FUNCTION_START(x) ; diff --git a/src/add-ons/kernel/file_systems/bfs/Inode.cpp b/src/add-ons/kernel/file_systems/bfs/Inode.cpp index fbeb46f156..ea5c1d0f93 100644 --- a/src/add-ons/kernel/file_systems/bfs/Inode.cpp +++ b/src/add-ons/kernel/file_systems/bfs/Inode.cpp @@ -256,7 +256,7 @@ Inode::InitCheck(bool checkNode) status_t status = Node().InitCheck(fVolume); if (status == B_BUSY) return B_BUSY; - + if (status < B_OK) { FATAL(("inode at block %Ld corrupt!\n", BlockNumber())); RETURN_ERROR(B_BAD_DATA); diff --git a/src/add-ons/kernel/file_systems/bfs/Volume.cpp b/src/add-ons/kernel/file_systems/bfs/Volume.cpp index 9352311d33..fe4ae5e5c5 100644 --- a/src/add-ons/kernel/file_systems/bfs/Volume.cpp +++ b/src/add-ons/kernel/file_systems/bfs/Volume.cpp @@ -301,8 +301,10 @@ Volume::Mount(const char *deviceName, uint32 flags) if (fstat(fDevice, &stat) < 0) RETURN_ERROR(B_ERROR); +// TODO: allow turning off caching of the underlying file (once O_NOCACHE works) +#if 0 #ifndef NO_FILE_UNCACHED_IO - if (stat.st_mode & S_FILE && ioctl(fDevice, IOCTL_FILE_UNCACHED_IO, NULL) < 0) { + if ((stat.st_mode & S_FILE) != 0 && ioctl(fDevice, IOCTL_FILE_UNCACHED_IO, NULL) < 0) { // mount read-only if the cache couldn't be disabled # ifdef DEBUG FATAL(("couldn't disable cache for image file - system may dead-lock!\n")); @@ -311,6 +313,7 @@ Volume::Mount(const char *deviceName, uint32 flags) Panic(); # endif } +#endif #endif // read the super block