mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 18:57:35 +00:00
LibCore: Rename File
to DeprecatedFile
As usual, this removes many unused includes and moves used includes further down the chain.
This commit is contained in:
parent
14951b92ca
commit
d43a7eae54
193 changed files with 536 additions and 556 deletions
|
@ -6,6 +6,10 @@
|
|||
|
||||
#include <LibPartition/EBRPartitionTable.h>
|
||||
|
||||
#ifndef KERNEL
|
||||
# include <LibCore/DeprecatedFile.h>
|
||||
#endif
|
||||
|
||||
namespace Partition {
|
||||
|
||||
#ifdef KERNEL
|
||||
|
@ -13,7 +17,7 @@ ErrorOr<NonnullOwnPtr<EBRPartitionTable>> EBRPartitionTable::try_to_initialize(K
|
|||
{
|
||||
auto table = TRY(adopt_nonnull_own_or_enomem(new (nothrow) EBRPartitionTable(device)));
|
||||
#else
|
||||
ErrorOr<NonnullOwnPtr<EBRPartitionTable>> EBRPartitionTable::try_to_initialize(NonnullRefPtr<Core::File> device_file)
|
||||
ErrorOr<NonnullOwnPtr<EBRPartitionTable>> EBRPartitionTable::try_to_initialize(NonnullRefPtr<Core::DeprecatedFile> device_file)
|
||||
{
|
||||
auto table = TRY(adopt_nonnull_own_or_enomem(new (nothrow) EBRPartitionTable(move(device_file))));
|
||||
#endif
|
||||
|
@ -27,7 +31,7 @@ ErrorOr<NonnullOwnPtr<EBRPartitionTable>> EBRPartitionTable::try_to_initialize(N
|
|||
#ifdef KERNEL
|
||||
void EBRPartitionTable::search_extended_partition(Kernel::StorageDevice const& device, MBRPartitionTable& checked_ebr, u64 current_block_offset, size_t limit)
|
||||
#else
|
||||
void EBRPartitionTable::search_extended_partition(NonnullRefPtr<Core::File> device, MBRPartitionTable& checked_ebr, u64 current_block_offset, size_t limit)
|
||||
void EBRPartitionTable::search_extended_partition(NonnullRefPtr<Core::DeprecatedFile> device, MBRPartitionTable& checked_ebr, u64 current_block_offset, size_t limit)
|
||||
#endif
|
||||
{
|
||||
if (limit == 0)
|
||||
|
@ -51,7 +55,7 @@ void EBRPartitionTable::search_extended_partition(NonnullRefPtr<Core::File> devi
|
|||
#ifdef KERNEL
|
||||
EBRPartitionTable::EBRPartitionTable(Kernel::StorageDevice const& device)
|
||||
#else
|
||||
EBRPartitionTable::EBRPartitionTable(NonnullRefPtr<Core::File> device)
|
||||
EBRPartitionTable::EBRPartitionTable(NonnullRefPtr<Core::DeprecatedFile> device)
|
||||
#endif
|
||||
: MBRPartitionTable(device)
|
||||
{
|
||||
|
|
|
@ -19,8 +19,8 @@ public:
|
|||
static ErrorOr<NonnullOwnPtr<EBRPartitionTable>> try_to_initialize(Kernel::StorageDevice const&);
|
||||
explicit EBRPartitionTable(Kernel::StorageDevice const&);
|
||||
#else
|
||||
static ErrorOr<NonnullOwnPtr<EBRPartitionTable>> try_to_initialize(NonnullRefPtr<Core::File>);
|
||||
explicit EBRPartitionTable(NonnullRefPtr<Core::File>);
|
||||
static ErrorOr<NonnullOwnPtr<EBRPartitionTable>> try_to_initialize(NonnullRefPtr<Core::DeprecatedFile>);
|
||||
explicit EBRPartitionTable(NonnullRefPtr<Core::DeprecatedFile>);
|
||||
#endif
|
||||
|
||||
virtual bool is_valid() const override
|
||||
|
@ -32,7 +32,7 @@ private:
|
|||
#ifdef KERNEL
|
||||
void search_extended_partition(Kernel::StorageDevice const&, MBRPartitionTable&, u64, size_t limit);
|
||||
#else
|
||||
void search_extended_partition(NonnullRefPtr<Core::File>, MBRPartitionTable&, u64, size_t limit);
|
||||
void search_extended_partition(NonnullRefPtr<Core::DeprecatedFile>, MBRPartitionTable&, u64, size_t limit);
|
||||
#endif
|
||||
|
||||
bool m_valid { false };
|
||||
|
|
|
@ -7,6 +7,10 @@
|
|||
#include <AK/Debug.h>
|
||||
#include <LibPartition/GUIDPartitionTable.h>
|
||||
|
||||
#ifndef KERNEL
|
||||
# include <LibCore/DeprecatedFile.h>
|
||||
#endif
|
||||
|
||||
namespace Partition {
|
||||
|
||||
#define GPT_SIGNATURE2 0x54524150
|
||||
|
@ -49,7 +53,7 @@ ErrorOr<NonnullOwnPtr<GUIDPartitionTable>> GUIDPartitionTable::try_to_initialize
|
|||
{
|
||||
auto table = TRY(adopt_nonnull_own_or_enomem(new (nothrow) GUIDPartitionTable(device)));
|
||||
#else
|
||||
ErrorOr<NonnullOwnPtr<GUIDPartitionTable>> GUIDPartitionTable::try_to_initialize(NonnullRefPtr<Core::File> device_file)
|
||||
ErrorOr<NonnullOwnPtr<GUIDPartitionTable>> GUIDPartitionTable::try_to_initialize(NonnullRefPtr<Core::DeprecatedFile> device_file)
|
||||
{
|
||||
auto table = TRY(adopt_nonnull_own_or_enomem(new (nothrow) GUIDPartitionTable(move(device_file))));
|
||||
#endif
|
||||
|
@ -62,7 +66,7 @@ ErrorOr<NonnullOwnPtr<GUIDPartitionTable>> GUIDPartitionTable::try_to_initialize
|
|||
GUIDPartitionTable::GUIDPartitionTable(Kernel::StorageDevice const& device)
|
||||
: MBRPartitionTable(device)
|
||||
#else
|
||||
GUIDPartitionTable::GUIDPartitionTable(NonnullRefPtr<Core::File> device_file)
|
||||
GUIDPartitionTable::GUIDPartitionTable(NonnullRefPtr<Core::DeprecatedFile> device_file)
|
||||
: MBRPartitionTable(move(device_file))
|
||||
#endif
|
||||
{
|
||||
|
|
|
@ -19,8 +19,8 @@ public:
|
|||
static ErrorOr<NonnullOwnPtr<GUIDPartitionTable>> try_to_initialize(Kernel::StorageDevice const&);
|
||||
explicit GUIDPartitionTable(Kernel::StorageDevice const&);
|
||||
#else
|
||||
static ErrorOr<NonnullOwnPtr<GUIDPartitionTable>> try_to_initialize(NonnullRefPtr<Core::File>);
|
||||
explicit GUIDPartitionTable(NonnullRefPtr<Core::File>);
|
||||
static ErrorOr<NonnullOwnPtr<GUIDPartitionTable>> try_to_initialize(NonnullRefPtr<Core::DeprecatedFile>);
|
||||
explicit GUIDPartitionTable(NonnullRefPtr<Core::DeprecatedFile>);
|
||||
#endif
|
||||
|
||||
virtual bool is_valid() const override
|
||||
|
|
|
@ -7,6 +7,10 @@
|
|||
#include <AK/Debug.h>
|
||||
#include <LibPartition/MBRPartitionTable.h>
|
||||
|
||||
#ifndef KERNEL
|
||||
# include <LibCore/DeprecatedFile.h>
|
||||
#endif
|
||||
|
||||
namespace Partition {
|
||||
|
||||
#define MBR_SIGNATURE 0xaa55
|
||||
|
@ -19,7 +23,7 @@ ErrorOr<NonnullOwnPtr<MBRPartitionTable>> MBRPartitionTable::try_to_initialize(K
|
|||
{
|
||||
auto table = TRY(adopt_nonnull_own_or_enomem(new (nothrow) MBRPartitionTable(device)));
|
||||
#else
|
||||
ErrorOr<NonnullOwnPtr<MBRPartitionTable>> MBRPartitionTable::try_to_initialize(NonnullRefPtr<Core::File> device_file)
|
||||
ErrorOr<NonnullOwnPtr<MBRPartitionTable>> MBRPartitionTable::try_to_initialize(NonnullRefPtr<Core::DeprecatedFile> device_file)
|
||||
{
|
||||
auto table = TRY(adopt_nonnull_own_or_enomem(new (nothrow) MBRPartitionTable(move(device_file))));
|
||||
#endif
|
||||
|
@ -37,7 +41,7 @@ OwnPtr<MBRPartitionTable> MBRPartitionTable::try_to_initialize(Kernel::StorageDe
|
|||
{
|
||||
auto table = adopt_nonnull_own_or_enomem(new (nothrow) MBRPartitionTable(device, start_lba)).release_value_but_fixme_should_propagate_errors();
|
||||
#else
|
||||
OwnPtr<MBRPartitionTable> MBRPartitionTable::try_to_initialize(NonnullRefPtr<Core::File> device_file, u32 start_lba)
|
||||
OwnPtr<MBRPartitionTable> MBRPartitionTable::try_to_initialize(NonnullRefPtr<Core::DeprecatedFile> device_file, u32 start_lba)
|
||||
{
|
||||
auto table = adopt_nonnull_own_or_enomem(new (nothrow) MBRPartitionTable(move(device_file), start_lba)).release_value_but_fixme_should_propagate_errors();
|
||||
#endif
|
||||
|
@ -65,7 +69,7 @@ bool MBRPartitionTable::read_boot_record()
|
|||
MBRPartitionTable::MBRPartitionTable(Kernel::StorageDevice const& device, u32 start_lba)
|
||||
: PartitionTable(device)
|
||||
#else
|
||||
MBRPartitionTable::MBRPartitionTable(NonnullRefPtr<Core::File> device_file, u32 start_lba)
|
||||
MBRPartitionTable::MBRPartitionTable(NonnullRefPtr<Core::DeprecatedFile> device_file, u32 start_lba)
|
||||
: PartitionTable(move(device_file))
|
||||
#endif
|
||||
, m_start_lba(start_lba)
|
||||
|
@ -91,7 +95,7 @@ MBRPartitionTable::MBRPartitionTable(NonnullRefPtr<Core::File> device_file, u32
|
|||
MBRPartitionTable::MBRPartitionTable(Kernel::StorageDevice const& device)
|
||||
: PartitionTable(device)
|
||||
#else
|
||||
MBRPartitionTable::MBRPartitionTable(NonnullRefPtr<Core::File> device_file)
|
||||
MBRPartitionTable::MBRPartitionTable(NonnullRefPtr<Core::DeprecatedFile> device_file)
|
||||
: PartitionTable(move(device_file))
|
||||
#endif
|
||||
, m_start_lba(0)
|
||||
|
|
|
@ -44,10 +44,10 @@ public:
|
|||
explicit MBRPartitionTable(Kernel::StorageDevice const&);
|
||||
MBRPartitionTable(Kernel::StorageDevice const&, u32 start_lba);
|
||||
#else
|
||||
static ErrorOr<NonnullOwnPtr<MBRPartitionTable>> try_to_initialize(NonnullRefPtr<Core::File>);
|
||||
static OwnPtr<MBRPartitionTable> try_to_initialize(NonnullRefPtr<Core::File>, u32 start_lba);
|
||||
explicit MBRPartitionTable(NonnullRefPtr<Core::File>);
|
||||
MBRPartitionTable(NonnullRefPtr<Core::File>, u32 start_lba);
|
||||
static ErrorOr<NonnullOwnPtr<MBRPartitionTable>> try_to_initialize(NonnullRefPtr<Core::DeprecatedFile>);
|
||||
static OwnPtr<MBRPartitionTable> try_to_initialize(NonnullRefPtr<Core::DeprecatedFile>, u32 start_lba);
|
||||
explicit MBRPartitionTable(NonnullRefPtr<Core::DeprecatedFile>);
|
||||
MBRPartitionTable(NonnullRefPtr<Core::DeprecatedFile>, u32 start_lba);
|
||||
#endif
|
||||
|
||||
bool is_protective_mbr() const;
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
#include <LibPartition/PartitionTable.h>
|
||||
|
||||
#ifndef KERNEL
|
||||
# include <LibCore/DeprecatedFile.h>
|
||||
# include <sys/ioctl.h>
|
||||
#endif
|
||||
|
||||
|
@ -19,7 +20,7 @@ PartitionTable::PartitionTable(Kernel::StorageDevice const& device)
|
|||
{
|
||||
}
|
||||
#else
|
||||
PartitionTable::PartitionTable(NonnullRefPtr<Core::File> device_file)
|
||||
PartitionTable::PartitionTable(NonnullRefPtr<Core::DeprecatedFile> device_file)
|
||||
: m_device_file(device_file)
|
||||
{
|
||||
VERIFY(ioctl(m_device_file->leak_fd(), STORAGE_DEVICE_GET_BLOCK_SIZE, &m_block_size) >= 0);
|
||||
|
|
|
@ -6,12 +6,13 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <AK/NonnullRefPtr.h>
|
||||
#include <LibPartition/DiskPartitionMetadata.h>
|
||||
|
||||
#ifdef KERNEL
|
||||
# include <Kernel/Storage/StorageDevice.h>
|
||||
#else
|
||||
# include <LibCore/File.h>
|
||||
# include <LibCore/Forward.h>
|
||||
#endif
|
||||
|
||||
namespace Partition {
|
||||
|
@ -31,8 +32,8 @@ protected:
|
|||
explicit PartitionTable(Kernel::StorageDevice const&);
|
||||
NonnullRefPtr<Kernel::StorageDevice> m_device;
|
||||
#else
|
||||
explicit PartitionTable(NonnullRefPtr<Core::File>);
|
||||
NonnullRefPtr<Core::File> m_device_file;
|
||||
explicit PartitionTable(NonnullRefPtr<Core::DeprecatedFile>);
|
||||
NonnullRefPtr<Core::DeprecatedFile> m_device_file;
|
||||
#endif
|
||||
|
||||
Vector<DiskPartitionMetadata> m_partitions;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue