* Added file_cache_is_enabled() function.

* Added file_map_set_mode() function that you can use to keep a whole file
  cached. This is needed for the swap file support: FILE_MAP_CACHE_ALL will
  not only precache all file_io_vecs when called, but it will also cause all
  file_map_translate() calls to fail that would require further caching (ie.
  if the file size had changed).
* Updated the fs_shell file map code to the latest one (with several bug fixes).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26785 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2008-08-04 08:28:17 +00:00
parent b555dcbd39
commit 3c1a3047a4
7 changed files with 474 additions and 215 deletions
+10
View File
@@ -979,6 +979,16 @@ file_cache_disable(void *_cacheRef)
}
extern "C" bool
file_cache_is_enabled(void *_cacheRef)
{
file_cache_ref *ref = (file_cache_ref*)_cacheRef;
AutoLocker<VMCache> _(ref->cache);
return ref->disabled_count == 0;
}
extern "C" status_t
file_cache_set_size(void *_cacheRef, off_t newSize)
{