diff options
| author | Javier Martinez Canillas <[email protected]> | 2026-02-12 21:44:59 +0100 |
|---|---|---|
| committer | Heinrich Schuchardt <[email protected]> | 2026-02-15 08:43:58 +0100 |
| commit | 5e8025588862a1ec6da14af97e244a491d079e7f (patch) | |
| tree | f0f1121a7fdcd3d94262729cecef3121d2141415 /include | |
| parent | d25c5d657ec057e18eb32e2e8c354d5145e79cb0 (diff) | |
disk: part_dos: Refactor to allow retrieving raw MBR partition data
Refactor the part_get_info_extended() helper function (which already
recursively traverses DOS partitions) to optionally return the raw MBR
partition structure (dos_partition_t).
This allows other subsystems, such as EFI, to retrieve the partition
details in the legacy MBR format.
Signed-off-by: Javier Martinez Canillas <[email protected]>
Reviewed-by: Ilias Apalodimas <[email protected]>
Diffstat (limited to 'include')
| -rw-r--r-- | include/part.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/include/part.h b/include/part.h index daebbbc2e68..aed089d00f6 100644 --- a/include/part.h +++ b/include/part.h @@ -704,6 +704,20 @@ int write_mbr_partitions(struct blk_desc *dev, int layout_mbr_partitions(struct disk_partition *p, int count, lbaint_t total_sectors); +/** + * part_get_mbr() - get the MBR partition record of a partition + * + * This function reads the MBR partition record for a given block + * device and partition number. + * + * @desc: block device descriptor + * @part: partition number for which to return the partition record + * @mbr: MBR partition record + * + * Return: 0 on success, otherwise error + */ +int part_get_mbr(struct blk_desc *desc, int part, dos_partition_t *mbr); + #endif #if CONFIG_IS_ENABLED(PARTITIONS) |
