mirror of
https://github.com/genodelabs/genode.git
synced 2025-06-11 20:01:48 +00:00
vfs server: remove special case of rootdir handles
With this patch, the VFS server returns distinguishable IDs when opening the root directory multiple times.
This commit is contained in:
committed by
Christian Helmuth
parent
5f65791962
commit
e4fa8e8fcf
@ -421,11 +421,9 @@ class Vfs_server::Session_component : public File_system::Session_rpc_object,
|
|||||||
throw Permission_denied();
|
throw Permission_denied();
|
||||||
|
|
||||||
char const *path_str = path.string();
|
char const *path_str = path.string();
|
||||||
/* '/' is bound to '0' */
|
|
||||||
if (!strcmp(path_str, "/")) {
|
if (!strcmp(path_str, "/") && create)
|
||||||
if (create) throw Node_already_exists();
|
throw Node_already_exists();
|
||||||
return Dir_handle(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
_assert_valid_path(path_str);
|
_assert_valid_path(path_str);
|
||||||
Vfs_server::Path fullpath(_root->path());
|
Vfs_server::Path fullpath(_root->path());
|
||||||
@ -477,9 +475,6 @@ class Vfs_server::Session_component : public File_system::Session_rpc_object,
|
|||||||
Node_handle node(File_system::Path const &path) override
|
Node_handle node(File_system::Path const &path) override
|
||||||
{
|
{
|
||||||
char const *path_str = path.string();
|
char const *path_str = path.string();
|
||||||
/* '/' is bound to '0' */
|
|
||||||
if (!strcmp(path_str, "/"))
|
|
||||||
return Node_handle { 0 };
|
|
||||||
|
|
||||||
_assert_valid_path(path_str);
|
_assert_valid_path(path_str);
|
||||||
|
|
||||||
@ -501,8 +496,6 @@ class Vfs_server::Session_component : public File_system::Session_rpc_object,
|
|||||||
void close(Node_handle handle) override
|
void close(Node_handle handle) override
|
||||||
{
|
{
|
||||||
try { _apply(handle, [&] (Node &node) {
|
try { _apply(handle, [&] (Node &node) {
|
||||||
/* root directory should not be freed */
|
|
||||||
if (!(node.id() == _root->id()))
|
|
||||||
_close(node);
|
_close(node);
|
||||||
}); } catch (File_system::Invalid_handle) { }
|
}); } catch (File_system::Invalid_handle) { }
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user