server/vfs: add modification time

Issue #1784.
This commit is contained in:
Josef Söntgen 2019-04-09 16:25:53 +02:00 committed by Christian Helmuth
parent 180f9e6384
commit 99b632f86c
2 changed files with 15 additions and 0 deletions

View File

@ -512,6 +512,7 @@ class Vfs_server::Session_component : private Session_resources,
}
fs_stat.size = vfs_stat.size;
fs_stat.modification_time.value = vfs_stat.modification_time.value;
});
return fs_stat;
}

View File

@ -379,6 +379,20 @@ class Vfs_server::Io_node : public Vfs_server::Node,
/* discard this packet */
_drop_packet();
break;
case Packet_descriptor::WRITE_TIMESTAMP:
try {
_packet.with_timestamp([&] (File_system::Timestamp const time) {
Vfs::Timestamp ts { .value = time.value };
_handle.fs().update_modification_timestamp(&_handle, ts);
});
_packet.succeeded(true);
_ack_packet(0);
} catch (Vfs::File_io_service::Insufficient_buffer) {
/* packet is pending */
result = false;
}
break;
}
return result;