1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 16:27:35 +00:00

Kernel: Split VMObject into two classes: Anonymous- and InodeVMObject

InodeVMObject is a VMObject with an underlying Inode in the filesystem.
AnonymousVMObject has no Inode.

I'm happy that InodeVMObject::inode() can now return Inode& instead of
VMObject::inode() return Inode*. :^)
This commit is contained in:
Andreas Kling 2019-08-07 18:06:17 +02:00
parent cb2d572a14
commit 6bdb81ad87
16 changed files with 286 additions and 200 deletions

View file

@ -11,9 +11,9 @@
#include <Kernel/Lock.h>
class FileDescription;
class InodeVMObject;
class InodeWatcher;
class LocalSocket;
class VMObject;
class Inode : public RefCounted<Inode>, public Weakable<Inode> {
friend class VFS;
@ -69,8 +69,8 @@ public:
void will_be_destroyed();
void set_vmo(VMObject&);
VMObject* vmo() { return m_vmo.ptr(); }
const VMObject* vmo() const { return m_vmo.ptr(); }
InodeVMObject* vmo() { return m_vmo.ptr(); }
const InodeVMObject* vmo() const { return m_vmo.ptr(); }
static void sync();
@ -88,7 +88,7 @@ protected:
private:
FS& m_fs;
unsigned m_index { 0 };
WeakPtr<VMObject> m_vmo;
WeakPtr<InodeVMObject> m_vmo;
RefPtr<LocalSocket> m_socket;
HashTable<InodeWatcher*> m_watchers;
bool m_metadata_dirty { false };