* 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:
@@ -19,6 +19,12 @@ enum {
|
||||
TRANSACTION_IDLE = 0x08
|
||||
};
|
||||
|
||||
/* file map modes */
|
||||
enum {
|
||||
FILE_MAP_CACHE_ON_DEMAND = 0x01, /* default mode */
|
||||
FILE_MAP_CACHE_ALL = 0x02
|
||||
};
|
||||
|
||||
typedef void (*transaction_notification_hook)(int32 id, int32 event,
|
||||
void *data);
|
||||
|
||||
@@ -74,6 +80,7 @@ extern void block_cache_put(void *_cache, off_t blockNumber);
|
||||
extern void *file_cache_create(dev_t mountID, ino_t vnodeID, off_t size);
|
||||
extern void file_cache_delete(void *_cacheRef);
|
||||
extern void file_cache_enable(void *_cacheRef);
|
||||
extern bool file_cache_is_enabled(void *_cacheRef);
|
||||
extern status_t file_cache_disable(void *_cacheRef);
|
||||
extern status_t file_cache_set_size(void *_cacheRef, off_t size);
|
||||
extern status_t file_cache_sync(void *_cache);
|
||||
@@ -88,6 +95,7 @@ extern void *file_map_create(dev_t mountID, ino_t vnodeID, off_t size);
|
||||
extern void file_map_delete(void *_map);
|
||||
extern void file_map_set_size(void *_map, off_t size);
|
||||
extern void file_map_invalidate(void *_map, off_t offset, off_t size);
|
||||
extern status_t file_map_set_mode(void *_map, uint32 mode);
|
||||
extern status_t file_map_translate(void *_map, off_t offset, size_t size,
|
||||
struct file_io_vec *vecs, size_t *_count);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user