* 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
+8
View File
@@ -18,6 +18,12 @@ enum {
FSSH_TRANSACTION_IDLE = 0x08
};
/* file map modes */
enum {
FSSH_FILE_MAP_CACHE_ON_DEMAND = 0x01, /* default mode */
FSSH_FILE_MAP_CACHE_ALL = 0x02
};
typedef void (*fssh_transaction_notification_hook)(int32_t id, int32_t event,
void *data);
@@ -90,6 +96,7 @@ extern void * fssh_file_cache_create(fssh_mount_id mountID,
extern void fssh_file_cache_delete(void *_cacheRef);
extern void fssh_file_cache_enable(void *_cacheRef);
extern fssh_status_t fssh_file_cache_disable(void *_cacheRef);
extern bool fssh_file_cache_is_enabled(void *_cacheRef);
extern fssh_status_t fssh_file_cache_set_size(void *_cacheRef,
fssh_off_t size);
extern fssh_status_t fssh_file_cache_sync(void *_cache);
@@ -108,6 +115,7 @@ extern void fssh_file_map_delete(void *_map);
extern void fssh_file_map_set_size(void *_map, fssh_off_t size);
extern void fssh_file_map_invalidate(void *_map, fssh_off_t offset,
fssh_off_t size);
extern fssh_status_t fssh_file_map_set_mode(void *_map, uint32_t mode);
extern fssh_status_t fssh_file_map_translate(void *_map, fssh_off_t offset,
fssh_size_t size, struct fssh_file_io_vec *vecs,
fssh_size_t *_count);