2004-09-03 20:33:32 +04:00
|
|
|
/*
|
2008-07-07 16:02:24 +04:00
|
|
|
* Copyright 2004-2008, Axel Dörfler, axeld@pinc-software.de.
|
2004-12-01 10:35:20 +03:00
|
|
|
* 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"
|
|
|
|
|
2005-02-02 09:17:58 +03:00
|
|
|
#define FILE_CACHE_SEQUENTIAL_ACCESS 0x01
|
|
|
|
#define FILE_CACHE_LOADED_COMPLETELY 0x02
|
|
|
|
#define FILE_CACHE_NO_IO 0x04
|
|
|
|
|
2004-12-01 10:35:20 +03:00
|
|
|
struct cache_module_info {
|
|
|
|
module_info info;
|
|
|
|
|
2007-10-06 19:33:12 +04:00
|
|
|
void (*node_opened)(struct vnode *vnode, int32 fdType, dev_t mountID,
|
|
|
|
ino_t parentID, ino_t vnodeID, const char *name, off_t size);
|
|
|
|
void (*node_closed)(struct vnode *vnode, int32 fdType, dev_t mountID,
|
|
|
|
ino_t vnodeID, int32 accessType);
|
2005-02-02 09:17:58 +03:00
|
|
|
void (*node_launched)(size_t argCount, char * const *args);
|
2004-12-01 10:35:20 +03:00
|
|
|
};
|
|
|
|
|
2004-09-03 20:33:32 +04:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2007-10-06 19:33:12 +04:00
|
|
|
extern void cache_node_opened(struct vnode *vnode, int32 fdType, vm_cache *cache,
|
2007-06-21 23:50:57 +04:00
|
|
|
dev_t mountID, ino_t parentID, ino_t vnodeID, const char *name);
|
2007-10-06 19:33:12 +04:00
|
|
|
extern void cache_node_closed(struct vnode *vnode, int32 fdType, vm_cache *cache,
|
2007-06-21 23:50:57 +04:00
|
|
|
dev_t mountID, ino_t vnodeID);
|
2005-02-02 09:17:58 +03:00
|
|
|
extern void cache_node_launched(size_t argCount, char * const *args);
|
2007-10-06 19:33:12 +04:00
|
|
|
extern void cache_prefetch_vnode(struct vnode *vnode, off_t offset, size_t size);
|
2007-06-21 23:50:57 +04:00
|
|
|
extern void cache_prefetch(dev_t mountID, ino_t vnodeID, off_t offset, size_t size);
|
2008-07-07 16:02:24 +04:00
|
|
|
|
|
|
|
extern status_t file_map_init(void);
|
2005-08-03 21:25:03 +04:00
|
|
|
extern status_t file_cache_init_post_boot_device(void);
|
2004-12-01 10:35:20 +03:00
|
|
|
extern status_t file_cache_init(void);
|
|
|
|
|
2007-09-26 04:20:23 +04:00
|
|
|
extern vm_store *vm_create_vnode_store(struct vnode *vnode);
|
2004-09-03 20:33:32 +04:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* _KRENEL_FILE_CACHE_H */
|