1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-24 01:15:07 +00:00

Kernel: Move device lookup to Device class itself

Previously, VFS stored a list of all devices, and devices had to
register and unregister themselves with it. This cleans up things
a bit.
This commit is contained in:
Sergey Bugaev 2019-08-18 14:48:15 +03:00 committed by Andreas Kling
parent d5352b87b7
commit acccf9ccda
6 changed files with 38 additions and 32 deletions

View file

@ -79,9 +79,6 @@ public:
KResult mknod(StringView path, mode_t, dev_t, Custody& base);
KResultOr<NonnullRefPtr<Custody>> open_directory(StringView path, Custody& base);
void register_device(Badge<Device>, Device&);
void unregister_device(Badge<Device>, Device&);
size_t mount_count() const { return m_mounts.size(); }
void for_each_mount(Function<void(const Mount&)>) const;
@ -89,8 +86,6 @@ public:
void sync();
Device* get_device(unsigned major, unsigned minor);
Custody& root_custody();
KResultOr<NonnullRefPtr<Custody>> resolve_path(StringView path, Custody& base, RefPtr<Custody>* parent = nullptr, int options = 0);
@ -110,7 +105,6 @@ private:
RefPtr<Inode> m_root_inode;
NonnullOwnPtrVector<Mount> m_mounts;
HashMap<u32, Device*> m_devices;
RefPtr<Custody> m_root_custody;
};