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
|
@ -93,6 +93,10 @@ class Ram_fs::Session_component : public File_system::Session_rpc_object
|
||||||
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,6 +117,7 @@ class Ram_fs::Session_component : public File_system::Session_rpc_object
|
||||||
if (!node.valid())
|
if (!node.valid())
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
if (_writeable == Session_writeable::WRITEABLE)
|
||||||
packet.with_timestamp([&] (File_system::Timestamp const time) {
|
packet.with_timestamp([&] (File_system::Timestamp const time) {
|
||||||
node->update_modification_time(time);
|
node->update_modification_time(time);
|
||||||
succeeded = true;
|
succeeded = true;
|
||||||
|
|
Loading…
Reference in New Issue