1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-22 01:55:07 +00:00
serenity/Kernel/Storage/RamdiskDevice.h
Liav A 21b6d84ff0 Kernel/Devices: Remove required_mode and device_name methods
These methods are no longer needed because SystemServer is able to
populate the DevFS on its own.

Device absolute_path no longer assume a path to the /dev location,
because it really should not assume any path to a Device node.

Because StorageManagement still needs to know the storage name, we
declare a virtual method only for StorageDevices to override, but this
technique should really be removed later on.
2021-09-08 00:42:20 +02:00

38 lines
957 B
C++

/*
* Copyright (c) 2021, the SerenityOS developers.
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <Kernel/Locking/Mutex.h>
#include <Kernel/Storage/StorageDevice.h>
namespace Kernel {
class RamdiskController;
class RamdiskDevice final : public StorageDevice {
friend class RamdiskController;
AK_MAKE_ETERNAL
public:
static NonnullRefPtr<RamdiskDevice> create(const RamdiskController&, NonnullOwnPtr<Memory::Region>&& region, int major, int minor);
RamdiskDevice(const RamdiskController&, NonnullOwnPtr<Memory::Region>&&, int major, int minor);
virtual ~RamdiskDevice() override;
// ^BlockDevice
virtual void start_request(AsyncBlockDeviceRequest&) override;
// ^DiskDevice
virtual StringView class_name() const override;
virtual String storage_name() const override;
bool is_slave() const;
Mutex m_lock { "RamdiskDevice" };
NonnullOwnPtr<Memory::Region> m_region;
};
}