|
@@ -7,6 +7,7 @@
|
|
#include <AK/Vector.h>
|
|
#include <AK/Vector.h>
|
|
#include "InodeIdentifier.h"
|
|
#include "InodeIdentifier.h"
|
|
|
|
|
|
|
|
+class CharacterDevice;
|
|
class FileHandle;
|
|
class FileHandle;
|
|
class FileSystem;
|
|
class FileSystem;
|
|
|
|
|
|
@@ -17,6 +18,9 @@ public:
|
|
|
|
|
|
bool inUse() const { return inode.isValid(); }
|
|
bool inUse() const { return inode.isValid(); }
|
|
|
|
|
|
|
|
+ bool isCharacterDevice() const { return m_characterDevice; }
|
|
|
|
+ CharacterDevice* characterDevice() { return m_characterDevice; }
|
|
|
|
+
|
|
void retain();
|
|
void retain();
|
|
void release();
|
|
void release();
|
|
|
|
|
|
@@ -27,6 +31,7 @@ public:
|
|
friend class VirtualFileSystem;
|
|
friend class VirtualFileSystem;
|
|
VirtualFileSystem* vfs { nullptr };
|
|
VirtualFileSystem* vfs { nullptr };
|
|
unsigned retainCount { 0 };
|
|
unsigned retainCount { 0 };
|
|
|
|
+ CharacterDevice* m_characterDevice { nullptr };
|
|
};
|
|
};
|
|
|
|
|
|
VirtualFileSystem();
|
|
VirtualFileSystem();
|
|
@@ -52,6 +57,8 @@ public:
|
|
|
|
|
|
bool touch(const String&path);
|
|
bool touch(const String&path);
|
|
|
|
|
|
|
|
+ void registerCharacterDevice(unsigned major, unsigned minor, CharacterDevice&);
|
|
|
|
+
|
|
private:
|
|
private:
|
|
template<typename F> void enumerateDirectoryInode(InodeIdentifier, F func);
|
|
template<typename F> void enumerateDirectoryInode(InodeIdentifier, F func);
|
|
InodeIdentifier resolvePath(const String& path);
|
|
InodeIdentifier resolvePath(const String& path);
|
|
@@ -80,6 +87,7 @@ private:
|
|
Mount* findMountForGuest(InodeIdentifier);
|
|
Mount* findMountForGuest(InodeIdentifier);
|
|
|
|
|
|
HashMap<InodeIdentifier, Node*> m_inode2vnode;
|
|
HashMap<InodeIdentifier, Node*> m_inode2vnode;
|
|
|
|
+ HashMap<dword, Node*> m_device2vnode;
|
|
|
|
|
|
Vector<OwnPtr<Mount>> m_mounts;
|
|
Vector<OwnPtr<Mount>> m_mounts;
|
|
|
|
|
|
@@ -89,5 +97,7 @@ private:
|
|
Vector<Node*> m_nodeFreeList;
|
|
Vector<Node*> m_nodeFreeList;
|
|
|
|
|
|
RetainPtr<Node> m_rootNode;
|
|
RetainPtr<Node> m_rootNode;
|
|
|
|
+
|
|
|
|
+ HashMap<dword, CharacterDevice*> m_characterDevices;
|
|
};
|
|
};
|
|
|
|
|