mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-26 09:30:24 +00:00
Add a "syncd" kernel process that periodically calls sync().
This commit is contained in:
parent
ed7ae6c02c
commit
89040cdc99
Notes:
sideshowbarker
2024-07-19 16:07:54 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/89040cdc99d
3 changed files with 13 additions and 1 deletions
|
@ -44,7 +44,7 @@ void initialize()
|
|||
kprintf("syscall: int 0x80 handler installed\n");
|
||||
}
|
||||
|
||||
static int sync()
|
||||
int sync()
|
||||
{
|
||||
VFS::the().sync();
|
||||
return 0;
|
||||
|
|
|
@ -103,6 +103,7 @@ struct SC_mmap_params {
|
|||
};
|
||||
|
||||
void initialize();
|
||||
int sync();
|
||||
|
||||
inline dword invoke(Function function)
|
||||
{
|
||||
|
|
|
@ -167,6 +167,15 @@ static void spawn_stress()
|
|||
}
|
||||
#endif
|
||||
|
||||
static void syncd() NORETURN;
|
||||
static void syncd()
|
||||
{
|
||||
for (;;) {
|
||||
Syscall::sync();
|
||||
sleep(10 * TICKS_PER_SECOND);
|
||||
}
|
||||
}
|
||||
|
||||
static void init_stage2() NORETURN;
|
||||
static void init_stage2()
|
||||
{
|
||||
|
@ -285,6 +294,8 @@ void init()
|
|||
Process::initialize();
|
||||
Process::create_kernel_process(init_stage2, "init_stage2");
|
||||
|
||||
Process::create_kernel_process(syncd, "syncd");
|
||||
|
||||
Scheduler::pick_next();
|
||||
|
||||
sti();
|
||||
|
|
Loading…
Reference in a new issue