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

Kernel+LibC: Add support for mount flags

At the moment, the actual flags are ignored, but we correctly propagate them all
the way from the original mount() syscall to each custody that resides on the
mounted FS.
This commit is contained in:
Sergey Bugaev 2020-01-11 18:25:26 +03:00 committed by Andreas Kling
parent 1e6ab0ed22
commit 4566c2d811
10 changed files with 54 additions and 34 deletions

View file

@ -26,7 +26,7 @@ Custody* Custody::get_if_cached(Custody* parent, const StringView& name)
return nullptr;
}
NonnullRefPtr<Custody> Custody::get_or_create(Custody* parent, const StringView& name, Inode& inode)
NonnullRefPtr<Custody> Custody::get_or_create(Custody* parent, const StringView& name, Inode& inode, int mount_flags)
{
if (RefPtr<Custody> cached_custody = get_if_cached(parent, name)) {
if (&cached_custody->inode() != &inode) {
@ -35,13 +35,14 @@ NonnullRefPtr<Custody> Custody::get_or_create(Custody* parent, const StringView&
ASSERT(&cached_custody->inode() == &inode);
return *cached_custody;
}
return create(parent, name, inode);
return create(parent, name, inode, mount_flags);
}
Custody::Custody(Custody* parent, const StringView& name, Inode& inode)
Custody::Custody(Custody* parent, const StringView& name, Inode& inode, int mount_flags)
: m_parent(parent)
, m_name(name)
, m_inode(inode)
, m_mount_flags(mount_flags)
{
LOCKER(all_custodies().lock());
all_custodies().resource().append(this);