1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 23:47:45 +00:00

Kernel: Split the ISO9660FileSystem.{cpp,h} files to smaller components

This commit is contained in:
Liav A 2022-10-24 11:02:50 +03:00 committed by Andrew Kaster
parent fca3b7f1f9
commit 1c91881a1d
11 changed files with 871 additions and 779 deletions

View file

@ -0,0 +1,41 @@
/*
* Copyright (c) 2021, sin-ack <sin-ack@protonmail.com>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/Types.h>
#include <Kernel/KBuffer.h>
namespace Kernel {
struct ISO9660FSDirectoryEntry final : public AtomicRefCounted<ISO9660FSDirectoryEntry> {
u32 extent { 0 };
u32 length { 0 };
// NOTE: This can never be empty if we read the directory successfully.
// We need it as an OwnPtr to default-construct this struct.
OwnPtr<KBuffer> blocks;
static ErrorOr<NonnullLockRefPtr<ISO9660FSDirectoryEntry>> try_create(u32 extent, u32 length, OwnPtr<KBuffer> blocks)
{
return adopt_nonnull_lock_ref_or_enomem(new (nothrow) ISO9660FSDirectoryEntry(extent, length, move(blocks)));
}
private:
ISO9660FSDirectoryEntry(u32 extent, u32 length, OwnPtr<KBuffer> blocks)
: extent(extent)
, length(length)
, blocks(move(blocks))
{
}
};
struct ISO9660FSDirectoryState {
LockRefPtr<ISO9660FSDirectoryEntry> entry;
u32 offset { 0 };
};
}