Removed the file cache emulation and added implementation stubs for the file

cache functions. We won't emulate the file cache in userland anymore, but
forward the calls to the kernel. Besides that this will save quite a bit of
emulation code, it will also make mmap()ing files on UserlandFS volumes
possible. The drawback is that these calls will be slower.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29349 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2009-02-28 15:10:36 +00:00
parent e4ec0a2364
commit 67cf3a62b4
5 changed files with 83 additions and 2013 deletions

View File

@ -47,19 +47,12 @@ HaikuKernelVolume::Mount(const char* device, uint32 flags,
if (!fFSModule->mount)
return B_BAD_VALUE;
// make the volume known to the file cache emulation
status_t error
= UserlandFS::HaikuKernelEmu::file_cache_register_volume(this);
// mount
status_t error = fFSModule->mount(&fVolume, device, flags, parameters,
rootID);
if (error != B_OK)
return error;
// mount
error = fFSModule->mount(&fVolume, device, flags, parameters, rootID);
if (error != B_OK) {
UserlandFS::HaikuKernelEmu::file_cache_unregister_volume(this);
return error;
}
_InitCapabilities();
return B_OK;
@ -72,13 +65,7 @@ HaikuKernelVolume::Unmount()
if (!fVolume.ops->unmount)
return B_BAD_VALUE;
// unmount
status_t error = fVolume.ops->unmount(&fVolume);
// unregister with the file cache emulation
UserlandFS::HaikuKernelEmu::file_cache_unregister_volume(this);
return error;
return fVolume.ops->unmount(&fVolume);
}
// Sync

View File

@ -26,13 +26,13 @@ SharedLibrary libuserlandfs_haiku_kernel.so
haiku_block_cache.cpp
haiku_condition_variable.cpp
# haiku_file_cache.cpp
haiku_hash.cpp
haiku_lock.cpp
haiku_slab.cpp
HaikuKernelFileSystem.cpp
HaikuKernelVolume.cpp
file_cache.cpp
file_map.cpp
:

View File

@ -0,0 +1,78 @@
/*
* Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
* Distributed under the terms of the MIT License.
*/
#include <fs_cache.h>
void*
file_cache_create(dev_t mountID, ino_t vnodeID, off_t size)
{
// TODO: Implement!
return NULL;
}
void
file_cache_delete(void *cacheRef)
{
// TODO: Implement!
}
void
file_cache_enable(void *cacheRef)
{
// TODO: Implement!
}
bool
file_cache_is_enabled(void *cacheRef)
{
// TODO: Implement!
return false;
}
status_t
file_cache_disable(void *cacheRef)
{
// TODO: Implement!
return B_NOT_SUPPORTED;
}
status_t
file_cache_set_size(void *cacheRef, off_t size)
{
// TODO: Implement!
return B_NOT_SUPPORTED;
}
status_t
file_cache_sync(void *cache)
{
// TODO: Implement!
return B_NOT_SUPPORTED;
}
status_t
file_cache_read(void *cacheRef, void *cookie, off_t offset, void *bufferBase,
size_t *_size)
{
// TODO: Implement!
return B_NOT_SUPPORTED;
}
status_t
file_cache_write(void *cacheRef, void *cookie, off_t offset, const void *buffer,
size_t *_size)
{
// TODO: Implement!
return B_NOT_SUPPORTED;
}

View File

@ -1,28 +0,0 @@
/*
* Copyright 2004-2007, Haiku Inc. All Rights Reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef USERLAND_FS_HAIKU_FS_CACHE_H
#define USERLAND_FS_HAIKU_FS_CACHE_H
//! File System File and Block Caches
#include <fs_cache.h>
namespace UserlandFS {
class HaikuKernelVolume;
namespace HaikuKernelEmu {
// interface for the emulation layer
status_t file_cache_init();
status_t file_cache_register_volume(HaikuKernelVolume* volume);
status_t file_cache_unregister_volume(HaikuKernelVolume* volume);
} // namespace HaikuKernelEmu
} // namespace UserlandFS
#endif /* USERLAND_FS_HAIKU_FS_CACHE_H */