ram_fs: apply session policy to write / mtime ops

This patch extends the distinction between read-only and writeable
sessions to packet-stream operations for WRITE and WRITE_TIMESTAMP.
This commit is contained in:
Norman Feske 2019-11-21 16:15:04 +01:00
parent 573b6d3345
commit 6e098a9d17
1 changed files with 10 additions and 5 deletions

View File

@ -93,6 +93,10 @@ class Ram_fs::Session_component : public File_system::Session_rpc_object
Locked_ptr<Node> node { open_node.node() };
if (!node.valid())
break;
if (_writeable == Session_writeable::READ_ONLY)
break;
res_length = node->write((char const *)tx_sink()->packet_content(packet),
length, packet.position());
@ -113,6 +117,7 @@ class Ram_fs::Session_component : public File_system::Session_rpc_object
if (!node.valid())
break;
if (_writeable == Session_writeable::WRITEABLE)
packet.with_timestamp([&] (File_system::Timestamp const time) {
node->update_modification_time(time);
succeeded = true;