* 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
This commit is contained in:
Axel Dörfler 2006-05-05 11:21:00 +00:00
parent 3cb039fffa
commit 074ebdda4a
3 changed files with 7 additions and 3 deletions

View File

@ -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) ;

View File

@ -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);

View File

@ -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