Kernel: Fix NVMe controller namespace numbering
namespace numbers were incrementing globally instead of per controller. This led to two single namespace controllers creating nvme0n1 and nvme1n2
This commit is contained in:
@@ -11,7 +11,7 @@ namespace Kernel
|
||||
class NVMeNamespace : public StorageDevice
|
||||
{
|
||||
public:
|
||||
static BAN::ErrorOr<BAN::RefPtr<NVMeNamespace>> create(NVMeController&, uint32_t nsid, uint64_t block_count, uint32_t block_size);
|
||||
static BAN::ErrorOr<BAN::RefPtr<NVMeNamespace>> create(NVMeController&, uint32_t ns_index, uint32_t nsid, uint64_t block_count, uint32_t block_size);
|
||||
|
||||
virtual uint32_t sector_size() const override { return m_block_size; }
|
||||
virtual uint64_t total_size() const override { return m_block_size * m_block_count; }
|
||||
@@ -20,7 +20,7 @@ namespace Kernel
|
||||
virtual BAN::StringView name() const { return m_name; }
|
||||
|
||||
private:
|
||||
NVMeNamespace(NVMeController&, uint32_t nsid, uint64_t block_count, uint32_t block_size);
|
||||
NVMeNamespace(NVMeController&, uint32_t ns_index, uint32_t nsid, uint64_t block_count, uint32_t block_size);
|
||||
BAN::ErrorOr<void> initialize();
|
||||
|
||||
virtual BAN::ErrorOr<void> read_sectors_impl(uint64_t lba, uint64_t sector_count, BAN::ByteSpan) override;
|
||||
|
||||
Reference in New Issue
Block a user