mirror of
https://github.com/SerenityOS/serenity
synced 2026-05-09 00:22:43 +02:00
Kernel: Register block and character devices in separate HashMaps
Instead of putting everything in one hash map, let's distinguish between the devices based on their type. This change makes the devices semantically separated, and is considered a preparation before we could expose a comprehensive list of allocations per major numbers and their purpose.
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <Kernel/API/DeviceFileTypes.h>
|
||||
#include <Kernel/Devices/DeviceManagement.h>
|
||||
#include <Kernel/Devices/Loop/LoopDevice.h>
|
||||
#include <Kernel/FileSystem/DevLoopFS/FileSystem.h>
|
||||
@@ -57,7 +58,7 @@ ErrorOr<NonnullRefPtr<Inode>> DevLoopFS::get_inode(InodeIdentifier inode_id) con
|
||||
return *m_root_inode;
|
||||
|
||||
unsigned loop_index = inode_index_to_loop_index(inode_id.index());
|
||||
auto device = DeviceManagement::the().get_device(20, loop_index);
|
||||
auto device = DeviceManagement::the().get_device(DeviceNodeType::Block, 20, loop_index);
|
||||
VERIFY(device);
|
||||
|
||||
auto& loop_device = static_cast<LoopDevice&>(*device);
|
||||
|
||||
Reference in New Issue
Block a user