Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revise Partition in-memory storage mechanism #2564

Merged
merged 2 commits into from
Oct 4, 2022

Conversation

mikee47
Copy link
Contributor

@mikee47 mikee47 commented Oct 3, 2022

This PR makes some changes to the way partition tables are constructed internally.
The changes are intended to make the system more intuitive, flexible, and to pave the way for external disk (SD card) storage interfaces.

Use linked list to store partition tables

Currently the partition table is allocated using a fixed array of Partition::Info structures.
This means any additional information would cause all partition entries to increase in size.

This has been changed to a linked list so that future extensions can be accommodated.
It also avoids having a fixed limit on the partition table size.

Replace CustomDevice::createPartition methods with partitions().add()

'create' was a poor naming choice as it doesn't write anything to storage, just updates the partition table.
These methods have been removed in favour of operating on the partitions() property directly.
The default Device::partitions() is read-only (const) but it is overridden in custom devices to support writes, etc.

Add Partition::FullType for better type/subtype handling

Partition types consist of a type and subtype component, however standard subtypes can be referred to using just the subtype as these are defined using strong enums from which the type can be inferred.

When explicitly providing both a type and subtype, this must now be provided as a FullType structure,
e.g. {Storage::Partition::Type::Data, 100}. This simplifies the API and removes any ambiguity between overloaded method parameters.

No need for hard limit on partition count
Change `CustomDevice::createPartition()` to accept pointer instead of reference
…d()`

Add `Partition::FullType` for better type/subtype handling
@mikee47 mikee47 changed the title Feature/partitions linked list Revise Partition in-memory storage mechanism Oct 3, 2022
@slaff slaff added this to the 4.7.0 milestone Oct 4, 2022
@slaff slaff merged commit 843fab8 into SmingHub:develop Oct 4, 2022
@mikee47 mikee47 deleted the feature/partitions-linked-list branch October 4, 2022 07:17
@slaff slaff mentioned this pull request Nov 8, 2022
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants