2 * Copyright 2004-2008, Axel Dörfler, axeld@pinc-software.de.
3 * Distributed under the terms of the MIT License.
5 #ifndef _KERNEL_FILE_CACHE_H
6 #define _KERNEL_FILE_CACHE_H
10 #include <vm/vm_types.h>
14 // temporary/optional cache syscall API
15 #define CACHE_SYSCALLS "cache"
17 #define CACHE_CLEAR 1 // takes no parameters
18 #define CACHE_SET_MODULE 2 // gets the module name as parameter
20 #define CACHE_MODULES_NAME "file_cache"
22 #define FILE_CACHE_SEQUENTIAL_ACCESS 0x01
23 #define FILE_CACHE_LOADED_COMPLETELY 0x02
24 #define FILE_CACHE_NO_IO 0x04
26 struct cache_module_info
{
29 void (*node_opened
)(struct vnode
*vnode
, int32 fdType
, dev_t mountID
,
30 ino_t parentID
, ino_t vnodeID
, const char *name
, off_t size
);
31 void (*node_closed
)(struct vnode
*vnode
, int32 fdType
, dev_t mountID
,
32 ino_t vnodeID
, int32 accessType
);
33 void (*node_launched
)(size_t argCount
, char * const *args
);
40 extern void cache_node_opened(struct vnode
*vnode
, int32 fdType
, VMCache
*cache
,
41 dev_t mountID
, ino_t parentID
, ino_t vnodeID
, const char *name
);
42 extern void cache_node_closed(struct vnode
*vnode
, int32 fdType
, VMCache
*cache
,
43 dev_t mountID
, ino_t vnodeID
);
44 extern void cache_node_launched(size_t argCount
, char * const *args
);
45 extern void cache_prefetch_vnode(struct vnode
*vnode
, off_t offset
, size_t size
);
46 extern void cache_prefetch(dev_t mountID
, ino_t vnodeID
, off_t offset
, size_t size
);
48 extern status_t
file_map_init(void);
49 extern status_t
file_cache_init_post_boot_device(void);
50 extern status_t
file_cache_init(void);
56 #endif /* _KRENEL_FILE_CACHE_H */