/* * Copyright (c) 2021, sin-ack * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #include namespace Kernel { struct ISO9660FSDirectoryEntry final : public AtomicRefCounted { 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 blocks; static ErrorOr> try_create(u32 extent, u32 length, OwnPtr blocks) { return adopt_nonnull_lock_ref_or_enomem(new (nothrow) ISO9660FSDirectoryEntry(extent, length, move(blocks))); } private: ISO9660FSDirectoryEntry(u32 extent, u32 length, OwnPtr blocks) : extent(extent) , length(length) , blocks(move(blocks)) { } }; struct ISO9660FSDirectoryState { LockRefPtr entry; u32 offset { 0 }; }; }