mirror of
https://github.com/genodelabs/genode.git
synced 2025-01-18 18:56:29 +00:00
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:
parent
573b6d3345
commit
6e098a9d17
@ -92,7 +92,11 @@ class Ram_fs::Session_component : public File_system::Session_rpc_object
|
||||
if (packet.length() <= packet.size()) {
|
||||
Locked_ptr<Node> node { open_node.node() };
|
||||
if (!node.valid())
|
||||
break;
|
||||
break;
|
||||
|
||||
if (_writeable == Session_writeable::READ_ONLY)
|
||||
break;
|
||||
|
||||
res_length = node->write((char const *)tx_sink()->packet_content(packet),
|
||||
length, packet.position());
|
||||
|
||||
@ -113,10 +117,11 @@ class Ram_fs::Session_component : public File_system::Session_rpc_object
|
||||
if (!node.valid())
|
||||
break;
|
||||
|
||||
packet.with_timestamp([&] (File_system::Timestamp const time) {
|
||||
node->update_modification_time(time);
|
||||
succeeded = true;
|
||||
});
|
||||
if (_writeable == Session_writeable::WRITEABLE)
|
||||
packet.with_timestamp([&] (File_system::Timestamp const time) {
|
||||
node->update_modification_time(time);
|
||||
succeeded = true;
|
||||
});
|
||||
break;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user