Reduce Vfs::Vfs_handle::Context to empty struct type

The "Vfs::Vfs_handle" type should not contain any public members that
can be initialized by the VFS internally and by the application, so
remove inheritance from the "Genode::list::Element" class. The VFS
plugins must instead use lists of "Vfs::Vfs_handle" sub-classes, the
lifetime of which are always managed by the plugin.

Ref #3036
This commit is contained in:
Emery Hemingway
2018-11-11 23:47:15 +01:00
committed by Norman Feske
parent 260fc30be3
commit 800b4e44b1
10 changed files with 65 additions and 59 deletions

View File

@ -314,7 +314,7 @@ class Vfs::Dir_file_system : public File_system
vfs_handle.seek(index * sizeof(Dirent));
/* forward the handle context */
vfs_handle.context = dir_vfs_handle->context;
vfs_handle.context(dir_vfs_handle->context());
result = vfs_handle.fs().queue_read(&vfs_handle, sizeof(Dirent));
}
@ -951,7 +951,7 @@ class Vfs::Dir_file_system : public File_system
auto f = [&result, dir_vfs_handle] (Dir_vfs_handle::Subdir_handle_element &e) {
/* forward the handle context */
e.vfs_handle.context = dir_vfs_handle->context;
e.vfs_handle.context(dir_vfs_handle->context());
e.synced = false;
if (!e.vfs_handle.fs().queue_sync(&e.vfs_handle)) {