mirror of
https://github.com/RGBCube/serenity
synced 2025-05-22 09:15:08 +00:00

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.
45 lines
1.1 KiB
C++
45 lines
1.1 KiB
C++
/*
|
|
* Copyright (c) 2021, Liav A. <liavalb@hotmail.co.il>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#include <AK/StringView.h>
|
|
#include <Kernel/FileSystem/OpenFileDescription.h>
|
|
#include <Kernel/Storage/AHCIController.h>
|
|
#include <Kernel/Storage/IDEChannel.h>
|
|
#include <Kernel/Storage/SATADiskDevice.h>
|
|
|
|
namespace Kernel {
|
|
|
|
NonnullRefPtr<SATADiskDevice> SATADiskDevice::create(const AHCIController& controller, const AHCIPort& port, size_t sector_size, u64 max_addressable_block)
|
|
{
|
|
return adopt_ref(*new SATADiskDevice(controller, port, sector_size, max_addressable_block));
|
|
}
|
|
|
|
SATADiskDevice::SATADiskDevice(const AHCIController& controller, const AHCIPort& port, size_t sector_size, u64 max_addressable_block)
|
|
: StorageDevice(controller, sector_size, max_addressable_block)
|
|
, m_port(port)
|
|
{
|
|
}
|
|
|
|
SATADiskDevice::~SATADiskDevice()
|
|
{
|
|
}
|
|
|
|
StringView SATADiskDevice::class_name() const
|
|
{
|
|
return "SATADiskDevice";
|
|
}
|
|
|
|
void SATADiskDevice::start_request(AsyncBlockDeviceRequest& request)
|
|
{
|
|
m_port->start_request(request);
|
|
}
|
|
|
|
String SATADiskDevice::storage_name() const
|
|
{
|
|
return String::formatted("hd{:c}", 'a' + minor());
|
|
}
|
|
|
|
}
|