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