Commit Graph

16 Commits

Author SHA1 Message Date
Timothy Flynn
c911781c21 Everywhere: Remove needless trailing semi-colons after functions
This is a new option in clang-format-16.
2023-07-08 10:32:56 +01:00
Ben Wiederhake
3d6b838df3 LibPartition: Migrate from DeprecatedFile to File
The implemented cloning mechanism should be sound:
- If a PartitionTable is passed a File with
  ShouldCloseFileDescriptor::Yes, then it will keep it alive until the
  PartitionTable is destroyed.
- If a PartitionTable is passed a File with
  ShouldCloseFileDescriptor::No, then the caller has to ensure that the
  file descriptor remains alive.
If the caller is EBRPartitionTable, the same consideration holds.
If the caller is PartitionEditor::PartitionModel, this is satisfied by
keeping an OwnPtr<Core::File> around which is the originally opened
file.

Therefore, we never leak any fds, and never access a Core::File or fd
after destroying it.
2023-06-05 14:50:09 +02:00
Liav A
500b7b08d6 Kernel: Move the Storage directory to be a new directory under Devices
The Storage subsystem, like the Audio and HID subsystems, exposes Unix
device files (for example, in the /dev directory). To ensure consistency
across the repository, we should make the Storage subsystem to reside in
the Kernel/Devices directory like the two other mentioned subsystems.
2023-06-02 11:04:37 +02:00
Andreas Kling
456f12c5c8 LibPartition: Make Kernel parts const-correct re: StorageDevice&
We can't do I/O with a const StorageDevice&, so it has to be non-const.
2023-02-21 00:54:04 +01:00
Tim Schumacher
d43a7eae54 LibCore: Rename File to DeprecatedFile
As usual, this removes many unused includes and moves used includes
further down the chain.
2023-02-13 00:50:07 +00:00
Tim Schumacher
ce2f1b845f Everywhere: Mark dependencies of most targets as PRIVATE
Otherwise, we end up propagating those dependencies into targets that
link against that library, which creates unnecessary link-time
dependencies.

Also included are changes to readd now missing dependencies to tools
that actually need them.
2022-11-01 14:49:09 +00:00
Samuel Bowman
2f8c20816e LibPartition: Fix end block off by one error
Previously, end block was inconsistent. GUIDPartitionTable treated
end block as an inclusive bound, while MBRPartitionTable and
EBRPartitionTable treated end block as an exclusive bound.
Now all three treat end block as an inclusive upper bound.
2022-07-21 20:13:44 +01:00
Samuel Bowman
380ce43afc LibPartition: Make GUIDPartitionTable kernel/userland agnostic 2022-07-21 20:13:44 +01:00
Samuel Bowman
11b4d51fc9 LibPartition: Make EBRPartitionTable kernel/userland agnostic 2022-07-21 20:13:44 +01:00
Samuel Bowman
7e45c3b687 LibPartition: Make MBRPartitionTable kernel/userland agnostic 2022-07-21 20:13:44 +01:00
Samuel Bowman
6a1c85aa61 LibPartition: Make PartitionTable kernel/userland agnostic
Previously, PartitionTable was constructed using a Kernel::StorageDevice
making it only usable in the kernel. This commit adds a new constructor
that takes a Core::File instead, making it usable in userland as well.

This also adds the m_block_size field which stores the block size of the
underlying device obtained by calling StorageDevice::block_size() in the
kernel or by using the STORAGE_DEVICE_GET_BLOCK_SIZE ioctl in userland.
This avoids the need for an #ifdef every time block size is needed.
2022-07-21 20:13:44 +01:00
Samuel Bowman
25de9de7dc Kernel+LibPartition: Move GUIDPartitionTable into LibPartition 2022-07-21 20:13:44 +01:00
Samuel Bowman
9053d86b82 Kernel+LibPartition: Move EBRPartitionTable into LibPartition 2022-07-21 20:13:44 +01:00
Samuel Bowman
1a6ef03e4a Kernel+LibPartition: Move MBRPartitionTable into LibPartition 2022-07-21 20:13:44 +01:00
Samuel Bowman
940dde9947 Kernel+LibPartition: Move PartitionTable into LibPartition 2022-07-21 20:13:44 +01:00
Samuel Bowman
be1c5c6b9f Kernel+LibPartition: Move DiskPartitionMetadata into LibPartition
This commit creates a new library LibPartition which will contain
partition related code sharable between Kernel and Userland and
includes DiskPartitionMetadata as the first shared class.
2022-07-21 20:13:44 +01:00