1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 12:48:10 +00:00

Kernel: Don't allocate Strings unnecessarily in process veil validation

Previously, Custody::absolute_path() was called for every call to
validate_path_against_process_veil(). For processes that don't have a
veil, the path is not used by the function. This means that it is
unnecessarily generated. This introduces an overload to
validate_path_against_process_veil(), which takes a Custody const& and
only generates the absolute path if it there is actually a veil and it
is thus needed.

This patch results in a speed up of Assistant's file system cache
building by around 16 percent.
This commit is contained in:
Max Wipfli 2021-07-05 17:15:07 +02:00 committed by Andreas Kling
parent 557424a141
commit 3c0272126e
2 changed files with 10 additions and 2 deletions

View file

@ -103,6 +103,7 @@ private:
friend class FileDescription;
UnveilNode const& find_matching_unveiled_path(StringView path);
KResult validate_path_against_process_veil(Custody const& path, int options);
KResult validate_path_against_process_veil(StringView path, int options);
bool is_vfs_root(InodeIdentifier) const;