mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 11:28:12 +00:00
Kernel: Use a FixedArray for a process's extra GIDs
There's not really enough of these to justify using a HashTable.
This commit is contained in:
parent
e0ecfc0c92
commit
a7dbb3cf96
5 changed files with 42 additions and 12 deletions
|
@ -26,7 +26,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <AK/HashTable.h>
|
||||
#include <AK/FixedArray.h>
|
||||
#include <Kernel/FileSystem/InodeIdentifier.h>
|
||||
#include <Kernel/KResult.h>
|
||||
#include <Kernel/UnixTypes.h>
|
||||
|
@ -58,7 +58,7 @@ struct InodeMetadata {
|
|||
bool may_write(const Process&) const;
|
||||
bool may_execute(const Process&) const;
|
||||
|
||||
bool may_read(uid_t u, gid_t g, const HashTable<gid_t>& eg) const
|
||||
bool may_read(uid_t u, gid_t g, const FixedArray<gid_t>& eg) const
|
||||
{
|
||||
if (u == 0)
|
||||
return true;
|
||||
|
@ -69,7 +69,7 @@ struct InodeMetadata {
|
|||
return mode & 0004;
|
||||
}
|
||||
|
||||
bool may_write(uid_t u, gid_t g, const HashTable<gid_t>& eg) const
|
||||
bool may_write(uid_t u, gid_t g, const FixedArray<gid_t>& eg) const
|
||||
{
|
||||
if (u == 0)
|
||||
return true;
|
||||
|
@ -80,7 +80,7 @@ struct InodeMetadata {
|
|||
return mode & 0002;
|
||||
}
|
||||
|
||||
bool may_execute(uid_t u, gid_t g, const HashTable<gid_t>& eg) const
|
||||
bool may_execute(uid_t u, gid_t g, const FixedArray<gid_t>& eg) const
|
||||
{
|
||||
if (u == 0)
|
||||
return true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue