1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 08:08:12 +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

@ -1,12 +1,12 @@
#pragma once
#include <AK/String.h>
#include <AK/Badge.h>
#include <AK/Function.h>
#include <AK/HashMap.h>
#include <AK/NonnullOwnPtrVector.h>
#include <AK/OwnPtr.h>
#include <AK/RefPtr.h>
#include <AK/String.h>
#include <Kernel/FileSystem/FileSystem.h>
#include <Kernel/FileSystem/InodeIdentifier.h>
#include <Kernel/FileSystem/InodeMetadata.h>
@ -41,7 +41,7 @@ class VFS {
public:
class Mount {
public:
Mount(FS&, Custody* host_custody);
Mount(FS&, Custody* host_custody, int flags);
InodeIdentifier host() const;
InodeIdentifier guest() const { return m_guest; }
@ -50,11 +50,14 @@ public:
String absolute_path() const;
int flags() const { return m_flags; }
private:
InodeIdentifier m_host;
InodeIdentifier m_guest;
NonnullRefPtr<FS> m_guest_fs;
RefPtr<Custody> m_host_custody;
int m_flags;
};
static VFS& the();
@ -63,7 +66,7 @@ public:
~VFS();
bool mount_root(FS&);
KResult mount(FS&, Custody& mount_point);
KResult mount(FS&, Custody& mount_point, int flags);
KResult unmount(InodeIdentifier guest_inode_id);
KResultOr<NonnullRefPtr<FileDescription>> open(StringView path, int options, mode_t mode, Custody& base, Optional<UidAndGid> = {});