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:
parent
d5352b87b7
commit
acccf9ccda
6 changed files with 38 additions and 32 deletions
|
@ -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;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue