1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 20:57:44 +00:00

Kernel: Remove most String usage from storage_name() API

This change is another minor step towards removing `AK::String` from
the Kernel. Instead of dynamically allocating the storage_name we can
instead allocate it via a KString in the factory for each device, and
then push the device name down into the StorageDevice base class.

We don't have a way of doing `AK::String::formatted(..)` with a KString
at the moment, so cleaning that up will be left for a later day.
This commit is contained in:
Brian Gianforcaro 2021-10-02 16:22:16 -07:00 committed by Andreas Kling
parent 3a945051fc
commit 70ad18fbcd
8 changed files with 45 additions and 40 deletions

View file

@ -23,10 +23,9 @@ public:
// ^DiskDevice
virtual StringView class_name() const override;
virtual String storage_name() const override;
private:
RamdiskDevice(const RamdiskController&, NonnullOwnPtr<Memory::Region>&&, int major, int minor);
RamdiskDevice(const RamdiskController&, NonnullOwnPtr<Memory::Region>&&, int major, int minor, NonnullOwnPtr<KString> device_name);
// ^BlockDevice
virtual void start_request(AsyncBlockDeviceRequest&) override;