2004-09-03 20:33:32 +04:00
|
|
|
/*
|
2004-12-01 10:35:20 +03:00
|
|
|
* Copyright 2004, Axel Dörfler, axeld@pinc-software.de.
|
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*/
|
2004-09-03 20:33:32 +04:00
|
|
|
#ifndef _KERNEL_FILE_CACHE_H
|
|
|
|
#define _KERNEL_FILE_CACHE_H
|
|
|
|
|
|
|
|
|
2004-12-01 10:35:20 +03:00
|
|
|
#include <vfs.h>
|
2004-09-03 20:33:32 +04:00
|
|
|
#include <vm_types.h>
|
2004-12-01 10:35:20 +03:00
|
|
|
#include <module.h>
|
2004-09-03 20:33:32 +04:00
|
|
|
|
|
|
|
|
2005-01-07 03:56:50 +03:00
|
|
|
// temporary/optional cache syscall API
|
|
|
|
#define CACHE_SYSCALLS "cache"
|
|
|
|
|
|
|
|
#define CACHE_CLEAR 1 // takes no parameters
|
|
|
|
#define CACHE_SET_MODULE 2 // gets the module name as parameter
|
|
|
|
|
|
|
|
#define CACHE_MODULES_NAME "file_cache"
|
|
|
|
|
2004-12-01 10:35:20 +03:00
|
|
|
struct cache_module_info {
|
|
|
|
module_info info;
|
|
|
|
|
|
|
|
void (*node_opened)(mount_id mountID, vnode_id vnodeID, off_t size);
|
|
|
|
void (*node_closed)(mount_id mountID, vnode_id vnodeID);
|
|
|
|
};
|
|
|
|
|
2004-09-03 20:33:32 +04:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2004-12-14 01:21:51 +03:00
|
|
|
extern void cache_node_opened(vm_cache_ref *cache, mount_id mountID, vnode_id vnodeID);
|
|
|
|
extern void cache_node_closed(vm_cache_ref *cache, mount_id mountID, vnode_id vnodeID);
|
2004-12-01 10:35:20 +03:00
|
|
|
extern void cache_prefetch(mount_id mountID, vnode_id vnodeID);
|
|
|
|
extern status_t file_cache_init(void);
|
|
|
|
|
2004-09-03 20:33:32 +04:00
|
|
|
extern vm_store *vm_create_vnode_store(void *vnode);
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* _KRENEL_FILE_CACHE_H */
|