mirror of
https://github.com/genodelabs/genode.git
synced 2025-04-10 12:51:34 +00:00
parent
d8211b65a5
commit
f91ece78e0
@ -54,6 +54,7 @@ SRC_NOLINK += bufq_disksort.c compat.c devnull.c genfs_vfsops.c \
|
||||
bufq_readprio.c devnodes.c genfs_rename.c kern_module_vfs.c rumpblk.c \
|
||||
rumpvfs_syscalls.c subr_kobj_vfs.c vfs_bio.c vfs_getcwd.c \
|
||||
vfs_lookup.c vfs_syscalls_50.c vfs_vnops.c
|
||||
SRC_NOLINK += sync_thread.c
|
||||
|
||||
|
||||
INC_DIR += $(RUMP_PORT_DIR)/src/sys/rump/librump/rumpkern/opt
|
||||
@ -67,6 +68,7 @@ vpath %.c $(RUMP_PORT_DIR)/src/sys/miscfs/syncfs
|
||||
vpath %.c $(RUMP_PORT_DIR)/src/sys/ufs/mfs
|
||||
vpath %.c $(RUMP_PORT_DIR)/src/sys/ufs/ufs
|
||||
vpath %.c $(RUMP_PORT_DIR)/src/sys/uvm
|
||||
vpath %.c $(REP_DIR)/src/lib/rump
|
||||
|
||||
|
||||
#
|
||||
|
25
repos/dde_rump/patches/sync.patch
Normal file
25
repos/dde_rump/patches/sync.patch
Normal file
@ -0,0 +1,25 @@
|
||||
diff --git a/src/sys/rump/librump/rumpkern/rump.c b/src/sys/rump/librump/rumpkern/rump.c
|
||||
index 24466eb..031906e 100644
|
||||
--- src/lib/dde_rump/src/sys/rump/librump/rumpkern/rump.c
|
||||
+++ src/lib/dde_rump/src/sys/rump/librump/rumpkern/rump.c
|
||||
@@ -209,6 +209,8 @@ RUMP_COMPONENT(RUMP_COMPONENT_POSTINIT)
|
||||
}
|
||||
#endif
|
||||
|
||||
+void genode_sync_thread(void *);
|
||||
+
|
||||
int
|
||||
rump_init(void)
|
||||
{
|
||||
@@ -468,6 +470,11 @@ rump_init(void)
|
||||
rump_consdev_init();
|
||||
rump_lwproc_switch(NULL);
|
||||
|
||||
+ /* start the Genode sync thread */
|
||||
+ if (kthread_create(PRI_IOFLUSH, KTHREAD_MPSAFE, NULL,
|
||||
+ genode_sync_thread, NULL, NULL, "genode_sync_thread") != 0)
|
||||
+ panic("Genode syncer thread create failed");
|
||||
+
|
||||
/* release cpu */
|
||||
rump_unschedule();
|
||||
|
@ -1 +1 @@
|
||||
9afe5679a00a8df0f3c5a9a5838956dc993f1b0a
|
||||
bb358512dc48cc6c2221de4e3fe105ed0a3ed847
|
||||
|
@ -14,4 +14,4 @@ URL(libc) := https://github.com/justincormack/netbsd-src/trunk/src/common/lib/li
|
||||
REV(libc) := HEAD
|
||||
DIR(libc) := src/lib/libc
|
||||
|
||||
PATCHES := patches/rump.patch patches/aarch64.patch
|
||||
PATCHES := patches/rump.patch patches/aarch64.patch patches/sync.patch
|
||||
|
@ -5,7 +5,7 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2014-2017 Genode Labs GmbH
|
||||
* Copyright (C) 2014-2022 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU Affero General Public License version 3.
|
||||
@ -34,7 +34,7 @@ void rump_io_backend_init();
|
||||
/**
|
||||
* Sync I/O back-end with underlying Genode subsystems
|
||||
*/
|
||||
void rump_io_backend_sync();
|
||||
extern "C" void rump_io_backend_sync();
|
||||
|
||||
/**
|
||||
* Return true if an I/O backend-request is pending
|
||||
|
33
repos/dde_rump/src/lib/rump/sync_thread.c
Normal file
33
repos/dde_rump/src/lib/rump/sync_thread.c
Normal file
@ -0,0 +1,33 @@
|
||||
/*
|
||||
* \brief Rump kernel thread which syncs the file system every 10s
|
||||
* \author Christian Prochaska
|
||||
* \date 2022-04-08
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2022 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU Affero General Public License version 3.
|
||||
*/
|
||||
|
||||
#include <sys/cpu.h>
|
||||
#include <sys/param.h>
|
||||
#include <sys/vfs_syscalls.h>
|
||||
#include <rump/rumpuser.h>
|
||||
|
||||
extern void rump_io_backend_sync();
|
||||
|
||||
void genode_sync_thread(void *arg)
|
||||
{
|
||||
for (;;) {
|
||||
/* sleep for 10 seconds */
|
||||
rumpuser_clock_sleep(RUMPUSER_CLOCK_RELWALL, 10, 0);
|
||||
|
||||
/* sync through front-end */
|
||||
do_sys_sync(curlwp);
|
||||
|
||||
/* sync Genode back-end */
|
||||
rump_io_backend_sync();
|
||||
}
|
||||
}
|
@ -7,7 +7,7 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2014-2018 Genode Labs GmbH
|
||||
* Copyright (C) 2014-2022 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU Affero General Public License version 3.
|
||||
@ -18,7 +18,6 @@
|
||||
#include <rump_fs/fs.h>
|
||||
#include <vfs/file_system_factory.h>
|
||||
#include <vfs/vfs_handle.h>
|
||||
#include <timer_session/connection.h>
|
||||
#include <os/path.h>
|
||||
|
||||
extern "C" {
|
||||
@ -846,19 +845,10 @@ class Vfs::Rump_file_system : public File_system
|
||||
|
||||
class Rump_factory : public Vfs::File_system_factory
|
||||
{
|
||||
private:
|
||||
|
||||
Timer::Connection _timer;
|
||||
Genode::Io_signal_handler<Rump_factory> _sync_handler;
|
||||
|
||||
void _sync() { _rump_sync(); }
|
||||
|
||||
public:
|
||||
|
||||
Rump_factory(Genode::Env &env, Genode::Allocator &alloc,
|
||||
Genode::Xml_node config)
|
||||
: _timer(env, "rump-sync"),
|
||||
_sync_handler(env.ep(), *this, &Rump_factory::_sync)
|
||||
{
|
||||
Rump::construct_env(env);
|
||||
|
||||
@ -892,12 +882,6 @@ class Rump_factory : public Vfs::File_system_factory
|
||||
rlim.rlim_cur = rlim.rlim_max;
|
||||
rump_sys_setrlimit(RLIMIT_NOFILE, &rlim);
|
||||
}
|
||||
|
||||
/* start syncing */
|
||||
enum { TEN_SEC = 10*1000*1000 };
|
||||
_timer.sigh(_sync_handler);
|
||||
_timer.trigger_periodic(TEN_SEC);
|
||||
|
||||
}
|
||||
|
||||
Vfs::File_system *create(Vfs::Env &env, Genode::Xml_node config) override
|
||||
|
Loading…
x
Reference in New Issue
Block a user