The file cache now has another init method that is called after the boot
device becomes available. Currently, it opens the "launch_speedup" module (if available), later it should consult a settings file for what to do. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13894 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -44,6 +44,7 @@ extern void cache_node_closed(void *vnode, int32 fdType, vm_cache_ref *cache,
|
|||||||
extern void cache_node_launched(size_t argCount, char * const *args);
|
extern void cache_node_launched(size_t argCount, char * const *args);
|
||||||
extern void cache_prefetch_vnode(void *vnode, off_t offset, size_t size);
|
extern void cache_prefetch_vnode(void *vnode, off_t offset, size_t size);
|
||||||
extern void cache_prefetch(mount_id mountID, vnode_id vnodeID, off_t offset, size_t size);
|
extern void cache_prefetch(mount_id mountID, vnode_id vnodeID, off_t offset, size_t size);
|
||||||
|
extern status_t file_cache_init_post_boot_device(void);
|
||||||
extern status_t file_cache_init(void);
|
extern status_t file_cache_init(void);
|
||||||
|
|
||||||
extern vm_store *vm_create_vnode_store(void *vnode);
|
extern vm_store *vm_create_vnode_store(void *vnode);
|
||||||
|
|||||||
+16
-4
@@ -898,7 +898,7 @@ extern "C" void
|
|||||||
cache_node_opened(void *vnode, int32 fdType, vm_cache_ref *cache, mount_id mountID,
|
cache_node_opened(void *vnode, int32 fdType, vm_cache_ref *cache, mount_id mountID,
|
||||||
vnode_id parentID, vnode_id vnodeID, const char *name)
|
vnode_id parentID, vnode_id vnodeID, const char *name)
|
||||||
{
|
{
|
||||||
if (sCacheModule == NULL)
|
if (sCacheModule == NULL || sCacheModule->node_opened == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
off_t size = -1;
|
off_t size = -1;
|
||||||
@@ -916,7 +916,7 @@ extern "C" void
|
|||||||
cache_node_closed(void *vnode, int32 fdType, vm_cache_ref *cache,
|
cache_node_closed(void *vnode, int32 fdType, vm_cache_ref *cache,
|
||||||
mount_id mountID, vnode_id vnodeID)
|
mount_id mountID, vnode_id vnodeID)
|
||||||
{
|
{
|
||||||
if (sCacheModule == NULL)
|
if (sCacheModule == NULL || sCacheModule->node_closed == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
int32 accessType = 0;
|
int32 accessType = 0;
|
||||||
@@ -931,7 +931,7 @@ cache_node_closed(void *vnode, int32 fdType, vm_cache_ref *cache,
|
|||||||
extern "C" void
|
extern "C" void
|
||||||
cache_node_launched(size_t argCount, char * const *args)
|
cache_node_launched(size_t argCount, char * const *args)
|
||||||
{
|
{
|
||||||
if (sCacheModule == NULL)
|
if (sCacheModule == NULL || sCacheModule->node_launched == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
sCacheModule->node_launched(argCount, args);
|
sCacheModule->node_launched(argCount, args);
|
||||||
@@ -939,10 +939,22 @@ cache_node_launched(size_t argCount, char * const *args)
|
|||||||
|
|
||||||
|
|
||||||
extern "C" status_t
|
extern "C" status_t
|
||||||
file_cache_init(void)
|
file_cache_init_post_boot_device(void)
|
||||||
{
|
{
|
||||||
// ToDo: get cache module out of driver settings
|
// ToDo: get cache module out of driver settings
|
||||||
|
|
||||||
|
if (get_module("file_cache/launch_speedup/v1", (module_info **)&sCacheModule) == B_OK) {
|
||||||
|
dprintf("** opened launch speedup\n");
|
||||||
|
} else
|
||||||
|
dprintf("** could not open launch speedup!\n");
|
||||||
|
|
||||||
|
return B_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
extern "C" status_t
|
||||||
|
file_cache_init(void)
|
||||||
|
{
|
||||||
register_generic_syscall(CACHE_SYSCALLS, file_cache_control, 1, 0);
|
register_generic_syscall(CACHE_SYSCALLS, file_cache_control, 1, 0);
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2867,6 +2867,7 @@ vfs_mount_boot_file_system(kernel_args *args)
|
|||||||
_kern_create_symlink(-1, path, "/boot", 0);
|
_kern_create_symlink(-1, path, "/boot", 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
file_cache_init_post_boot_device();
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user