mirror of
https://github.com/RGBCube/serenity
synced 2025-07-24 22:37:34 +00:00
Kernel: Make device generate their own names
Besides removing the monolithic DevFSDeviceInode::determine_name() method, being able to determine a device's name inside the /dev hierarchy outside of DevFS has its uses.
This commit is contained in:
parent
a2601e1308
commit
f64e287b82
29 changed files with 76 additions and 69 deletions
|
@ -82,4 +82,11 @@ void RamdiskDevice::start_request(AsyncBlockDeviceRequest& request)
|
|||
}
|
||||
}
|
||||
|
||||
String RamdiskDevice::device_name() const
|
||||
{
|
||||
// FIXME: Try to not hardcode a maximum of 16 partitions per drive!
|
||||
size_t drive_index = minor() / 16;
|
||||
return String::formatted("ramdisk{}", drive_index);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue