From 2f33d44713988cd07b177b9cd5ba82918097505a Mon Sep 17 00:00:00 2001 From: Emery Hemingway Date: Mon, 18 Feb 2019 16:23:45 +0100 Subject: [PATCH] VFS: Configure File_system client buffer at runtime Make the size of the packet buffer at the VFS File_system client configurable. This allows larger reads to be completed in a single packet cycle. Example: Fix #3167 --- repos/os/src/lib/vfs/fs_file_system.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/repos/os/src/lib/vfs/fs_file_system.h b/repos/os/src/lib/vfs/fs_file_system.h index 2e2a3d2ed..f9c95bcf4 100644 --- a/repos/os/src/lib/vfs/fs_file_system.h +++ b/repos/os/src/lib/vfs/fs_file_system.h @@ -7,7 +7,7 @@ */ /* - * Copyright (C) 2012-2017 Genode Labs GmbH + * Copyright (C) 2012-2019 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. @@ -628,6 +628,13 @@ class Vfs::Fs_file_system : public File_system Genode::Io_signal_handler _ready_handler { _env.env().ep(), *this, &Fs_file_system::_ready_to_submit }; + static + Genode::size_t buffer_size(Genode::Xml_node const &config) + { + Genode::Number_of_bytes fs_default { ::File_system::DEFAULT_TX_BUF_SIZE }; + return config.attribute_value("buffer_size", fs_default); + } + public: Fs_file_system(Vfs::Env &env, Genode::Xml_node config) @@ -638,7 +645,7 @@ class Vfs::Fs_file_system : public File_system _fs(_env.env(), _fs_packet_alloc, _label.string(), _root.string(), config.attribute_value("writeable", true), - ::File_system::DEFAULT_TX_BUF_SIZE) + buffer_size(config)) { _fs.sigh_ack_avail(_ack_handler); _fs.sigh_ready_to_submit(_ready_handler);