From 201bfabdac3dd18fc67935d4afdc9922746d93d1 Mon Sep 17 00:00:00 2001 From: Christian Prochaska Date: Mon, 16 Jan 2017 17:04:28 +0100 Subject: [PATCH] os/include/file_system_session: API transition (fix 'deprecated' warnings) ...and adaptation of the users of 'File_system::Session_rpc_object' to the modified interface. Issue #1987 --- repos/dde_rump/src/server/rump_fs/main.cc | 4 +-- repos/libports/src/server/ffat_fs/main.cc | 14 +++++--- .../src/server/fuse_fs/fuse_fs_main.cc | 19 ++++++----- .../include/file_system_session/rpc_object.h | 5 +-- repos/os/src/server/lx_fs/main.cc | 4 +-- repos/os/src/server/ram_fs/main.cc | 16 +++++---- repos/os/src/server/trace_fs/main.cc | 34 +++++++++---------- repos/os/src/server/trace_fs/target.mk | 2 +- repos/os/src/server/vfs/main.cc | 2 +- 9 files changed, 55 insertions(+), 45 deletions(-) diff --git a/repos/dde_rump/src/server/rump_fs/main.cc b/repos/dde_rump/src/server/rump_fs/main.cc index 39e5c48d25..2619d001b9 100644 --- a/repos/dde_rump/src/server/rump_fs/main.cc +++ b/repos/dde_rump/src/server/rump_fs/main.cc @@ -6,7 +6,7 @@ */ /* - * Copyright (C) 2014-2016 Genode Labs GmbH + * Copyright (C) 2014-2017 Genode Labs GmbH * * This file is part of the Genode OS framework, which is distributed * under the terms of the GNU General Public License version 2. @@ -154,7 +154,7 @@ class File_system::Session_component : public Session_rpc_object bool writeable, Allocator &md_alloc) : - Session_rpc_object(env.ram().alloc(tx_buf_size), env.ep().rpc_ep()), + Session_rpc_object(env.ram().alloc(tx_buf_size), env.rm(), env.ep().rpc_ep()), _md_alloc(md_alloc), _root(*new (&_md_alloc) Directory(_md_alloc, root_dir, false)), _writable(writeable), diff --git a/repos/libports/src/server/ffat_fs/main.cc b/repos/libports/src/server/ffat_fs/main.cc index 7da8252c25..fff1c3f370 100644 --- a/repos/libports/src/server/ffat_fs/main.cc +++ b/repos/libports/src/server/ffat_fs/main.cc @@ -5,7 +5,7 @@ */ /* - * Copyright (C) 2012-2016 Genode Labs GmbH + * Copyright (C) 2012-2017 Genode Labs GmbH * * This file is part of the Genode OS framework, which is distributed * under the terms of the GNU General Public License version 2. @@ -168,10 +168,11 @@ namespace File_system { * Constructor */ Session_component(size_t tx_buf_size, Rpc_entrypoint &ep, + Region_map &rm, Signal_receiver &sig_rec, Directory &root, bool writable) : - Session_rpc_object(env()->ram_session()->alloc(tx_buf_size), ep), + Session_rpc_object(env()->ram_session()->alloc(tx_buf_size), rm, ep), _root(root), _writable(writable), _process_packet_dispatcher(sig_rec, *this, @@ -821,6 +822,7 @@ namespace File_system { private: Rpc_entrypoint &_channel_ep; + Region_map &_rm; Signal_receiver &_sig_rec; Directory &_root_dir; @@ -936,7 +938,7 @@ namespace File_system { throw Root::Quota_exceeded(); } return new (md_alloc()) - Session_component(tx_buf_size, _channel_ep, _sig_rec, + Session_component(tx_buf_size, _channel_ep, _rm, _sig_rec, *session_root_dir, writeable); } @@ -951,10 +953,12 @@ namespace File_system { * \param md_alloc meta-data allocator */ Root(Rpc_entrypoint &session_ep, Allocator &md_alloc, + Region_map &rm, Signal_receiver &sig_rec, Directory &root_dir) : Root_component(&session_ep, &md_alloc), - _channel_ep(session_ep), _sig_rec(sig_rec), _root_dir(root_dir) + _channel_ep(session_ep), _rm(rm), _sig_rec(sig_rec), + _root_dir(root_dir) { } }; }; @@ -981,7 +985,7 @@ int main(int, char **) static Directory root_dir("/"); - static File_system::Root root(ep, sliced_heap, sig_rec, root_dir); + static File_system::Root root(ep, sliced_heap, *env()->rm_session(), sig_rec, root_dir); env()->parent()->announce(ep.manage(&root)); diff --git a/repos/libports/src/server/fuse_fs/fuse_fs_main.cc b/repos/libports/src/server/fuse_fs/fuse_fs_main.cc index 942fb313f2..1d23d1b088 100644 --- a/repos/libports/src/server/fuse_fs/fuse_fs_main.cc +++ b/repos/libports/src/server/fuse_fs/fuse_fs_main.cc @@ -5,7 +5,7 @@ */ /* - * Copyright (C) 2013-2016 Genode Labs GmbH + * Copyright (C) 2013-2017 Genode Labs GmbH * * This file is part of the Genode OS framework, which is distributed * under the terms of the GNU General Public License version 2. @@ -159,11 +159,12 @@ class File_system::Session_component : public Session_rpc_object */ Session_component(size_t tx_buf_size, Genode::Entrypoint &ep, + Genode::Region_map &rm, char const *root_dir, bool writeable, Allocator &md_alloc) : - Session_rpc_object(env()->ram_session()->alloc(tx_buf_size), ep.rpc_ep()), + Session_rpc_object(env()->ram_session()->alloc(tx_buf_size), rm, ep.rpc_ep()), _ep(ep), _md_alloc(md_alloc), _root(*new (&_md_alloc) Directory(_md_alloc, root_dir, false)), @@ -409,6 +410,7 @@ class File_system::Root : public Root_component private: Genode::Entrypoint &_ep; + Genode::Region_map &_rm; protected: @@ -488,7 +490,7 @@ class File_system::Root : public Root_component throw Root::Quota_exceeded(); } return new (md_alloc()) - Session_component(tx_buf_size, _ep, root_dir, writeable, *md_alloc()); + Session_component(tx_buf_size, _ep, _rm, root_dir, writeable, *md_alloc()); } public: @@ -501,10 +503,10 @@ class File_system::Root : public Root_component * data-flow signals of packet streams * \param md_alloc meta-data allocator */ - Root(Genode::Entrypoint &ep, Allocator &md_alloc) + Root(Genode::Entrypoint &ep, Allocator &md_alloc, Genode::Region_map &rm) : Root_component(&ep.rpc_ep(), &md_alloc), - _ep(ep) + _ep(ep), _rm(rm) { } }; @@ -512,15 +514,16 @@ class File_system::Root : public Root_component struct File_system::Main { Genode::Entrypoint &ep; + Genode::Region_map &rm; /* * Initialize root interface */ Sliced_heap sliced_heap = { env()->ram_session(), env()->rm_session() }; - Root fs_root = { ep, sliced_heap }; + Root fs_root = { ep, sliced_heap, rm }; - Main(Genode::Entrypoint &ep) : ep(ep) + Main(Genode::Entrypoint &ep, Genode::Region_map &rm) : ep(ep), rm(rm) { if (!Fuse::init_fs()) { Genode::error("FUSE fs initialization failed"); @@ -545,6 +548,6 @@ struct File_system::Main void Libc::Component::construct(Libc::Env &env) { - static File_system::Main inst(env.ep()); + static File_system::Main inst(env.ep(), env.rm()); } diff --git a/repos/os/include/file_system_session/rpc_object.h b/repos/os/include/file_system_session/rpc_object.h index 0dbbb9c213..dfd7f18b1b 100644 --- a/repos/os/include/file_system_session/rpc_object.h +++ b/repos/os/include/file_system_session/rpc_object.h @@ -5,7 +5,7 @@ */ /* - * Copyright (C) 2012-2013 Genode Labs GmbH + * Copyright (C) 2012-2017 Genode Labs GmbH * * This file is part of the Genode OS framework, which is distributed * under the terms of the GNU General Public License version 2. @@ -36,8 +36,9 @@ class File_system::Session_rpc_object : public Genode::Rpc_objectrm_session(), ep) { } + : _tx(tx_ds, rm, ep) { } /** * Return capability to packet-stream channel diff --git a/repos/os/src/server/lx_fs/main.cc b/repos/os/src/server/lx_fs/main.cc index 542f49fe42..7e0963f7e3 100644 --- a/repos/os/src/server/lx_fs/main.cc +++ b/repos/os/src/server/lx_fs/main.cc @@ -5,7 +5,7 @@ */ /* - * Copyright (C) 2012-2016 Genode Labs GmbH + * Copyright (C) 2012-2017 Genode Labs GmbH * * This file is part of the Genode OS framework, which is distributed * under the terms of the GNU General Public License version 2. @@ -154,7 +154,7 @@ class File_system::Session_component : public Session_rpc_object bool writable, Allocator &md_alloc) : - Session_rpc_object(env.ram().alloc(tx_buf_size), env.ep().rpc_ep()), + Session_rpc_object(env.ram().alloc(tx_buf_size), env.rm(), env.ep().rpc_ep()), _env(env), _md_alloc(md_alloc), _root(*new (&_md_alloc) Directory(_md_alloc, root_dir, false)), diff --git a/repos/os/src/server/ram_fs/main.cc b/repos/os/src/server/ram_fs/main.cc index ea59904884..dacf574dd0 100644 --- a/repos/os/src/server/ram_fs/main.cc +++ b/repos/os/src/server/ram_fs/main.cc @@ -5,7 +5,7 @@ */ /* - * Copyright (C) 2012-2016 Genode Labs GmbH + * Copyright (C) 2012-2017 Genode Labs GmbH * * This file is part of the Genode OS framework, which is distributed * under the terms of the GNU General Public License version 2. @@ -149,9 +149,10 @@ class File_system::Session_component : public Session_rpc_object * Constructor */ Session_component(size_t tx_buf_size, Genode::Entrypoint &ep, + Genode::Region_map &rm, Directory &root, bool writable) : - Session_rpc_object(env()->ram_session()->alloc(tx_buf_size), ep.rpc_ep()), + Session_rpc_object(env()->ram_session()->alloc(tx_buf_size), rm, ep.rpc_ep()), _ep(ep), _root(root), _writable(writable), @@ -417,6 +418,7 @@ class File_system::Root : public Root_component private: Genode::Entrypoint &_ep; + Genode::Region_map &_rm; Genode::Xml_node const _config; Directory &_root_dir; @@ -501,7 +503,7 @@ class File_system::Root : public Root_component throw Root::Quota_exceeded(); } return new (md_alloc()) - Session_component(tx_buf_size, _ep, *session_root_dir, writeable); + Session_component(tx_buf_size, _ep, _rm, *session_root_dir, writeable); } public: @@ -513,11 +515,11 @@ class File_system::Root : public Root_component * \param md_alloc meta-data allocator * \param root_dir root-directory handle (anchor for fs) */ - Root(Genode::Entrypoint &ep, Genode::Xml_node config, - Allocator &md_alloc, Directory &root_dir) + Root(Genode::Entrypoint &ep, Genode::Region_map &rm, + Genode::Xml_node config, Allocator &md_alloc, Directory &root_dir) : Root_component(&ep.rpc_ep(), &md_alloc), - _ep(ep), _config(config), _root_dir(root_dir) + _ep(ep), _rm(rm), _config(config), _root_dir(root_dir) { } }; @@ -637,7 +639,7 @@ struct File_system::Main */ Genode::Sliced_heap _sliced_heap { _env.ram(), _env.rm() }; - Root _fs_root { _env.ep(), _config.xml(), _sliced_heap, _root_dir }; + Root _fs_root { _env.ep(), _env.rm(), _config.xml(), _sliced_heap, _root_dir }; Genode::Heap _heap { _env.ram(), _env.rm() }; diff --git a/repos/os/src/server/trace_fs/main.cc b/repos/os/src/server/trace_fs/main.cc index b7fb36b768..a64dacb178 100644 --- a/repos/os/src/server/trace_fs/main.cc +++ b/repos/os/src/server/trace_fs/main.cc @@ -5,13 +5,14 @@ */ /* - * Copyright (C) 2014-2016 Genode Labs GmbH + * Copyright (C) 2014-2017 Genode Labs GmbH * * This file is part of the Genode OS framework, which is distributed * under the terms of the GNU General Public License version 2. */ /* Genode includes */ +#include #include #include #include @@ -606,6 +607,7 @@ class File_system::Session_component : public Session_rpc_object private: Server::Entrypoint &_ep; + Genode::Region_map &_rm; Allocator &_md_alloc; Directory &_root_dir; Node_handle_registry _handle_registry; @@ -738,6 +740,7 @@ class File_system::Session_component : public Session_rpc_object */ Session_component(size_t tx_buf_size, Server::Entrypoint &ep, + Genode::Region_map &rm, File_system::Directory &root_dir, Allocator &md_alloc, unsigned subject_limit, @@ -748,8 +751,9 @@ class File_system::Session_component : public Session_rpc_object size_t buffer_size, size_t buffer_size_max) : - Session_rpc_object(env()->ram_session()->alloc(tx_buf_size), ep.rpc_ep()), + Session_rpc_object(env()->ram_session()->alloc(tx_buf_size), _rm, ep.rpc_ep()), _ep(ep), + _rm(rm), _md_alloc(md_alloc), _root_dir(root_dir), _subject_limit(subject_limit), @@ -905,6 +909,7 @@ class File_system::Root : public Root_component private: Server::Entrypoint &_ep; + Genode::Region_map &_rm; Directory &_root_dir; @@ -1003,7 +1008,7 @@ class File_system::Root : public Root_component throw Root::Quota_exceeded(); } return new (md_alloc()) - Session_component(tx_buf_size, _ep, _root_dir, *md_alloc(), + Session_component(tx_buf_size, _ep, _rm, _root_dir, *md_alloc(), subject_limit, interval, trace_quota, trace_meta_quota, trace_parent_levels, buffer_size, buffer_size_max); @@ -1019,10 +1024,12 @@ class File_system::Root : public Root_component * data-flow signals of packet streams * \param md_alloc meta-data allocator */ - Root(Server::Entrypoint &ep, Allocator &md_alloc, Directory &root_dir) + Root(Server::Entrypoint &ep, Allocator &md_alloc, Region_map &rm, + Directory &root_dir) : Root_component(&ep.rpc_ep(), &md_alloc), _ep(ep), + _rm(rm), _root_dir(root_dir) { } }; @@ -1030,28 +1037,21 @@ class File_system::Root : public Root_component struct File_system::Main { - Server::Entrypoint &ep; + Env &_env; Directory root_dir = { "/" }; /* * Initialize root interface */ - Sliced_heap sliced_heap = { env()->ram_session(), env()->rm_session() }; + Sliced_heap sliced_heap = { _env.ram(), _env.rm() }; - Root fs_root = { ep, sliced_heap, root_dir }; + Root fs_root = { _env.ep(), sliced_heap, _env.rm(), root_dir }; - Main(Server::Entrypoint &ep) : ep(ep) + Main(Env &env) : _env(env) { - env()->parent()->announce(ep.manage(fs_root)); + env.parent().announce(env.ep().manage(fs_root)); } }; - -/********************** - ** Server framework ** - **********************/ - -char const * Server::name() { return "trace_fs_ep"; } -Genode::size_t Server::stack_size() { return 64*1024*sizeof(long); } -void Server::construct(Server::Entrypoint &ep) { static File_system::Main inst(ep); } +void Component::construct(Genode::Env &env) { static File_system::Main main(env); } diff --git a/repos/os/src/server/trace_fs/target.mk b/repos/os/src/server/trace_fs/target.mk index bb80dc63f1..3e5592ceec 100644 --- a/repos/os/src/server/trace_fs/target.mk +++ b/repos/os/src/server/trace_fs/target.mk @@ -1,4 +1,4 @@ TARGET = trace_fs SRC_CC = main.cc -LIBS = base config server +LIBS = base config INC_DIR += $(PRG_DIR) diff --git a/repos/os/src/server/vfs/main.cc b/repos/os/src/server/vfs/main.cc index b2e7b63e78..1004a1261b 100644 --- a/repos/os/src/server/vfs/main.cc +++ b/repos/os/src/server/vfs/main.cc @@ -251,7 +251,7 @@ class Vfs_server::Session_component : char const *root_path, bool writable) : - Session_rpc_object(env.ram().alloc(tx_buf_size), env.ep().rpc_ep()), + Session_rpc_object(env.ram().alloc(tx_buf_size), env.rm(), env.ep().rpc_ep()), _label(label), _process_packet_dispatcher(env.ep(), *this, &Session_component::_process_packets), _vfs(vfs),