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