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

Improve ProtectiveMBR API #84

Open
oldgalileo opened this issue Jul 11, 2022 · 1 comment
Open

Improve ProtectiveMBR API #84

oldgalileo opened this issue Jul 11, 2022 · 1 comment

Comments

@oldgalileo
Copy link
Contributor

Currently the API for creating a ProtectiveMBR is somewhat unclear, or at least easy to misuse. While the documentation does explain that the input should be the number of logical blocks not including the PMBR, the naming and much around this is unclear.

Specifically, the lb_size term is overloaded. On GptConfig, you have logical_block_size which expects a gpt::disk::LogicalBlockSize value. lb_size itself is set to be a gpt::disk::LogicalBlockSize in many of the tests and documentation.

let mbr = gpt::mbr::ProtectiveMBR::with_lb_size(<blah>); // Wants size _in_ Logical Blocks, not size _of_ Logical Block
@oldgalileo
Copy link
Contributor Author

oldgalileo commented Jul 11, 2022

I think it makes sense to clear up these functions by moving the lb part of the function name to its signature through the introduction of a LogicalBlockLength type, as a counterpart to the LogicalBlockSize enum.

Maybe even just a Blocks(u32) tuple struct.

For the record, I find the fault here to be more with the EFI spec. The confusion there is real when it comes down to the implementation side of things.

@soerenmeier soerenmeier mentioned this issue Jun 24, 2023
8 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

No branches or pull requests

1 participant