btrfs: [] on the end of a struct field is a variable length array.
[haiku.git] / headers / private / kernel / file_cache.h
blob3e8fee2af6d3afb1f25f84933445ad9b1d533ea5
1 /*
2 * Copyright 2004-2008, Axel Dörfler, axeld@pinc-software.de.
3 * Distributed under the terms of the MIT License.
4 */
5 #ifndef _KERNEL_FILE_CACHE_H
6 #define _KERNEL_FILE_CACHE_H
9 #include <vfs.h>
10 #include <vm/vm_types.h>
11 #include <module.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 {
27 module_info 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);
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
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);
52 #ifdef __cplusplus
54 #endif
56 #endif /* _KRENEL_FILE_CACHE_H */