From 1c67e3bb43d264a44b86aff82a006158190ea688 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josef=20S=C3=B6ntgen?= Date: Mon, 16 Dec 2013 16:46:00 +0100 Subject: [PATCH] os: extentend File_system interface with sync RPC Users of a File_system_session might want to force a file system to flush or rather to synchronize its internal cache. A concret default implementation is provided because not all file systems maintain an internal cache and are not required to synchronize caches. Fixes #1007. --- os/include/file_system_session/client.h | 5 +++++ .../file_system_session/file_system_session.h | 13 ++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/os/include/file_system_session/client.h b/os/include/file_system_session/client.h index c3279a6c61..3c52caab5f 100644 --- a/os/include/file_system_session/client.h +++ b/os/include/file_system_session/client.h @@ -104,6 +104,11 @@ namespace File_system { { call(node, sigh); } + + void sync() + { + call(); + } }; } diff --git a/os/include/file_system_session/file_system_session.h b/os/include/file_system_session/file_system_session.h index 6bf0452eb3..fd647ec872 100644 --- a/os/include/file_system_session/file_system_session.h +++ b/os/include/file_system_session/file_system_session.h @@ -280,6 +280,15 @@ namespace File_system { */ virtual void sigh(Node_handle, Signal_context_capability sigh) = 0; + /** + * Synchronize file system + * + * This is only needed by file systems that maintain an internal + * cache, which needs to be flushed on certain occasions. Therefore, + * the default implementation just serves as a reminder. + */ + virtual void sync() { PWRN("sync() not implemented!"); } + /******************* ** RPC interface ** @@ -317,6 +326,7 @@ namespace File_system { GENODE_RPC_THROW(Rpc_sigh, void, sigh, GENODE_TYPE_LIST(Invalid_handle), Node_handle, Signal_context_capability); + GENODE_RPC(Rpc_sync, void, sync); /* * Manual type-list definition, needed because the RPC interface @@ -335,8 +345,9 @@ namespace File_system { Meta::Type_tuple - > > > > > > > > > > > Rpc_functions; + > > > > > > > > > > > > Rpc_functions; }; }