mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 16:07:47 +00:00
Kernel/Storage: Migrate the partition code to use the ErrorOr container
That code used the old AK::Result container, which leads to overly complicated initialization flow when trying to figure out the correct partition table type. Instead, when using the ErrorOr container the code is much simpler and more understandable.
This commit is contained in:
parent
19912a0b32
commit
5ed3f7c6bf
9 changed files with 39 additions and 50 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2020, Liav A. <liavalb@hotmail.co.il>
|
||||
* Copyright (c) 2020-2022, Liav A. <liavalb@hotmail.co.il>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
@ -7,6 +7,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <AK/ByteBuffer.h>
|
||||
#include <AK/Error.h>
|
||||
#include <AK/RefPtr.h>
|
||||
#include <AK/Result.h>
|
||||
#include <AK/Vector.h>
|
||||
|
@ -41,7 +42,7 @@ public:
|
|||
public:
|
||||
~MBRPartitionTable();
|
||||
|
||||
static Result<NonnullOwnPtr<MBRPartitionTable>, PartitionTable::Error> try_to_initialize(StorageDevice const&);
|
||||
static ErrorOr<NonnullOwnPtr<MBRPartitionTable>> try_to_initialize(StorageDevice const&);
|
||||
static OwnPtr<MBRPartitionTable> try_to_initialize(StorageDevice const&, u32 start_lba);
|
||||
explicit MBRPartitionTable(StorageDevice const&);
|
||||
MBRPartitionTable(StorageDevice const&, u32 start_lba);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue